diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9c3000d..963cb24 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,37 +1,35 @@ lockVersion: 2.0.0 id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 management: - docChecksum: addaf2dfdac23cef2e234b64492b9c90 - docVersion: 0.0.3 - speakeasyVersion: 1.635.1 - generationVersion: 2.722.2 - releaseVersion: 0.25.0 - configChecksum: 4ca3994cb62bfd5beb1e6c5c6b0ef941 + docChecksum: 2a6e4c8f6e1fedff5a37da76411f22df + docVersion: 1.1.1 + speakeasyVersion: 1.636.3 + generationVersion: 2.723.11 + releaseVersion: 0.26.0 + configChecksum: e7e1dae9b6eff1efa39b10ed4f34379c repoURL: https://github.com/LukeHagar/plexgo.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexgo published: true features: go: + acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 + additionalProperties: 0.1.2 constsAndDefaults: 0.1.12 core: 3.11.1 + deepObjectParams: 0.1.1 defaultEnabledRetries: 0.2.0 - deprecations: 2.81.3 downloadStreams: 0.1.2 - enums: 2.82.0 envVarSecurityUsage: 0.3.2 - errors: 2.83.0 - flattening: 2.81.1 + examples: 2.81.5 globalSecurity: 2.82.12 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.3 + globals: 2.82.2 intellisenseMarkdownSupport: 0.1.0 - methodServerURLs: 2.82.1 nameOverrides: 2.81.2 - nullables: 0.2.1 - openEnums: 0.1.0 responseFormat: 0.1.2 retries: 2.84.2 sdkHooks: 0.2.0 @@ -39,1108 +37,1347 @@ features: uploadStreams: 0.1.0 generatedFiles: - .gitattributes + - /models/components/accepts.go + - /models/components/advancedsubtitles.go + - /models/components/boolint.go + - /models/components/channel.go + - /models/components/channelmapping.go + - /models/components/composite.go + - /models/components/device.go + - /models/components/directory.go + - /models/components/dvrrequesthandlerslashgetresponses200.go + - /models/components/filter.go + - /models/components/getresponses200.go + - /models/components/historyallgetresponses200.go + - /models/components/hub.go + - /models/components/image.go + - /models/components/items.go + - /models/components/librarysection.go + - /models/components/lineup.go + - /models/components/location.go + - /models/components/media.go + - /models/components/mediacontainer.go + - /models/components/mediacontainerwithartwork.go + - /models/components/mediacontainerwithdecision.go + - /models/components/mediacontainerwithdevice.go + - /models/components/mediacontainerwithdirectory.go + - /models/components/mediacontainerwithhubs.go + - /models/components/mediacontainerwithlineup.go + - /models/components/mediacontainerwithmetadata.go + - /models/components/mediacontainerwithnestedmetadata.go + - /models/components/mediacontainerwithplaylistmetadata.go + - /models/components/mediacontainerwithsettings.go + - /models/components/mediacontainerwithsubscription.go + - /models/components/mediagraboperation.go + - /models/components/mediaquery.go + - /models/components/mediasubscription.go + - /models/components/metadata.go + - /models/components/part.go + - /models/components/player.go + - /models/components/postresponses200.go + - /models/components/protocol.go + - /models/components/requesthandlerslashgetresponses200.go - /models/components/security.go - - /models/operations/addplaylistcontents.go + - /models/components/session.go + - /models/components/setting.go + - /models/components/slashgetresponses200.go + - /models/components/sort.go + - /models/components/stream.go + - /models/components/subtitles.go + - /models/components/tag.go + - /models/components/transcodesession.go + - /models/components/transcodetype.go + - /models/components/user.go + - /models/operations/addcollectionitems.go + - /models/operations/adddevice.go + - /models/operations/adddevicetodvr.go + - /models/operations/adddownloadqueueitems.go + - /models/operations/addextras.go + - /models/operations/addlineup.go + - /models/operations/addplaylistitems.go + - /models/operations/addprovider.go + - /models/operations/addsection.go + - /models/operations/addsubtitles.go + - /models/operations/addtoplayqueue.go + - /models/operations/analyzemetadata.go - /models/operations/applyupdates.go - - /models/operations/cancelserveractivities.go - - /models/operations/checkforupdates.go - - /models/operations/clearplaylistcontents.go + - /models/operations/autocomplete.go + - /models/operations/cancelactivity.go + - /models/operations/cancelgrab.go + - /models/operations/cancelrefresh.go + - /models/operations/checkupdates.go + - /models/operations/cleanbundles.go + - /models/operations/clearplaylistitems.go + - /models/operations/clearplayqueue.go + - /models/operations/computechannelmap.go + - /models/operations/connectwebsocket.go + - /models/operations/createcollection.go + - /models/operations/createcustomhub.go + - /models/operations/createdownloadqueue.go + - /models/operations/createdvr.go + - /models/operations/createmarker.go - /models/operations/createplaylist.go - - /models/operations/deletelibrary.go + - /models/operations/createplayqueue.go + - /models/operations/createsubscription.go + - /models/operations/deletecaches.go + - /models/operations/deletecollection.go + - /models/operations/deletecollectionitem.go + - /models/operations/deletecustomhub.go + - /models/operations/deletedvr.go + - /models/operations/deletehistory.go + - /models/operations/deleteindexes.go + - /models/operations/deleteintros.go + - /models/operations/deletelibrarysection.go + - /models/operations/deletelineup.go + - /models/operations/deletemarker.go + - /models/operations/deletemediaitem.go + - /models/operations/deletemediaprovider.go + - /models/operations/deletemetadataitem.go - /models/operations/deleteplaylist.go + - /models/operations/deleteplaylistitem.go + - /models/operations/deleteplayqueueitem.go + - /models/operations/deletestream.go + - /models/operations/deletesubscription.go + - /models/operations/detectads.go + - /models/operations/detectcredits.go + - /models/operations/detectintros.go + - /models/operations/detectvoiceactivity.go + - /models/operations/discoverdevices.go + - /models/operations/editmarker.go + - /models/operations/editmetadataitem.go + - /models/operations/editsection.go + - /models/operations/editsubscriptionpreferences.go + - /models/operations/emptytrash.go - /models/operations/enablepapertrail.go - - /models/operations/getactorslibrary.go - - /models/operations/getalllibraries.go - - /models/operations/getavailableclients.go - - /models/operations/getbandwidthstatistics.go - - /models/operations/getbannerimage.go - - /models/operations/getbutlertasks.go - - /models/operations/getcompanionsdata.go - - /models/operations/getcountrieslibrary.go - - /models/operations/getdevices.go - - /models/operations/getfilehash.go - - /models/operations/getgenreslibrary.go - - /models/operations/getgeodata.go - - /models/operations/getglobalhubs.go - - /models/operations/gethomedata.go + - /models/operations/generatethumbs.go + - /models/operations/getalbums.go + - /models/operations/getallhubs.go + - /models/operations/getallitemleaves.go + - /models/operations/getalllanguages.go + - /models/operations/getallleaves.go + - /models/operations/getallpreferences.go + - /models/operations/getallsubscriptions.go + - /models/operations/getarts.go + - /models/operations/getaugmentationstatus.go + - /models/operations/getavailablegrabbers.go + - /models/operations/getavailablesorts.go + - /models/operations/getbackgroundtasks.go + - /models/operations/getcategories.go + - /models/operations/getchannels.go + - /models/operations/getchapterimage.go + - /models/operations/getcluster.go + - /models/operations/getcollectionimage.go + - /models/operations/getcollectionitems.go + - /models/operations/getcollections.go + - /models/operations/getcolors.go + - /models/operations/getcommon.go + - /models/operations/getcontinuewatching.go + - /models/operations/getcountries.go + - /models/operations/getcountrieslineups.go + - /models/operations/getcountryregions.go + - /models/operations/getdevicedetails.go + - /models/operations/getdeviceschannels.go + - /models/operations/getdownloadqueue.go + - /models/operations/getdownloadqueueitems.go + - /models/operations/getdownloadqueuemedia.go + - /models/operations/getdvr.go + - /models/operations/getextras.go + - /models/operations/getfile.go + - /models/operations/getfirstcharacters.go + - /models/operations/getfolders.go + - /models/operations/gethistoryitem.go + - /models/operations/gethubitems.go + - /models/operations/getidentity.go + - /models/operations/getimage.go + - /models/operations/getimagefrombif.go + - /models/operations/getitemartwork.go + - /models/operations/getitemdecision.go + - /models/operations/getitemtree.go - /models/operations/getlibrarydetails.go - - /models/operations/getlibraryhubs.go - /models/operations/getlibraryitems.go - - /models/operations/getlibrarysectionsall.go - - /models/operations/getmediaarts.go - - /models/operations/getmediametadata.go - - /models/operations/getmediaposters.go - - /models/operations/getmediaproviders.go - - /models/operations/getmetadatachildren.go - - /models/operations/getmyplexaccount.go - - /models/operations/getpin.go + - /models/operations/getlibrarymatches.go + - /models/operations/getlineup.go + - /models/operations/getlineupchannels.go + - /models/operations/getlivetvsession.go + - /models/operations/getmediapart.go + - /models/operations/getmetadatahubs.go + - /models/operations/getmetadataitem.go + - /models/operations/getnotifications.go + - /models/operations/getpartindex.go + - /models/operations/getperson.go - /models/operations/getplaylist.go - - /models/operations/getplaylistcontents.go - - /models/operations/getplaylists.go - - /models/operations/getrecentlyadded.go - - /models/operations/getrecentlyaddedlibrary.go - - /models/operations/getrefreshlibrarymetadata.go - - /models/operations/getresizedphoto.go - - /models/operations/getresourcesstatistics.go - - /models/operations/getsearchalllibraries.go - - /models/operations/getsearchlibrary.go - - /models/operations/getsearchresults.go - - /models/operations/getserveractivities.go - - /models/operations/getservercapabilities.go - - /models/operations/getserveridentity.go - - /models/operations/getserverlist.go - - /models/operations/getserverpreferences.go - - /models/operations/getserverresources.go - - /models/operations/getsessionhistory.go + - /models/operations/getplaylistgenerator.go + - /models/operations/getplaylistgeneratoritems.go + - /models/operations/getplaylistgenerators.go + - /models/operations/getplaylistitems.go + - /models/operations/getplayqueue.go + - /models/operations/getpostplayhubs.go + - /models/operations/getpreference.go + - /models/operations/getpromotedhubs.go + - /models/operations/getrandomartwork.go + - /models/operations/getrelatedhubs.go + - /models/operations/getrelateditems.go + - /models/operations/getscheduledrecordings.go + - /models/operations/getsectionfilters.go + - /models/operations/getsectionhubs.go + - /models/operations/getsectionimage.go + - /models/operations/getsectionpreferences.go + - /models/operations/getsections.go + - /models/operations/getsectionsprefs.go + - /models/operations/getserverinfo.go + - /models/operations/getsessionplaylistindex.go - /models/operations/getsessions.go + - /models/operations/getsessionsegment.go + - /models/operations/getsonicallysimilar.go + - /models/operations/getsonicpath.go - /models/operations/getsourceconnectioninformation.go - - /models/operations/getstatistics.go - - /models/operations/getthumbimage.go - - /models/operations/gettimeline.go - - /models/operations/gettokenbypinid.go - - /models/operations/gettokendetails.go - - /models/operations/gettopwatchedcontent.go - - /models/operations/gettranscodesessions.go + - /models/operations/getstream.go + - /models/operations/getstreamlevels.go + - /models/operations/getstreamloudness.go + - /models/operations/getsubscription.go + - /models/operations/gettags.go + - /models/operations/gettasks.go + - /models/operations/gettemplate.go + - /models/operations/getthumb.go - /models/operations/gettransienttoken.go - - /models/operations/getupdatestatus.go - - /models/operations/getuserfriends.go - - /models/operations/getusers.go - - /models/operations/getwatchlist.go - - /models/operations/logline.go - - /models/operations/logmultiline.go + - /models/operations/getupdatesstatus.go + - /models/operations/ingesttransientitem.go + - /models/operations/listactivities.go + - /models/operations/listcontent.go + - /models/operations/listdevices.go + - /models/operations/listdownloadqueueitems.go + - /models/operations/listdvrs.go + - /models/operations/listhubs.go + - /models/operations/listlineups.go + - /models/operations/listmatches.go + - /models/operations/listmoments.go + - /models/operations/listpersonmedia.go + - /models/operations/listplaybackhistory.go + - /models/operations/listplaylists.go + - /models/operations/listproviders.go + - /models/operations/listsessions.go + - /models/operations/listsimilar.go + - /models/operations/listsonicallysimilar.go + - /models/operations/listtopusers.go + - /models/operations/makedecision.go - /models/operations/markplayed.go - - /models/operations/markunplayed.go - - /models/operations/performsearch.go - - /models/operations/performvoicesearch.go - - /models/operations/postmediaarts.go - - /models/operations/postmediaposter.go - - /models/operations/postuserssignindata.go - - /models/operations/startalltasks.go + - /models/operations/matchitem.go + - /models/operations/mergeitems.go + - /models/operations/modifydevice.go + - /models/operations/modifyplaylistgenerator.go + - /models/operations/movecollectionitem.go + - /models/operations/movehub.go + - /models/operations/moveplaylistitem.go + - /models/operations/moveplayqueueitem.go + - /models/operations/optimizedatabase.go + - /models/operations/processsubscriptions.go + - /models/operations/refreshitemsmetadata.go + - /models/operations/refreshplaylist.go + - /models/operations/refreshproviders.go + - /models/operations/refreshsection.go + - /models/operations/refreshsectionsmetadata.go + - /models/operations/reloadguide.go + - /models/operations/removedevice.go + - /models/operations/removedevicefromdvr.go + - /models/operations/removedownloadqueueitems.go + - /models/operations/reordersubscription.go + - /models/operations/report.go + - /models/operations/resetplayqueue.go + - /models/operations/resetsectiondefaults.go + - /models/operations/restartprocessingdownloadqueueitems.go + - /models/operations/scan.go + - /models/operations/searchhubs.go + - /models/operations/setchannelmap.go + - /models/operations/setdevicepreferences.go + - /models/operations/setdvrpreferences.go + - /models/operations/setitemartwork.go + - /models/operations/setitempreferences.go + - /models/operations/setpreferences.go + - /models/operations/setrating.go + - /models/operations/setsectionpreferences.go + - /models/operations/setstreamoffset.go + - /models/operations/setstreamselection.go + - /models/operations/shuffle.go + - /models/operations/splititem.go + - /models/operations/startanalysis.go + - /models/operations/startbifgeneration.go - /models/operations/starttask.go - - /models/operations/startuniversaltranscode.go - - /models/operations/stopalltasks.go + - /models/operations/starttasks.go + - /models/operations/starttranscodesession.go + - /models/operations/stopallrefreshes.go + - /models/operations/stopdvrreload.go + - /models/operations/stopscan.go - /models/operations/stoptask.go - - /models/operations/stoptranscodesession.go + - /models/operations/stoptasks.go + - /models/operations/terminatesession.go + - /models/operations/transcodeimage.go + - /models/operations/transcodesubtitles.go + - /models/operations/triggerfallback.go + - /models/operations/tunechannel.go + - /models/operations/unmatch.go + - /models/operations/unscrobble.go + - /models/operations/unshuffle.go + - /models/operations/updatehubvisibility.go + - /models/operations/updateitemartwork.go + - /models/operations/updateitems.go - /models/operations/updateplaylist.go - - /models/operations/updateplayprogress.go - /models/operations/uploadplaylist.go - - /models/sdkerrors/addplaylistcontents.go - - /models/sdkerrors/applyupdates.go - - /models/sdkerrors/cancelserveractivities.go - - /models/sdkerrors/checkforupdates.go - - /models/sdkerrors/clearplaylistcontents.go - - /models/sdkerrors/createplaylist.go - - /models/sdkerrors/deletelibrary.go - - /models/sdkerrors/deleteplaylist.go - - /models/sdkerrors/enablepapertrail.go - - /models/sdkerrors/getactorslibrary.go - - /models/sdkerrors/getalllibraries.go - - /models/sdkerrors/getavailableclients.go - - /models/sdkerrors/getbandwidthstatistics.go - - /models/sdkerrors/getbannerimage.go - - /models/sdkerrors/getbutlertasks.go - - /models/sdkerrors/getcompanionsdata.go - - /models/sdkerrors/getcountrieslibrary.go - - /models/sdkerrors/getdevices.go - - /models/sdkerrors/getfilehash.go - - /models/sdkerrors/getgenreslibrary.go - - /models/sdkerrors/getgeodata.go - - /models/sdkerrors/getglobalhubs.go - - /models/sdkerrors/gethomedata.go - - /models/sdkerrors/getlibrarydetails.go - - /models/sdkerrors/getlibraryhubs.go - - /models/sdkerrors/getlibraryitems.go - - /models/sdkerrors/getlibrarysectionsall.go - - /models/sdkerrors/getmediametadata.go - - /models/sdkerrors/getmediaproviders.go - - /models/sdkerrors/getmetadatachildren.go - - /models/sdkerrors/getmyplexaccount.go - - /models/sdkerrors/getpin.go - - /models/sdkerrors/getplaylist.go - - /models/sdkerrors/getplaylistcontents.go - - /models/sdkerrors/getplaylists.go - - /models/sdkerrors/getrecentlyaddedlibrary.go - - /models/sdkerrors/getrefreshlibrarymetadata.go - - /models/sdkerrors/getresizedphoto.go - - /models/sdkerrors/getresourcesstatistics.go - - /models/sdkerrors/getsearchalllibraries.go - - /models/sdkerrors/getsearchlibrary.go - - /models/sdkerrors/getsearchresults.go - - /models/sdkerrors/getserveractivities.go - - /models/sdkerrors/getservercapabilities.go - - /models/sdkerrors/getserveridentity.go - - /models/sdkerrors/getserverlist.go - - /models/sdkerrors/getserverpreferences.go - - /models/sdkerrors/getserverresources.go - - /models/sdkerrors/getsessionhistory.go - - /models/sdkerrors/getsessions.go - - /models/sdkerrors/getsourceconnectioninformation.go - - /models/sdkerrors/getstatistics.go - - /models/sdkerrors/getthumbimage.go - - /models/sdkerrors/gettimeline.go - - /models/sdkerrors/gettokenbypinid.go - - /models/sdkerrors/gettokendetails.go - - /models/sdkerrors/gettopwatchedcontent.go - - /models/sdkerrors/gettranscodesessions.go - - /models/sdkerrors/gettransienttoken.go - - /models/sdkerrors/getupdatestatus.go - - /models/sdkerrors/getuserfriends.go - - /models/sdkerrors/getusers.go - - /models/sdkerrors/getwatchlist.go - - /models/sdkerrors/logline.go - - /models/sdkerrors/logmultiline.go - - /models/sdkerrors/markplayed.go - - /models/sdkerrors/markunplayed.go - - /models/sdkerrors/performsearch.go - - /models/sdkerrors/performvoicesearch.go - - /models/sdkerrors/postuserssignindata.go - - /models/sdkerrors/startalltasks.go - - /models/sdkerrors/starttask.go - - /models/sdkerrors/startuniversaltranscode.go - - /models/sdkerrors/stopalltasks.go - - /models/sdkerrors/stoptask.go - - /models/sdkerrors/stoptranscodesession.go - - /models/sdkerrors/updateplaylist.go - - /models/sdkerrors/updateplayprogress.go - - /models/sdkerrors/uploadplaylist.go + - /models/operations/voicesearchhubs.go + - /models/operations/writelog.go + - /models/operations/writemessage.go - USAGE.md - activities.go - - authentication.go - butler.go + - collections.go + - content.go + - devices.go + - docs/models/components/accepts.md + - docs/models/components/advancedsubtitles.md + - docs/models/components/airingstype.md + - docs/models/components/boolint.md + - docs/models/components/channel.md + - docs/models/components/channelmapping.md + - docs/models/components/composite.md + - docs/models/components/compositemedia.md + - docs/models/components/crop.md + - docs/models/components/decision.md + - docs/models/components/default.md + - docs/models/components/defaultdirection.md + - docs/models/components/device.md + - docs/models/components/directory.md + - docs/models/components/dvr.md + - docs/models/components/dvrrequesthandlerslashgetresponses200.md + - docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainer.md + - docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainermediacontainer.md + - docs/models/components/filter.md + - docs/models/components/filterpivot.md + - docs/models/components/format.md + - docs/models/components/getresponses200.md + - docs/models/components/getresponses200hub.md + - docs/models/components/getresponses200mediacontainer.md + - docs/models/components/historyallgetresponses200.md + - docs/models/components/historyallgetresponses200mediacontainer.md + - docs/models/components/historyallgetresponses200metadata.md + - docs/models/components/homevisibility.md + - docs/models/components/hub.md + - docs/models/components/image.md + - docs/models/components/imagetype.md + - docs/models/components/items.md + - docs/models/components/librarysection.md + - docs/models/components/librarysectionlocation.md + - docs/models/components/lineup.md + - docs/models/components/lineuptype.md + - docs/models/components/location.md + - docs/models/components/media.md + - docs/models/components/mediacontainer.md + - docs/models/components/mediacontainerwithartwork.md + - docs/models/components/mediacontainerwithartworkmediacontainer.md + - docs/models/components/mediacontainerwithartworkmetadata.md + - docs/models/components/mediacontainerwithartworktype.md + - docs/models/components/mediacontainerwithdecision.md + - docs/models/components/mediacontainerwithdecisiondecision.md + - docs/models/components/mediacontainerwithdecisionlocation.md + - docs/models/components/mediacontainerwithdecisionmedia.md + - docs/models/components/mediacontainerwithdecisionmediacontainer.md + - docs/models/components/mediacontainerwithdecisionmetadata.md + - docs/models/components/mediacontainerwithdecisionpart.md + - docs/models/components/mediacontainerwithdecisionstream.md + - docs/models/components/mediacontainerwithdevice.md + - docs/models/components/mediacontainerwithdevicedevice.md + - docs/models/components/mediacontainerwithdevicemediacontainer.md + - docs/models/components/mediacontainerwithdirectory.md + - docs/models/components/mediacontainerwithdirectorymediacontainer.md + - docs/models/components/mediacontainerwithhubs.md + - docs/models/components/mediacontainerwithhubsmediacontainer.md + - docs/models/components/mediacontainerwithlineup.md + - docs/models/components/mediacontainerwithlineupmediacontainer.md + - docs/models/components/mediacontainerwithmetadata.md + - docs/models/components/mediacontainerwithmetadatamediacontainer.md + - docs/models/components/mediacontainerwithnestedmetadata.md + - docs/models/components/mediacontainerwithnestedmetadatamediacontainer.md + - docs/models/components/mediacontainerwithplaylistmetadata.md + - docs/models/components/mediacontainerwithplaylistmetadatamediacontainer.md + - docs/models/components/mediacontainerwithplaylistmetadatametadata.md + - docs/models/components/mediacontainerwithsettings.md + - docs/models/components/mediacontainerwithsettingsmediacontainer.md + - docs/models/components/mediacontainerwithsubscription.md + - docs/models/components/mediacontainerwithsubscriptionmediacontainer.md + - docs/models/components/mediagraboperation.md + - docs/models/components/mediaquery.md + - docs/models/components/mediasubscription.md + - docs/models/components/metadata.md + - docs/models/components/metadataitem.md + - docs/models/components/part.md + - docs/models/components/pivot.md + - docs/models/components/player.md + - docs/models/components/playlisttype.md + - docs/models/components/postresponses200.md + - docs/models/components/postresponses200mediacontainer.md + - docs/models/components/postresponses200type.md + - docs/models/components/protocol.md + - docs/models/components/recommendationsvisibility.md + - docs/models/components/requesthandlerslashgetresponses200.md + - docs/models/components/requesthandlerslashgetresponses200directory.md + - docs/models/components/requesthandlerslashgetresponses200mediacontainer.md - docs/models/components/security.md + - docs/models/components/session.md + - docs/models/components/sessionlocation.md + - docs/models/components/setting.md + - docs/models/components/slashgetresponses200.md + - docs/models/components/slashgetresponses200mediacontainer.md + - docs/models/components/sort.md + - docs/models/components/sortdefault.md + - docs/models/components/sortpivot.md + - docs/models/components/status.md + - docs/models/components/stream.md + - docs/models/components/subtitles.md + - docs/models/components/tag.md + - docs/models/components/transcodesession.md + - docs/models/components/transcodetype.md + - docs/models/components/type.md + - docs/models/components/user.md + - docs/models/components/value.md - docs/models/operations/account.md - docs/models/operations/action.md - - docs/models/operations/activedirection.md - docs/models/operations/activity.md - - docs/models/operations/addplaylistcontentsmediacontainer.md - - docs/models/operations/addplaylistcontentsmetadata.md - - docs/models/operations/addplaylistcontentsrequest.md - - docs/models/operations/addplaylistcontentsresponse.md - - docs/models/operations/addplaylistcontentsresponsebody.md - - docs/models/operations/alllibraries.md - - docs/models/operations/allowcameraupload.md - - docs/models/operations/allowchannels.md - - docs/models/operations/allowsubtitleadmin.md - - docs/models/operations/allowsync.md - - docs/models/operations/allowtuners.md + - docs/models/operations/addcollectionitemsglobals.md + - docs/models/operations/addcollectionitemsrequest.md + - docs/models/operations/addcollectionitemsresponse.md + - docs/models/operations/adddeviceglobals.md + - docs/models/operations/adddevicerequest.md + - docs/models/operations/adddeviceresponse.md + - docs/models/operations/adddevicetodvrdvr.md + - docs/models/operations/adddevicetodvrdvrsmediacontainer.md + - docs/models/operations/adddevicetodvrglobals.md + - docs/models/operations/adddevicetodvrmediacontainer.md + - docs/models/operations/adddevicetodvrrequest.md + - docs/models/operations/adddevicetodvrresponse.md + - docs/models/operations/adddevicetodvrresponsebody.md + - docs/models/operations/adddownloadqueueitemsglobals.md + - docs/models/operations/adddownloadqueueitemsmediacontainer.md + - docs/models/operations/adddownloadqueueitemsrequest.md + - docs/models/operations/adddownloadqueueitemsresponse.md + - docs/models/operations/adddownloadqueueitemsresponsebody.md + - docs/models/operations/addedqueueitems.md + - docs/models/operations/addextrasglobals.md + - docs/models/operations/addextrasrequest.md + - docs/models/operations/addextrasresponse.md + - docs/models/operations/addlineupdvr.md + - docs/models/operations/addlineupdvrsmediacontainer.md + - docs/models/operations/addlineupglobals.md + - docs/models/operations/addlineupmediacontainer.md + - docs/models/operations/addlineuprequest.md + - docs/models/operations/addlineupresponse.md + - docs/models/operations/addlineupresponsebody.md + - docs/models/operations/addplaylistitemsglobals.md + - docs/models/operations/addplaylistitemsrequest.md + - docs/models/operations/addplaylistitemsresponse.md + - docs/models/operations/addproviderglobals.md + - docs/models/operations/addproviderrequest.md + - docs/models/operations/addproviderresponse.md + - docs/models/operations/addsectionglobals.md + - docs/models/operations/addsectionrequest.md + - docs/models/operations/addsectionresponse.md + - docs/models/operations/addsubtitlesglobals.md + - docs/models/operations/addsubtitlesrequest.md + - docs/models/operations/addsubtitlesresponse.md + - docs/models/operations/addtoplayqueueglobals.md + - docs/models/operations/addtoplayqueuerequest.md + - docs/models/operations/addtoplayqueueresponse.md + - docs/models/operations/advancedsubtitles.md + - docs/models/operations/analyzemetadataglobals.md + - docs/models/operations/analyzemetadatarequest.md + - docs/models/operations/analyzemetadataresponse.md + - docs/models/operations/applyupdatesglobals.md - docs/models/operations/applyupdatesrequest.md - docs/models/operations/applyupdatesresponse.md + - docs/models/operations/args.md - docs/models/operations/attributes.md - - docs/models/operations/autoselectsubtitle.md - - docs/models/operations/billing.md + - docs/models/operations/autocompleteglobals.md + - docs/models/operations/autocompleterequest.md + - docs/models/operations/autocompleteresponse.md + - docs/models/operations/bandwidth.md + - docs/models/operations/bandwidths.md - docs/models/operations/butlertask.md - docs/models/operations/butlertasks.md - - docs/models/operations/cancelserveractivitiesrequest.md - - docs/models/operations/cancelserveractivitiesresponse.md - - docs/models/operations/chapter.md - - docs/models/operations/checkforupdatesrequest.md - - docs/models/operations/checkforupdatesresponse.md - - docs/models/operations/clearplaylistcontentsrequest.md - - docs/models/operations/clearplaylistcontentsresponse.md - - docs/models/operations/collection.md - - docs/models/operations/connections.md - - docs/models/operations/context.md + - docs/models/operations/cancelactivityglobals.md + - docs/models/operations/cancelactivityrequest.md + - docs/models/operations/cancelactivityresponse.md + - docs/models/operations/cancelgrabglobals.md + - docs/models/operations/cancelgrabrequest.md + - docs/models/operations/cancelgrabresponse.md + - docs/models/operations/cancelrefreshglobals.md + - docs/models/operations/cancelrefreshrequest.md + - docs/models/operations/cancelrefreshresponse.md + - docs/models/operations/channelmapping.md + - docs/models/operations/channelmappingbykey.md + - docs/models/operations/checkupdatesglobals.md + - docs/models/operations/checkupdatesrequest.md + - docs/models/operations/checkupdatesresponse.md + - docs/models/operations/chromasubsampling.md + - docs/models/operations/cleanbundlesresponse.md + - docs/models/operations/clearplaylistitemsglobals.md + - docs/models/operations/clearplaylistitemsrequest.md + - docs/models/operations/clearplaylistitemsresponse.md + - docs/models/operations/clearplayqueueglobals.md + - docs/models/operations/clearplayqueuerequest.md + - docs/models/operations/clearplayqueueresponse.md + - docs/models/operations/computechannelmapchannelmapping.md + - docs/models/operations/computechannelmapglobals.md + - docs/models/operations/computechannelmapmediacontainer.md + - docs/models/operations/computechannelmaprequest.md + - docs/models/operations/computechannelmapresponse.md + - docs/models/operations/computechannelmapresponsebody.md + - docs/models/operations/connection.md + - docs/models/operations/connectwebsocketglobals.md + - docs/models/operations/connectwebsocketrequest.md + - docs/models/operations/connectwebsocketresponse.md - docs/models/operations/country.md - - docs/models/operations/createplaylistmediacontainer.md - - docs/models/operations/createplaylistmetadata.md - - docs/models/operations/createplaylistqueryparamtype.md + - docs/models/operations/createcollectionglobals.md + - docs/models/operations/createcollectionrequest.md + - docs/models/operations/createcollectionresponse.md + - docs/models/operations/createcustomhubglobals.md + - docs/models/operations/createcustomhubrequest.md + - docs/models/operations/createcustomhubresponse.md + - docs/models/operations/createdownloadqueuemediacontainer.md + - docs/models/operations/createdownloadqueueresponse.md + - docs/models/operations/createdownloadqueueresponsebody.md + - docs/models/operations/createdvrglobals.md + - docs/models/operations/createdvrrequest.md + - docs/models/operations/createdvrresponse.md + - docs/models/operations/createmarkerglobals.md + - docs/models/operations/createmarkermediacontainer.md + - docs/models/operations/createmarkerrequest.md + - docs/models/operations/createmarkerresponse.md + - docs/models/operations/createmarkerresponsebody.md + - docs/models/operations/createmarkertype.md + - docs/models/operations/createplaylistglobals.md - docs/models/operations/createplaylistrequest.md - docs/models/operations/createplaylistresponse.md - - docs/models/operations/createplaylistresponsebody.md - - docs/models/operations/defaultdirection.md - - docs/models/operations/defaultsubtitleaccessibility.md - - docs/models/operations/defaultsubtitleforced.md - - docs/models/operations/deletelibraryrequest.md - - docs/models/operations/deletelibraryresponse.md + - docs/models/operations/createplayqueueglobals.md + - docs/models/operations/createplayqueuemediacontainer.md + - docs/models/operations/createplayqueuerequest.md + - docs/models/operations/createplayqueueresponse.md + - docs/models/operations/createplayqueueresponsebody.md + - docs/models/operations/createsubscriptionglobals.md + - docs/models/operations/createsubscriptionmediacontainer.md + - docs/models/operations/createsubscriptionqueryparamprefs.md + - docs/models/operations/createsubscriptionrequest.md + - docs/models/operations/createsubscriptionresponse.md + - docs/models/operations/createsubscriptionresponsebody.md + - docs/models/operations/decisionresult.md + - docs/models/operations/deletecachesresponse.md + - docs/models/operations/deletecollectionglobals.md + - docs/models/operations/deletecollectionitemglobals.md + - docs/models/operations/deletecollectionitemrequest.md + - docs/models/operations/deletecollectionitemresponse.md + - docs/models/operations/deletecollectionrequest.md + - docs/models/operations/deletecollectionresponse.md + - docs/models/operations/deletecustomhubglobals.md + - docs/models/operations/deletecustomhubrequest.md + - docs/models/operations/deletecustomhubresponse.md + - docs/models/operations/deletedvrglobals.md + - docs/models/operations/deletedvrrequest.md + - docs/models/operations/deletedvrresponse.md + - docs/models/operations/deletehistoryglobals.md + - docs/models/operations/deletehistoryrequest.md + - docs/models/operations/deletehistoryresponse.md + - docs/models/operations/deleteindexesglobals.md + - docs/models/operations/deleteindexesrequest.md + - docs/models/operations/deleteindexesresponse.md + - docs/models/operations/deleteintrosglobals.md + - docs/models/operations/deleteintrosrequest.md + - docs/models/operations/deleteintrosresponse.md + - docs/models/operations/deletelibrarysectionglobals.md + - docs/models/operations/deletelibrarysectionrequest.md + - docs/models/operations/deletelibrarysectionresponse.md + - docs/models/operations/deletelineupdvr.md + - docs/models/operations/deletelineupdvrsmediacontainer.md + - docs/models/operations/deletelineupglobals.md + - docs/models/operations/deletelineupmediacontainer.md + - docs/models/operations/deletelineuprequest.md + - docs/models/operations/deletelineupresponse.md + - docs/models/operations/deletelineupresponsebody.md + - docs/models/operations/deletemarkerglobals.md + - docs/models/operations/deletemarkerrequest.md + - docs/models/operations/deletemarkerresponse.md + - docs/models/operations/deletemediaitemglobals.md + - docs/models/operations/deletemediaitemrequest.md + - docs/models/operations/deletemediaitemresponse.md + - docs/models/operations/deletemediaproviderglobals.md + - docs/models/operations/deletemediaproviderrequest.md + - docs/models/operations/deletemediaproviderresponse.md + - docs/models/operations/deletemetadataitemglobals.md + - docs/models/operations/deletemetadataitemrequest.md + - docs/models/operations/deletemetadataitemresponse.md + - docs/models/operations/deleteplaylistglobals.md + - docs/models/operations/deleteplaylistitemglobals.md + - docs/models/operations/deleteplaylistitemrequest.md + - docs/models/operations/deleteplaylistitemresponse.md - docs/models/operations/deleteplaylistrequest.md - docs/models/operations/deleteplaylistresponse.md + - docs/models/operations/deleteplayqueueitemglobals.md + - docs/models/operations/deleteplayqueueitemrequest.md + - docs/models/operations/deleteplayqueueitemresponse.md + - docs/models/operations/deletestreamglobals.md + - docs/models/operations/deletestreamrequest.md + - docs/models/operations/deletestreamresponse.md + - docs/models/operations/deletesubscriptionglobals.md + - docs/models/operations/deletesubscriptionrequest.md + - docs/models/operations/deletesubscriptionresponse.md + - docs/models/operations/detectadsglobals.md + - docs/models/operations/detectadsrequest.md + - docs/models/operations/detectadsresponse.md + - docs/models/operations/detectcreditsglobals.md + - docs/models/operations/detectcreditsrequest.md + - docs/models/operations/detectcreditsresponse.md + - docs/models/operations/detectintrosglobals.md + - docs/models/operations/detectintrosrequest.md + - docs/models/operations/detectintrosresponse.md + - docs/models/operations/detectvoiceactivityglobals.md + - docs/models/operations/detectvoiceactivityrequest.md + - docs/models/operations/detectvoiceactivityresponse.md - docs/models/operations/device.md - - docs/models/operations/director.md + - docs/models/operations/devicechannel.md - docs/models/operations/directory.md - - docs/models/operations/download.md + - docs/models/operations/discoverdevicesresponse.md + - docs/models/operations/downloadqueue.md + - docs/models/operations/downloadqueueitem.md + - docs/models/operations/dvr.md + - docs/models/operations/editmarkerglobals.md + - docs/models/operations/editmarkerrequest.md + - docs/models/operations/editmarkerresponse.md + - docs/models/operations/editmetadataitemglobals.md + - docs/models/operations/editmetadataitemrequest.md + - docs/models/operations/editmetadataitemresponse.md + - docs/models/operations/editsectionglobals.md + - docs/models/operations/editsectionqueryparamprefs.md + - docs/models/operations/editsectionrequest.md + - docs/models/operations/editsectionresponse.md + - docs/models/operations/editsubscriptionpreferencesglobals.md + - docs/models/operations/editsubscriptionpreferencesqueryparamprefs.md + - docs/models/operations/editsubscriptionpreferencesrequest.md + - docs/models/operations/editsubscriptionpreferencesresponse.md + - docs/models/operations/element.md + - docs/models/operations/emptytrashglobals.md + - docs/models/operations/emptytrashrequest.md + - docs/models/operations/emptytrashresponse.md + - docs/models/operations/enablepapertrailglobals.md + - docs/models/operations/enablepapertrailrequest.md - docs/models/operations/enablepapertrailresponse.md - - docs/models/operations/extras.md + - docs/models/operations/extension.md - docs/models/operations/feature.md - - docs/models/operations/field.md - - docs/models/operations/fieldtype.md - - docs/models/operations/filter.md - - docs/models/operations/flattenseasons.md - - docs/models/operations/force.md - - docs/models/operations/friend.md - - docs/models/operations/genre.md - - docs/models/operations/geodata.md - - docs/models/operations/getactorslibrarydirectory.md - - docs/models/operations/getactorslibrarymediacontainer.md - - docs/models/operations/getactorslibraryqueryparamtype.md - - docs/models/operations/getactorslibraryrequest.md - - docs/models/operations/getactorslibraryresponse.md - - docs/models/operations/getactorslibraryresponsebody.md - - docs/models/operations/getalllibrariesdirectory.md - - docs/models/operations/getalllibrarieslocation.md - - docs/models/operations/getalllibrariesmediacontainer.md - - docs/models/operations/getalllibrariesresponse.md - - docs/models/operations/getalllibrariesresponsebody.md - - docs/models/operations/getalllibrariestype.md - - docs/models/operations/getavailableclientsmediacontainer.md - - docs/models/operations/getavailableclientsresponse.md - - docs/models/operations/getavailableclientsresponsebody.md - - docs/models/operations/getbandwidthstatisticsaccount.md - - docs/models/operations/getbandwidthstatisticsdevice.md - - docs/models/operations/getbandwidthstatisticsmediacontainer.md - - docs/models/operations/getbandwidthstatisticsrequest.md - - docs/models/operations/getbandwidthstatisticsresponse.md - - docs/models/operations/getbandwidthstatisticsresponsebody.md - - docs/models/operations/getbannerimagerequest.md - - docs/models/operations/getbannerimageresponse.md - - docs/models/operations/getbutlertasksresponse.md - - docs/models/operations/getbutlertasksresponsebody.md - - docs/models/operations/getcompanionsdataresponse.md - - docs/models/operations/getcountrieslibrarydirectory.md - - docs/models/operations/getcountrieslibrarymediacontainer.md - - docs/models/operations/getcountrieslibraryqueryparamtype.md - - docs/models/operations/getcountrieslibraryrequest.md - - docs/models/operations/getcountrieslibraryresponse.md - - docs/models/operations/getcountrieslibraryresponsebody.md - - docs/models/operations/getdevicesmediacontainer.md - - docs/models/operations/getdevicesresponse.md - - docs/models/operations/getdevicesresponsebody.md - - docs/models/operations/getfilehashrequest.md - - docs/models/operations/getfilehashresponse.md - - docs/models/operations/getgenreslibrarydirectory.md - - docs/models/operations/getgenreslibrarymediacontainer.md - - docs/models/operations/getgenreslibraryqueryparamtype.md - - docs/models/operations/getgenreslibraryrequest.md - - docs/models/operations/getgenreslibraryresponse.md - - docs/models/operations/getgenreslibraryresponsebody.md - - docs/models/operations/getgeodatageodata.md - - docs/models/operations/getgeodataresponse.md - - docs/models/operations/getglobalhubsmediacontainer.md - - docs/models/operations/getglobalhubsmetadata.md - - docs/models/operations/getglobalhubsrequest.md - - docs/models/operations/getglobalhubsresponse.md - - docs/models/operations/getglobalhubsresponsebody.md - - docs/models/operations/gethomedataresponse.md - - docs/models/operations/gethomedataresponsebody.md - - docs/models/operations/getlibrarydetailsdirectory.md - - docs/models/operations/getlibrarydetailsfield.md - - docs/models/operations/getlibrarydetailsfieldtype.md - - docs/models/operations/getlibrarydetailsfilter.md + - docs/models/operations/flavor.md + - docs/models/operations/format.md + - docs/models/operations/generatethumbsglobals.md + - docs/models/operations/generatethumbsrequest.md + - docs/models/operations/generatethumbsresponse.md + - docs/models/operations/getalbumsglobals.md + - docs/models/operations/getalbumsrequest.md + - docs/models/operations/getalbumsresponse.md + - docs/models/operations/getallhubsglobals.md + - docs/models/operations/getallhubsmediacontainer.md + - docs/models/operations/getallhubsrequest.md + - docs/models/operations/getallhubsresponse.md + - docs/models/operations/getallhubsresponsebody.md + - docs/models/operations/getallitemleavesglobals.md + - docs/models/operations/getallitemleavesrequest.md + - docs/models/operations/getallitemleavesresponse.md + - docs/models/operations/getalllanguagesmediacontainer.md + - docs/models/operations/getalllanguagesresponse.md + - docs/models/operations/getalllanguagesresponsebody.md + - docs/models/operations/getallleavesglobals.md + - docs/models/operations/getallleavesrequest.md + - docs/models/operations/getallleavesresponse.md + - docs/models/operations/getallpreferencesresponse.md + - docs/models/operations/getallsubscriptionsglobals.md + - docs/models/operations/getallsubscriptionsrequest.md + - docs/models/operations/getallsubscriptionsresponse.md + - docs/models/operations/getartsglobals.md + - docs/models/operations/getartsrequest.md + - docs/models/operations/getartsresponse.md + - docs/models/operations/getaugmentationstatusglobals.md + - docs/models/operations/getaugmentationstatusrequest.md + - docs/models/operations/getaugmentationstatusresponse.md + - docs/models/operations/getavailablegrabbersglobals.md + - docs/models/operations/getavailablegrabbersmediacontainer.md + - docs/models/operations/getavailablegrabbersrequest.md + - docs/models/operations/getavailablegrabbersresponse.md + - docs/models/operations/getavailablegrabbersresponsebody.md + - docs/models/operations/getavailablesortsglobals.md + - docs/models/operations/getavailablesortsmediacontainer.md + - docs/models/operations/getavailablesortsrequest.md + - docs/models/operations/getavailablesortsresponse.md + - docs/models/operations/getavailablesortsresponsebody.md + - docs/models/operations/getbackgroundtasksmediacontainer.md + - docs/models/operations/getbackgroundtasksresponse.md + - docs/models/operations/getbackgroundtasksresponsebody.md + - docs/models/operations/getbackgroundtaskstype.md + - docs/models/operations/getcategoriesglobals.md + - docs/models/operations/getcategoriesrequest.md + - docs/models/operations/getcategoriesresponse.md + - docs/models/operations/getchannelsglobals.md + - docs/models/operations/getchannelsmediacontainer.md + - docs/models/operations/getchannelsrequest.md + - docs/models/operations/getchannelsresponse.md + - docs/models/operations/getchannelsresponsebody.md + - docs/models/operations/getchapterimageglobals.md + - docs/models/operations/getchapterimagerequest.md + - docs/models/operations/getchapterimageresponse.md + - docs/models/operations/getclusterglobals.md + - docs/models/operations/getclusterrequest.md + - docs/models/operations/getclusterresponse.md + - docs/models/operations/getcollectionimageglobals.md + - docs/models/operations/getcollectionimagerequest.md + - docs/models/operations/getcollectionimageresponse.md + - docs/models/operations/getcollectionitemsglobals.md + - docs/models/operations/getcollectionitemsrequest.md + - docs/models/operations/getcollectionitemsresponse.md + - docs/models/operations/getcollectionsglobals.md + - docs/models/operations/getcollectionsrequest.md + - docs/models/operations/getcollectionsresponse.md + - docs/models/operations/getcolorsglobals.md + - docs/models/operations/getcolorsmediacontainer.md + - docs/models/operations/getcolorsrequest.md + - docs/models/operations/getcolorsresponse.md + - docs/models/operations/getcolorsresponsebody.md + - docs/models/operations/getcommonglobals.md + - docs/models/operations/getcommonrequest.md + - docs/models/operations/getcommonresponse.md + - docs/models/operations/getcontinuewatchingglobals.md + - docs/models/operations/getcontinuewatchingmediacontainer.md + - docs/models/operations/getcontinuewatchingrequest.md + - docs/models/operations/getcontinuewatchingresponse.md + - docs/models/operations/getcontinuewatchingresponsebody.md + - docs/models/operations/getcountrieslineupsglobals.md + - docs/models/operations/getcountrieslineupsrequest.md + - docs/models/operations/getcountrieslineupsresponse.md + - docs/models/operations/getcountriesmediacontainer.md + - docs/models/operations/getcountriesresponse.md + - docs/models/operations/getcountriesresponsebody.md + - docs/models/operations/getcountryregionscountry.md + - docs/models/operations/getcountryregionsglobals.md + - docs/models/operations/getcountryregionsmediacontainer.md + - docs/models/operations/getcountryregionsrequest.md + - docs/models/operations/getcountryregionsresponse.md + - docs/models/operations/getcountryregionsresponsebody.md + - docs/models/operations/getdevicedetailsglobals.md + - docs/models/operations/getdevicedetailsrequest.md + - docs/models/operations/getdevicedetailsresponse.md + - docs/models/operations/getdeviceschannelsglobals.md + - docs/models/operations/getdeviceschannelsmediacontainer.md + - docs/models/operations/getdeviceschannelsrequest.md + - docs/models/operations/getdeviceschannelsresponse.md + - docs/models/operations/getdeviceschannelsresponsebody.md + - docs/models/operations/getdownloadqueuedownloadqueue.md + - docs/models/operations/getdownloadqueueglobals.md + - docs/models/operations/getdownloadqueueitemsdecisionresult.md + - docs/models/operations/getdownloadqueueitemsdownloadqueueitem.md + - docs/models/operations/getdownloadqueueitemsglobals.md + - docs/models/operations/getdownloadqueueitemsmediacontainer.md + - docs/models/operations/getdownloadqueueitemsrequest.md + - docs/models/operations/getdownloadqueueitemsresponse.md + - docs/models/operations/getdownloadqueueitemsresponsebody.md + - docs/models/operations/getdownloadqueueitemsstatus.md + - docs/models/operations/getdownloadqueueitemstranscode.md + - docs/models/operations/getdownloadqueuemediacontainer.md + - docs/models/operations/getdownloadqueuemediaglobals.md + - docs/models/operations/getdownloadqueuemediarequest.md + - docs/models/operations/getdownloadqueuemediaresponse.md + - docs/models/operations/getdownloadqueuerequest.md + - docs/models/operations/getdownloadqueueresponse.md + - docs/models/operations/getdownloadqueueresponsebody.md + - docs/models/operations/getdownloadqueuestatus.md + - docs/models/operations/getdvrdvr.md + - docs/models/operations/getdvrdvrsmediacontainer.md + - docs/models/operations/getdvrglobals.md + - docs/models/operations/getdvrmediacontainer.md + - docs/models/operations/getdvrrequest.md + - docs/models/operations/getdvrresponse.md + - docs/models/operations/getdvrresponsebody.md + - docs/models/operations/getextrasglobals.md + - docs/models/operations/getextrasrequest.md + - docs/models/operations/getextrasresponse.md + - docs/models/operations/getfileglobals.md + - docs/models/operations/getfilerequest.md + - docs/models/operations/getfileresponse.md + - docs/models/operations/getfirstcharactersdirectory.md + - docs/models/operations/getfirstcharactersglobals.md + - docs/models/operations/getfirstcharactersmediacontainer.md + - docs/models/operations/getfirstcharactersrequest.md + - docs/models/operations/getfirstcharactersresponse.md + - docs/models/operations/getfirstcharactersresponsebody.md + - docs/models/operations/getfoldersdirectory.md + - docs/models/operations/getfoldersglobals.md + - docs/models/operations/getfoldersmediacontainer.md + - docs/models/operations/getfoldersrequest.md + - docs/models/operations/getfoldersresponse.md + - docs/models/operations/getfoldersresponsebody.md + - docs/models/operations/gethistoryitemglobals.md + - docs/models/operations/gethistoryitemrequest.md + - docs/models/operations/gethistoryitemresponse.md + - docs/models/operations/gethubitemsglobals.md + - docs/models/operations/gethubitemsrequest.md + - docs/models/operations/gethubitemsresponse.md + - docs/models/operations/gethubitemsresponsebody.md + - docs/models/operations/getidentitymediacontainer.md + - docs/models/operations/getidentityresponse.md + - docs/models/operations/getidentityresponsebody.md + - docs/models/operations/getimagefrombifglobals.md + - docs/models/operations/getimagefrombifrequest.md + - docs/models/operations/getimagefrombifresponse.md + - docs/models/operations/getimageglobals.md + - docs/models/operations/getimagerequest.md + - docs/models/operations/getimageresponse.md + - docs/models/operations/getitemartworkglobals.md + - docs/models/operations/getitemartworkpathparamelement.md + - docs/models/operations/getitemartworkrequest.md + - docs/models/operations/getitemartworkresponse.md + - docs/models/operations/getitemdecisionglobals.md + - docs/models/operations/getitemdecisionrequest.md + - docs/models/operations/getitemdecisionresponse.md + - docs/models/operations/getitemtreeglobals.md + - docs/models/operations/getitemtreerequest.md + - docs/models/operations/getitemtreeresponse.md + - docs/models/operations/getlibrarydetailsglobals.md - docs/models/operations/getlibrarydetailsmediacontainer.md - - docs/models/operations/getlibrarydetailsoperator.md - docs/models/operations/getlibrarydetailsrequest.md - docs/models/operations/getlibrarydetailsresponse.md - docs/models/operations/getlibrarydetailsresponsebody.md - - docs/models/operations/getlibrarydetailssort.md - - docs/models/operations/getlibrarydetailstype.md - - docs/models/operations/getlibraryhubscountry.md - - docs/models/operations/getlibraryhubsdirector.md - - docs/models/operations/getlibraryhubsgenre.md - - docs/models/operations/getlibraryhubshub.md - - docs/models/operations/getlibraryhubsmedia.md - - docs/models/operations/getlibraryhubsmediacontainer.md - - docs/models/operations/getlibraryhubsmetadata.md - - docs/models/operations/getlibraryhubspart.md - - docs/models/operations/getlibraryhubsrequest.md - - docs/models/operations/getlibraryhubsresponse.md - - docs/models/operations/getlibraryhubsresponsebody.md - - docs/models/operations/getlibraryhubsrole.md - - docs/models/operations/getlibraryhubswriter.md - - docs/models/operations/getlibraryitemsactivedirection.md - - docs/models/operations/getlibraryitemscollection.md - - docs/models/operations/getlibraryitemscountry.md - - docs/models/operations/getlibraryitemsdefaultdirection.md - - docs/models/operations/getlibraryitemsdirector.md - - docs/models/operations/getlibraryitemsfield.md - - docs/models/operations/getlibraryitemsfieldtype.md - - docs/models/operations/getlibraryitemsfilter.md - - docs/models/operations/getlibraryitemsgenre.md - - docs/models/operations/getlibraryitemsguids.md - - docs/models/operations/getlibraryitemshasthumbnail.md - - docs/models/operations/getlibraryitemsimage.md - - docs/models/operations/getlibraryitemslibraryoptimizedforstreaming.md - - docs/models/operations/getlibraryitemslibraryresponsetype.md - - docs/models/operations/getlibraryitemslibrarytype.md - - docs/models/operations/getlibraryitemslocation.md - - docs/models/operations/getlibraryitemsmedia.md - - docs/models/operations/getlibraryitemsmediacontainer.md - - docs/models/operations/getlibraryitemsmeta.md - - docs/models/operations/getlibraryitemsmetadata.md - - docs/models/operations/getlibraryitemsoperator.md - - docs/models/operations/getlibraryitemsoptimizedforstreaming.md - - docs/models/operations/getlibraryitemsoptimizedforstreaming1.md - - docs/models/operations/getlibraryitemspart.md - - docs/models/operations/getlibraryitemsproducer.md - - docs/models/operations/getlibraryitemsqueryparamincludemeta.md - - docs/models/operations/getlibraryitemsqueryparamtype.md + - docs/models/operations/getlibraryitemsglobals.md - docs/models/operations/getlibraryitemsrequest.md - docs/models/operations/getlibraryitemsresponse.md - - docs/models/operations/getlibraryitemsresponsebody.md - - docs/models/operations/getlibraryitemsrole.md - - docs/models/operations/getlibraryitemssimilar.md - - docs/models/operations/getlibraryitemssort.md - - docs/models/operations/getlibraryitemstype.md - - docs/models/operations/getlibraryitemsultrablurcolors.md - - docs/models/operations/getlibraryitemswriter.md - - docs/models/operations/getlibrarysectionsallactivedirection.md - - docs/models/operations/getlibrarysectionsallcollection.md - - docs/models/operations/getlibrarysectionsallcountry.md - - docs/models/operations/getlibrarysectionsalldefaultdirection.md - - docs/models/operations/getlibrarysectionsalldirector.md - - docs/models/operations/getlibrarysectionsallfield.md - - docs/models/operations/getlibrarysectionsallfieldtype.md - - docs/models/operations/getlibrarysectionsallfilter.md - - docs/models/operations/getlibrarysectionsallgenre.md - - docs/models/operations/getlibrarysectionsallguids.md - - docs/models/operations/getlibrarysectionsallhasthumbnail.md - - docs/models/operations/getlibrarysectionsallimage.md - - docs/models/operations/getlibrarysectionsalllibraryoptimizedforstreaming.md - - docs/models/operations/getlibrarysectionsalllibraryresponsetype.md - - docs/models/operations/getlibrarysectionsalllibrarytype.md - - docs/models/operations/getlibrarysectionsallmedia.md - - docs/models/operations/getlibrarysectionsallmediacontainer.md - - docs/models/operations/getlibrarysectionsallmeta.md - - docs/models/operations/getlibrarysectionsallmetadata.md - - docs/models/operations/getlibrarysectionsalloperator.md - - docs/models/operations/getlibrarysectionsalloptimizedforstreaming.md - - docs/models/operations/getlibrarysectionsalloptimizedforstreaming1.md - - docs/models/operations/getlibrarysectionsalloptimizedforstreaminglibrary1.md - - docs/models/operations/getlibrarysectionsallpart.md - - docs/models/operations/getlibrarysectionsallqueryparamincludemeta.md - - docs/models/operations/getlibrarysectionsallqueryparamtype.md - - docs/models/operations/getlibrarysectionsallrequest.md - - docs/models/operations/getlibrarysectionsallresponse.md - - docs/models/operations/getlibrarysectionsallresponsebody.md - - docs/models/operations/getlibrarysectionsallrole.md - - docs/models/operations/getlibrarysectionsallsort.md - - docs/models/operations/getlibrarysectionsallstream.md - - docs/models/operations/getlibrarysectionsalltype.md - - docs/models/operations/getlibrarysectionsallultrablurcolors.md - - docs/models/operations/getlibrarysectionsallwriter.md - - docs/models/operations/getmediaartsmediacontainer.md - - docs/models/operations/getmediaartsmetadata.md - - docs/models/operations/getmediaartsrequest.md - - docs/models/operations/getmediaartsresponse.md - - docs/models/operations/getmediaartsresponsebody.md - - docs/models/operations/getmediametadataattributes.md - - docs/models/operations/getmediametadatachapter.md - - docs/models/operations/getmediametadatacountry.md - - docs/models/operations/getmediametadatadirector.md - - docs/models/operations/getmediametadataextras.md - - docs/models/operations/getmediametadatagenre.md - - docs/models/operations/getmediametadataguids.md - - docs/models/operations/getmediametadatahasthumbnail.md - - docs/models/operations/getmediametadataimage.md - - docs/models/operations/getmediametadatalibraryoptimizedforstreaming.md - - docs/models/operations/getmediametadatalibrarytype.md - - docs/models/operations/getmediametadatalocation.md - - docs/models/operations/getmediametadatamarker.md - - docs/models/operations/getmediametadatamedia.md - - docs/models/operations/getmediametadatamediacontainer.md - - docs/models/operations/getmediametadatametadata.md - - docs/models/operations/getmediametadataoptimizedforstreaming.md - - docs/models/operations/getmediametadataoptimizedforstreaming1.md - - docs/models/operations/getmediametadataoptimizedforstreaminglibrary1.md - - docs/models/operations/getmediametadatapart.md - - docs/models/operations/getmediametadataproducer.md - - docs/models/operations/getmediametadataratings.md - - docs/models/operations/getmediametadatarequest.md - - docs/models/operations/getmediametadataresponse.md - - docs/models/operations/getmediametadataresponsebody.md - - docs/models/operations/getmediametadatarole.md - - docs/models/operations/getmediametadatasimilar.md - - docs/models/operations/getmediametadatastream.md - - docs/models/operations/getmediametadatatype.md - - docs/models/operations/getmediametadataultrablurcolors.md - - docs/models/operations/getmediametadatawriter.md - - docs/models/operations/getmediapostersmediacontainer.md - - docs/models/operations/getmediapostersmetadata.md - - docs/models/operations/getmediapostersrequest.md - - docs/models/operations/getmediapostersresponse.md - - docs/models/operations/getmediapostersresponsebody.md - - docs/models/operations/getmediaprovidersdirectory.md - - docs/models/operations/getmediaprovidersmediacontainer.md - - docs/models/operations/getmediaprovidersrequest.md - - docs/models/operations/getmediaprovidersresponse.md - - docs/models/operations/getmediaprovidersresponsebody.md - - docs/models/operations/getmetadatachildrendirectory.md - - docs/models/operations/getmetadatachildrenmediacontainer.md - - docs/models/operations/getmetadatachildrenmetadata.md - - docs/models/operations/getmetadatachildrenrequest.md - - docs/models/operations/getmetadatachildrenresponse.md - - docs/models/operations/getmetadatachildrenresponsebody.md - - docs/models/operations/getmyplexaccountresponse.md - - docs/models/operations/getmyplexaccountresponsebody.md - - docs/models/operations/getpinauthpincontainer.md - - docs/models/operations/getpinrequest.md - - docs/models/operations/getpinresponse.md - - docs/models/operations/getplaylistcontentscountry.md - - docs/models/operations/getplaylistcontentsdirector.md - - docs/models/operations/getplaylistcontentsgenre.md - - docs/models/operations/getplaylistcontentsmedia.md - - docs/models/operations/getplaylistcontentsmediacontainer.md - - docs/models/operations/getplaylistcontentsmetadata.md - - docs/models/operations/getplaylistcontentspart.md - - docs/models/operations/getplaylistcontentsqueryparamtype.md - - docs/models/operations/getplaylistcontentsrequest.md - - docs/models/operations/getplaylistcontentsresponse.md - - docs/models/operations/getplaylistcontentsresponsebody.md - - docs/models/operations/getplaylistcontentsrole.md - - docs/models/operations/getplaylistcontentswriter.md - - docs/models/operations/getplaylistmediacontainer.md - - docs/models/operations/getplaylistmetadata.md + - docs/models/operations/getlibrarymatchesglobals.md + - docs/models/operations/getlibrarymatchesrequest.md + - docs/models/operations/getlibrarymatchesresponse.md + - docs/models/operations/getlineupchannelsglobals.md + - docs/models/operations/getlineupchannelsmediacontainer.md + - docs/models/operations/getlineupchannelsrequest.md + - docs/models/operations/getlineupchannelsresponse.md + - docs/models/operations/getlineupchannelsresponsebody.md + - docs/models/operations/getlineupglobals.md + - docs/models/operations/getlineuprequest.md + - docs/models/operations/getlineupresponse.md + - docs/models/operations/getlivetvsessionglobals.md + - docs/models/operations/getlivetvsessionrequest.md + - docs/models/operations/getlivetvsessionresponse.md + - docs/models/operations/getmediapartglobals.md + - docs/models/operations/getmediapartrequest.md + - docs/models/operations/getmediapartresponse.md + - docs/models/operations/getmetadatahubsglobals.md + - docs/models/operations/getmetadatahubsrequest.md + - docs/models/operations/getmetadatahubsresponse.md + - docs/models/operations/getmetadataitemglobals.md + - docs/models/operations/getmetadataitemrequest.md + - docs/models/operations/getmetadataitemresponse.md + - docs/models/operations/getnotificationsglobals.md + - docs/models/operations/getnotificationsrequest.md + - docs/models/operations/getnotificationsresponse.md + - docs/models/operations/getpartindexglobals.md + - docs/models/operations/getpartindexrequest.md + - docs/models/operations/getpartindexresponse.md + - docs/models/operations/getpersonglobals.md + - docs/models/operations/getpersonmediacontainer.md + - docs/models/operations/getpersonrequest.md + - docs/models/operations/getpersonresponse.md + - docs/models/operations/getpersonresponsebody.md + - docs/models/operations/getplaylistgeneratordevice.md + - docs/models/operations/getplaylistgeneratorglobals.md + - docs/models/operations/getplaylistgeneratoritem.md + - docs/models/operations/getplaylistgeneratoritemsglobals.md + - docs/models/operations/getplaylistgeneratoritemsmediacontainer.md + - docs/models/operations/getplaylistgeneratoritemsmetadata.md + - docs/models/operations/getplaylistgeneratoritemsrequest.md + - docs/models/operations/getplaylistgeneratoritemsresponse.md + - docs/models/operations/getplaylistgeneratoritemsresponsebody.md + - docs/models/operations/getplaylistgeneratorlocation.md + - docs/models/operations/getplaylistgeneratormediacontainer.md + - docs/models/operations/getplaylistgeneratorpolicy.md + - docs/models/operations/getplaylistgeneratorrequest.md + - docs/models/operations/getplaylistgeneratorresponse.md + - docs/models/operations/getplaylistgeneratorresponsebody.md + - docs/models/operations/getplaylistgeneratorscope.md + - docs/models/operations/getplaylistgeneratorsglobals.md + - docs/models/operations/getplaylistgeneratorsmediacontainer.md + - docs/models/operations/getplaylistgeneratorsrequest.md + - docs/models/operations/getplaylistgeneratorsresponse.md + - docs/models/operations/getplaylistgeneratorsresponsebody.md + - docs/models/operations/getplaylistgeneratorstate.md + - docs/models/operations/getplaylistgeneratorstatus.md + - docs/models/operations/getplaylistgeneratorstype.md + - docs/models/operations/getplaylistgeneratorsubtitles.md + - docs/models/operations/getplaylistgeneratortype.md + - docs/models/operations/getplaylistglobals.md + - docs/models/operations/getplaylistitemsglobals.md + - docs/models/operations/getplaylistitemsrequest.md + - docs/models/operations/getplaylistitemsresponse.md - docs/models/operations/getplaylistrequest.md - docs/models/operations/getplaylistresponse.md - - docs/models/operations/getplaylistresponsebody.md - - docs/models/operations/getplaylistsmediacontainer.md - - docs/models/operations/getplaylistsmetadata.md - - docs/models/operations/getplaylistsrequest.md - - docs/models/operations/getplaylistsresponse.md - - docs/models/operations/getplaylistsresponsebody.md - - docs/models/operations/getrecentlyaddedactivedirection.md - - docs/models/operations/getrecentlyaddeddefaultdirection.md - - docs/models/operations/getrecentlyaddedfield.md - - docs/models/operations/getrecentlyaddedfieldtype.md - - docs/models/operations/getrecentlyaddedfilter.md - - docs/models/operations/getrecentlyaddedhubsresponsetype.md - - docs/models/operations/getrecentlyaddedhubstype.md - - docs/models/operations/getrecentlyaddedimage.md - - docs/models/operations/getrecentlyaddedlibrarycountry.md - - docs/models/operations/getrecentlyaddedlibrarydirector.md - - docs/models/operations/getrecentlyaddedlibraryfilter.md - - docs/models/operations/getrecentlyaddedlibrarygenre.md - - docs/models/operations/getrecentlyaddedlibrarymedia.md - - docs/models/operations/getrecentlyaddedlibrarymediacontainer.md - - docs/models/operations/getrecentlyaddedlibrarymetadata.md - - docs/models/operations/getrecentlyaddedlibrarypart.md - - docs/models/operations/getrecentlyaddedlibraryrequest.md - - docs/models/operations/getrecentlyaddedlibraryresponse.md - - docs/models/operations/getrecentlyaddedlibraryresponsebody.md - - docs/models/operations/getrecentlyaddedlibraryrole.md - - docs/models/operations/getrecentlyaddedlibrarytype.md - - docs/models/operations/getrecentlyaddedlibrarywriter.md - - docs/models/operations/getrecentlyaddedmediacontainer.md - - docs/models/operations/getrecentlyaddedmetadata.md - - docs/models/operations/getrecentlyaddedoperator.md - - docs/models/operations/getrecentlyaddedoptimizedforstreaming.md - - docs/models/operations/getrecentlyaddedoptimizedforstreaming1.md - - docs/models/operations/getrecentlyaddedrequest.md - - docs/models/operations/getrecentlyaddedresponse.md - - docs/models/operations/getrecentlyaddedresponsebody.md - - docs/models/operations/getrecentlyaddedsort.md - - docs/models/operations/getrecentlyaddedtype.md - - docs/models/operations/getrefreshlibrarymetadatarequest.md - - docs/models/operations/getrefreshlibrarymetadataresponse.md - - docs/models/operations/getresizedphotorequest.md - - docs/models/operations/getresizedphotoresponse.md - - docs/models/operations/getresourcesstatisticsmediacontainer.md - - docs/models/operations/getresourcesstatisticsrequest.md - - docs/models/operations/getresourcesstatisticsresponse.md - - docs/models/operations/getresourcesstatisticsresponsebody.md - - docs/models/operations/getsearchalllibrariescountry.md - - docs/models/operations/getsearchalllibrariesdirector.md - - docs/models/operations/getsearchalllibrariesdirectory.md - - docs/models/operations/getsearchalllibrariesflattenseasons.md - - docs/models/operations/getsearchalllibrariesgenre.md - - docs/models/operations/getsearchalllibrariesguids.md - - docs/models/operations/getsearchalllibrarieshasthumbnail.md - - docs/models/operations/getsearchalllibrariesimage.md - - docs/models/operations/getsearchalllibrarieslibraryoptimizedforstreaming.md - - docs/models/operations/getsearchalllibrarieslibrarytype.md - - docs/models/operations/getsearchalllibrarieslocation.md - - docs/models/operations/getsearchalllibrariesmedia.md - - docs/models/operations/getsearchalllibrariesmediacontainer.md - - docs/models/operations/getsearchalllibrariesmetadata.md - - docs/models/operations/getsearchalllibrariesoptimizedforstreaming.md - - docs/models/operations/getsearchalllibrariesoptimizedforstreaming1.md - - docs/models/operations/getsearchalllibrariesoptimizedforstreaminglibrary1.md - - docs/models/operations/getsearchalllibrariespart.md - - docs/models/operations/getsearchalllibrariesqueryparamincludecollections.md - - docs/models/operations/getsearchalllibrariesqueryparamincludeexternalmedia.md - - docs/models/operations/getsearchalllibrariesrequest.md - - docs/models/operations/getsearchalllibrariesresponse.md - - docs/models/operations/getsearchalllibrariesresponsebody.md - - docs/models/operations/getsearchalllibrariesrole.md - - docs/models/operations/getsearchalllibrariesshowordering.md - - docs/models/operations/getsearchalllibrariestype.md - - docs/models/operations/getsearchalllibrariesultrablurcolors.md - - docs/models/operations/getsearchalllibrarieswriter.md - - docs/models/operations/getsearchlibrarymediacontainer.md - - docs/models/operations/getsearchlibrarymetadata.md - - docs/models/operations/getsearchlibraryqueryparamtype.md - - docs/models/operations/getsearchlibraryrequest.md - - docs/models/operations/getsearchlibraryresponse.md - - docs/models/operations/getsearchlibraryresponsebody.md - - docs/models/operations/getsearchresultscountry.md - - docs/models/operations/getsearchresultsdirector.md - - docs/models/operations/getsearchresultsgenre.md - - docs/models/operations/getsearchresultsmedia.md - - docs/models/operations/getsearchresultsmediacontainer.md - - docs/models/operations/getsearchresultsmetadata.md - - docs/models/operations/getsearchresultspart.md - - docs/models/operations/getsearchresultsrequest.md - - docs/models/operations/getsearchresultsresponse.md - - docs/models/operations/getsearchresultsresponsebody.md - - docs/models/operations/getsearchresultsrole.md - - docs/models/operations/getsearchresultswriter.md - - docs/models/operations/getserveractivitiesmediacontainer.md - - docs/models/operations/getserveractivitiesresponse.md - - docs/models/operations/getserveractivitiesresponsebody.md - - docs/models/operations/getservercapabilitiesresponse.md - - docs/models/operations/getservercapabilitiesresponsebody.md - - docs/models/operations/getserveridentitymediacontainer.md - - docs/models/operations/getserveridentityresponse.md - - docs/models/operations/getserveridentityresponsebody.md - - docs/models/operations/getserverlistmediacontainer.md - - docs/models/operations/getserverlistresponse.md - - docs/models/operations/getserverlistresponsebody.md - - docs/models/operations/getserverlistserver.md - - docs/models/operations/getserverpreferencesmediacontainer.md - - docs/models/operations/getserverpreferencesresponse.md - - docs/models/operations/getserverpreferencesresponsebody.md - - docs/models/operations/getserverresourcesrequest.md - - docs/models/operations/getserverresourcesresponse.md - - docs/models/operations/getsessionhistorymediacontainer.md - - docs/models/operations/getsessionhistorymetadata.md - - docs/models/operations/getsessionhistoryrequest.md - - docs/models/operations/getsessionhistoryresponse.md - - docs/models/operations/getsessionhistoryresponsebody.md - - docs/models/operations/getsessionsmedia.md - - docs/models/operations/getsessionsmediacontainer.md - - docs/models/operations/getsessionsmetadata.md - - docs/models/operations/getsessionspart.md + - docs/models/operations/getplayqueueglobals.md + - docs/models/operations/getplayqueuerequest.md + - docs/models/operations/getplayqueueresponse.md + - docs/models/operations/getpostplayhubsglobals.md + - docs/models/operations/getpostplayhubsrequest.md + - docs/models/operations/getpostplayhubsresponse.md + - docs/models/operations/getpreferenceglobals.md + - docs/models/operations/getpreferencerequest.md + - docs/models/operations/getpreferenceresponse.md + - docs/models/operations/getpromotedhubsglobals.md + - docs/models/operations/getpromotedhubsmediacontainer.md + - docs/models/operations/getpromotedhubsrequest.md + - docs/models/operations/getpromotedhubsresponse.md + - docs/models/operations/getpromotedhubsresponsebody.md + - docs/models/operations/getrandomartworkglobals.md + - docs/models/operations/getrandomartworkrequest.md + - docs/models/operations/getrandomartworkresponse.md + - docs/models/operations/getrelatedhubsglobals.md + - docs/models/operations/getrelatedhubsrequest.md + - docs/models/operations/getrelatedhubsresponse.md + - docs/models/operations/getrelateditemsglobals.md + - docs/models/operations/getrelateditemsmediacontainer.md + - docs/models/operations/getrelateditemsrequest.md + - docs/models/operations/getrelateditemsresponse.md + - docs/models/operations/getrelateditemsresponsebody.md + - docs/models/operations/getscheduledrecordingsmediacontainer.md + - docs/models/operations/getscheduledrecordingsresponse.md + - docs/models/operations/getscheduledrecordingsresponsebody.md + - docs/models/operations/getsectionfiltersglobals.md + - docs/models/operations/getsectionfiltersmediacontainer.md + - docs/models/operations/getsectionfiltersrequest.md + - docs/models/operations/getsectionfiltersresponse.md + - docs/models/operations/getsectionfiltersresponsebody.md + - docs/models/operations/getsectionhubsglobals.md + - docs/models/operations/getsectionhubsmediacontainer.md + - docs/models/operations/getsectionhubsrequest.md + - docs/models/operations/getsectionhubsresponse.md + - docs/models/operations/getsectionhubsresponsebody.md + - docs/models/operations/getsectionimageglobals.md + - docs/models/operations/getsectionimagerequest.md + - docs/models/operations/getsectionimageresponse.md + - docs/models/operations/getsectionpreferencesglobals.md + - docs/models/operations/getsectionpreferencesrequest.md + - docs/models/operations/getsectionpreferencesresponse.md + - docs/models/operations/getsectionsmediacontainer.md + - docs/models/operations/getsectionsprefsglobals.md + - docs/models/operations/getsectionsprefsrequest.md + - docs/models/operations/getsectionsprefsresponse.md + - docs/models/operations/getsectionsresponse.md + - docs/models/operations/getsectionsresponsebody.md + - docs/models/operations/getserverinfoglobals.md + - docs/models/operations/getserverinforequest.md + - docs/models/operations/getserverinforesponse.md + - docs/models/operations/getsessionplaylistindexglobals.md + - docs/models/operations/getsessionplaylistindexrequest.md + - docs/models/operations/getsessionplaylistindexresponse.md + - docs/models/operations/getsessionsegmentglobals.md + - docs/models/operations/getsessionsegmentrequest.md + - docs/models/operations/getsessionsegmentresponse.md - docs/models/operations/getsessionsresponse.md - - docs/models/operations/getsessionsresponsebody.md - - docs/models/operations/getsessionsstream.md - - docs/models/operations/getsessionsuser.md + - docs/models/operations/getsonicallysimilarglobals.md + - docs/models/operations/getsonicallysimilarrequest.md + - docs/models/operations/getsonicallysimilarresponse.md + - docs/models/operations/getsonicpathglobals.md + - docs/models/operations/getsonicpathrequest.md + - docs/models/operations/getsonicpathresponse.md + - docs/models/operations/getsourceconnectioninformationglobals.md + - docs/models/operations/getsourceconnectioninformationmediacontainer.md - docs/models/operations/getsourceconnectioninformationrequest.md - docs/models/operations/getsourceconnectioninformationresponse.md - - docs/models/operations/getstatisticsdevice.md - - docs/models/operations/getstatisticsmediacontainer.md - - docs/models/operations/getstatisticsrequest.md - - docs/models/operations/getstatisticsresponse.md - - docs/models/operations/getstatisticsresponsebody.md - - docs/models/operations/getthumbimagerequest.md - - docs/models/operations/getthumbimageresponse.md - - docs/models/operations/gettimelinerequest.md - - docs/models/operations/gettimelineresponse.md - - docs/models/operations/gettokenbypinidauthpincontainer.md - - docs/models/operations/gettokenbypinidgeodata.md - - docs/models/operations/gettokenbypinidrequest.md - - docs/models/operations/gettokenbypinidresponse.md - - docs/models/operations/gettokendetailsauthenticationresponsestatus.md - - docs/models/operations/gettokendetailsauthenticationstatus.md - - docs/models/operations/gettokendetailsresponse.md - - docs/models/operations/gettokendetailsstatus.md - - docs/models/operations/gettokendetailssubscription.md - - docs/models/operations/gettokendetailsuserplexaccount.md - - docs/models/operations/gettopwatchedcontentcountry.md - - docs/models/operations/gettopwatchedcontentgenre.md - - docs/models/operations/gettopwatchedcontentguids.md - - docs/models/operations/gettopwatchedcontentmediacontainer.md - - docs/models/operations/gettopwatchedcontentmetadata.md - - docs/models/operations/gettopwatchedcontentqueryparamincludeguids.md - - docs/models/operations/gettopwatchedcontentqueryparamtype.md - - docs/models/operations/gettopwatchedcontentrequest.md - - docs/models/operations/gettopwatchedcontentresponse.md - - docs/models/operations/gettopwatchedcontentresponsebody.md - - docs/models/operations/gettopwatchedcontentrole.md - - docs/models/operations/gettopwatchedcontentuser.md - - docs/models/operations/gettranscodesessionsmediacontainer.md - - docs/models/operations/gettranscodesessionsresponse.md - - docs/models/operations/gettranscodesessionsresponsebody.md - - docs/models/operations/gettransienttokenqueryparamtype.md + - docs/models/operations/getsourceconnectioninformationresponsebody.md + - docs/models/operations/getstreamglobals.md + - docs/models/operations/getstreamlevelsglobals.md + - docs/models/operations/getstreamlevelslevel.md + - docs/models/operations/getstreamlevelsmediacontainer.md + - docs/models/operations/getstreamlevelsrequest.md + - docs/models/operations/getstreamlevelsresponse.md + - docs/models/operations/getstreamlevelsresponsebody.md + - docs/models/operations/getstreamloudnessglobals.md + - docs/models/operations/getstreamloudnessrequest.md + - docs/models/operations/getstreamloudnessresponse.md + - docs/models/operations/getstreamrequest.md + - docs/models/operations/getstreamresponse.md + - docs/models/operations/getsubscriptionglobals.md + - docs/models/operations/getsubscriptionrequest.md + - docs/models/operations/getsubscriptionresponse.md + - docs/models/operations/gettagsglobals.md + - docs/models/operations/gettagsmediacontainer.md + - docs/models/operations/gettagsrequest.md + - docs/models/operations/gettagsresponse.md + - docs/models/operations/gettagsresponsebody.md + - docs/models/operations/gettasksresponse.md + - docs/models/operations/gettasksresponsebody.md + - docs/models/operations/gettemplateglobals.md + - docs/models/operations/gettemplatemediacontainer.md + - docs/models/operations/gettemplaterequest.md + - docs/models/operations/gettemplateresponse.md + - docs/models/operations/gettemplateresponsebody.md + - docs/models/operations/getthumbglobals.md + - docs/models/operations/getthumbrequest.md + - docs/models/operations/getthumbresponse.md + - docs/models/operations/gettransienttokenglobals.md + - docs/models/operations/gettransienttokenmediacontainer.md - docs/models/operations/gettransienttokenrequest.md - docs/models/operations/gettransienttokenresponse.md - - docs/models/operations/getupdatestatusmediacontainer.md - - docs/models/operations/getupdatestatusresponse.md - - docs/models/operations/getupdatestatusresponsebody.md - - docs/models/operations/getuserfriendsresponse.md - - docs/models/operations/getusersmediacontainer.md - - docs/models/operations/getusersrequest.md - - docs/models/operations/getusersresponse.md - - docs/models/operations/getusersresponsebody.md - - docs/models/operations/getusersserver.md - - docs/models/operations/getwatchlistrequest.md - - docs/models/operations/getwatchlistresponse.md - - docs/models/operations/getwatchlistresponsebody.md - - docs/models/operations/guids.md - - docs/models/operations/hasthumbnail.md - - docs/models/operations/hidden.md - - docs/models/operations/home.md + - docs/models/operations/gettransienttokenresponsebody.md + - docs/models/operations/getupdatesstatusmediacontainer.md + - docs/models/operations/getupdatesstatusresponse.md + - docs/models/operations/getupdatesstatusresponsebody.md + - docs/models/operations/getupdatesstatusstate.md + - docs/models/operations/hints.md + - docs/models/operations/homevisibility.md - docs/models/operations/hub.md - - docs/models/operations/image.md - - docs/models/operations/includeadvanced.md - - docs/models/operations/includecollections.md - - docs/models/operations/includedetails.md - - docs/models/operations/includeexternalmedia.md - - docs/models/operations/includeguids.md - - docs/models/operations/includehttps.md - - docs/models/operations/includeipv6.md - - docs/models/operations/includemeta.md - - docs/models/operations/includerelay.md - - docs/models/operations/internalpaymentmethod.md + - docs/models/operations/index.md + - docs/models/operations/ingesttransientitemglobals.md + - docs/models/operations/ingesttransientitemrequest.md + - docs/models/operations/ingesttransientitemresponse.md + - docs/models/operations/item.md + - docs/models/operations/language.md - docs/models/operations/level.md - - docs/models/operations/libtype.md + - docs/models/operations/lineup.md + - docs/models/operations/lineuptype.md + - docs/models/operations/listactivitiesmediacontainer.md + - docs/models/operations/listactivitiesresponse.md + - docs/models/operations/listactivitiesresponsebody.md + - docs/models/operations/listcontentglobals.md + - docs/models/operations/listcontentrequest.md + - docs/models/operations/listcontentresponse.md + - docs/models/operations/listdevicesresponse.md + - docs/models/operations/listdownloadqueueitemsglobals.md + - docs/models/operations/listdownloadqueueitemsmediacontainer.md + - docs/models/operations/listdownloadqueueitemsrequest.md + - docs/models/operations/listdownloadqueueitemsresponse.md + - docs/models/operations/listdownloadqueueitemsresponsebody.md + - docs/models/operations/listdownloadqueueitemsstatus.md + - docs/models/operations/listdvrsdvrsmediacontainer.md + - docs/models/operations/listdvrsmediacontainer.md + - docs/models/operations/listdvrsresponse.md + - docs/models/operations/listdvrsresponsebody.md + - docs/models/operations/listhubsglobals.md + - docs/models/operations/listhubsmediacontainer.md + - docs/models/operations/listhubsrequest.md + - docs/models/operations/listhubsresponse.md + - docs/models/operations/listhubsresponsebody.md + - docs/models/operations/listlineupsglobals.md + - docs/models/operations/listlineupsrequest.md + - docs/models/operations/listlineupsresponse.md + - docs/models/operations/listmatchesglobals.md + - docs/models/operations/listmatchesrequest.md + - docs/models/operations/listmatchesresponse.md + - docs/models/operations/listmomentsglobals.md + - docs/models/operations/listmomentsrequest.md + - docs/models/operations/listmomentsresponse.md + - docs/models/operations/listpersonmediaglobals.md + - docs/models/operations/listpersonmediarequest.md + - docs/models/operations/listpersonmediaresponse.md + - docs/models/operations/listplaybackhistoryglobals.md + - docs/models/operations/listplaybackhistorymediacontainer.md + - docs/models/operations/listplaybackhistorymetadata.md + - docs/models/operations/listplaybackhistoryrequest.md + - docs/models/operations/listplaybackhistoryresponse.md + - docs/models/operations/listplaybackhistoryresponsebody.md + - docs/models/operations/listplaylistsglobals.md + - docs/models/operations/listplaylistsrequest.md + - docs/models/operations/listplaylistsresponse.md + - docs/models/operations/listprovidersmediacontainer.md + - docs/models/operations/listprovidersresponse.md + - docs/models/operations/listprovidersresponsebody.md + - docs/models/operations/listsessionsmediacontainer.md + - docs/models/operations/listsessionsresponse.md + - docs/models/operations/listsessionsresponsebody.md + - docs/models/operations/listsimilarglobals.md + - docs/models/operations/listsimilarrequest.md + - docs/models/operations/listsimilarresponse.md + - docs/models/operations/listsonicallysimilarglobals.md + - docs/models/operations/listsonicallysimilarrequest.md + - docs/models/operations/listsonicallysimilarresponse.md + - docs/models/operations/listtopusersglobals.md + - docs/models/operations/listtopusersmediacontainer.md + - docs/models/operations/listtopusersrequest.md + - docs/models/operations/listtopusersresponse.md + - docs/models/operations/listtopusersresponsebody.md - docs/models/operations/location.md - - docs/models/operations/loglinerequest.md - - docs/models/operations/loglineresponse.md - - docs/models/operations/logmultilineresponse.md - - docs/models/operations/mailingliststatus.md - - docs/models/operations/marker.md + - docs/models/operations/makedecisionglobals.md + - docs/models/operations/makedecisionrequest.md + - docs/models/operations/makedecisionresponse.md + - docs/models/operations/markplayedglobals.md - docs/models/operations/markplayedrequest.md - docs/models/operations/markplayedresponse.md - - docs/models/operations/markunplayedrequest.md - - docs/models/operations/markunplayedresponse.md - - docs/models/operations/media.md + - docs/models/operations/matchitemglobals.md + - docs/models/operations/matchitemrequest.md + - docs/models/operations/matchitemresponse.md - docs/models/operations/mediacontainer.md - - docs/models/operations/mediaprovider.md - - docs/models/operations/mediareviewsvisibility.md - - docs/models/operations/meta.md + - docs/models/operations/mediagrabber.md + - docs/models/operations/mediasettings.md + - docs/models/operations/mediasubscription.md + - docs/models/operations/mergeitemsglobals.md + - docs/models/operations/mergeitemsrequest.md + - docs/models/operations/mergeitemsresponse.md - docs/models/operations/metadata.md - - docs/models/operations/minsize.md - - docs/models/operations/myplex.md - - docs/models/operations/one.md - - docs/models/operations/onlytransient.md - - docs/models/operations/operator.md - - docs/models/operations/optimizedforstreaming.md - - docs/models/operations/optimizedforstreaming1.md + - docs/models/operations/modifydeviceglobals.md + - docs/models/operations/modifydevicemediacontainer.md + - docs/models/operations/modifydevicerequest.md + - docs/models/operations/modifydeviceresponse.md + - docs/models/operations/modifydeviceresponsebody.md + - docs/models/operations/modifyplaylistgeneratorglobals.md + - docs/models/operations/modifyplaylistgeneratorqueryparamlocation.md + - docs/models/operations/modifyplaylistgeneratorrequest.md + - docs/models/operations/modifyplaylistgeneratorresponse.md + - docs/models/operations/movecollectionitemglobals.md + - docs/models/operations/movecollectionitemrequest.md + - docs/models/operations/movecollectionitemresponse.md + - docs/models/operations/movehubglobals.md + - docs/models/operations/movehubrequest.md + - docs/models/operations/movehubresponse.md + - docs/models/operations/moveplaylistitemglobals.md + - docs/models/operations/moveplaylistitemrequest.md + - docs/models/operations/moveplaylistitemresponse.md + - docs/models/operations/moveplayqueueitemglobals.md + - docs/models/operations/moveplayqueueitemrequest.md + - docs/models/operations/moveplayqueueitemresponse.md + - docs/models/operations/optimizedatabaseglobals.md + - docs/models/operations/optimizedatabaserequest.md + - docs/models/operations/optimizedatabaseresponse.md - docs/models/operations/option.md - - docs/models/operations/owned.md - - docs/models/operations/part.md - - docs/models/operations/pastsubscription.md - - docs/models/operations/pathparamtaskname.md - - docs/models/operations/pending.md - - docs/models/operations/performsearchrequest.md - - docs/models/operations/performsearchresponse.md - - docs/models/operations/performvoicesearchrequest.md - - docs/models/operations/performvoicesearchresponse.md - - docs/models/operations/pivot.md - - docs/models/operations/player.md + - docs/models/operations/params.md + - docs/models/operations/pathparamelement.md + - docs/models/operations/pathparamindex.md + - docs/models/operations/pathparamtask.md - docs/models/operations/playlisttype.md - - docs/models/operations/plexdevice.md - - docs/models/operations/postmediaartsrequest.md - - docs/models/operations/postmediaartsresponse.md - - docs/models/operations/postmediaposterrequest.md - - docs/models/operations/postmediaposterresponse.md - - docs/models/operations/postuserssignindataauthenticationresponsestatus.md - - docs/models/operations/postuserssignindataauthenticationstatus.md - - docs/models/operations/postuserssignindataauthenticationsubscription.md - - docs/models/operations/postuserssignindataautoselectsubtitle.md - - docs/models/operations/postuserssignindatadefaultsubtitleaccessibility.md - - docs/models/operations/postuserssignindatadefaultsubtitleforced.md - - docs/models/operations/postuserssignindatamailingliststatus.md - - docs/models/operations/postuserssignindatamediareviewsvisibility.md - - docs/models/operations/postuserssignindatarequest.md - - docs/models/operations/postuserssignindatarequestbody.md - - docs/models/operations/postuserssignindataresponse.md - - docs/models/operations/postuserssignindataservices.md - - docs/models/operations/postuserssignindatastate.md - - docs/models/operations/postuserssignindatastatus.md - - docs/models/operations/postuserssignindatasubscription.md - - docs/models/operations/postuserssignindatauserplexaccount.md - - docs/models/operations/postuserssignindatauserprofile.md - - docs/models/operations/postuserssignindatawatchedindicator.md - - docs/models/operations/producer.md - - docs/models/operations/protected.md + - docs/models/operations/playqueuegenerator.md + - docs/models/operations/policy.md + - docs/models/operations/prefs.md + - docs/models/operations/processingstate.md + - docs/models/operations/processingstatecontext.md + - docs/models/operations/processsubscriptionsresponse.md - docs/models/operations/protocol.md - - docs/models/operations/provider.md - - docs/models/operations/queryparamfilter.md - - docs/models/operations/queryparamforce.md - - docs/models/operations/queryparamincludecollections.md - - docs/models/operations/queryparamincludeexternalmedia.md - - docs/models/operations/queryparamincludeguids.md - - docs/models/operations/queryparamincludemeta.md - - docs/models/operations/queryparamonlytransient.md - - docs/models/operations/queryparamsmart.md + - docs/models/operations/queryparamargs.md + - docs/models/operations/queryparamattributes.md + - docs/models/operations/queryparamlocation.md + - docs/models/operations/queryparamprefs.md + - docs/models/operations/queryparamprotocol.md + - docs/models/operations/queryparamscope.md + - docs/models/operations/queryparamsubtitles.md - docs/models/operations/queryparamtype.md - - docs/models/operations/rating.md - - docs/models/operations/ratings.md + - docs/models/operations/recommendationsvisibility.md + - docs/models/operations/refreshitemsmetadataglobals.md + - docs/models/operations/refreshitemsmetadatarequest.md + - docs/models/operations/refreshitemsmetadataresponse.md + - docs/models/operations/refreshplaylistglobals.md + - docs/models/operations/refreshplaylistrequest.md + - docs/models/operations/refreshplaylistresponse.md + - docs/models/operations/refreshprovidersresponse.md + - docs/models/operations/refreshsectionglobals.md + - docs/models/operations/refreshsectionrequest.md + - docs/models/operations/refreshsectionresponse.md + - docs/models/operations/refreshsectionsmetadataglobals.md + - docs/models/operations/refreshsectionsmetadatarequest.md + - docs/models/operations/refreshsectionsmetadataresponse.md - docs/models/operations/release.md - - docs/models/operations/responsebody.md - - docs/models/operations/restricted.md - - docs/models/operations/role.md + - docs/models/operations/reloadguideglobals.md + - docs/models/operations/reloadguiderequest.md + - docs/models/operations/reloadguideresponse.md + - docs/models/operations/removedevicefromdvrdvr.md + - docs/models/operations/removedevicefromdvrdvrsmediacontainer.md + - docs/models/operations/removedevicefromdvrglobals.md + - docs/models/operations/removedevicefromdvrmediacontainer.md + - docs/models/operations/removedevicefromdvrrequest.md + - docs/models/operations/removedevicefromdvrresponse.md + - docs/models/operations/removedevicefromdvrresponsebody.md + - docs/models/operations/removedeviceglobals.md + - docs/models/operations/removedevicemediacontainer.md + - docs/models/operations/removedevicerequest.md + - docs/models/operations/removedeviceresponse.md + - docs/models/operations/removedeviceresponsebody.md + - docs/models/operations/removedownloadqueueitemsglobals.md + - docs/models/operations/removedownloadqueueitemsrequest.md + - docs/models/operations/removedownloadqueueitemsresponse.md + - docs/models/operations/reordersubscriptionglobals.md + - docs/models/operations/reordersubscriptionrequest.md + - docs/models/operations/reordersubscriptionresponse.md + - docs/models/operations/reportglobals.md + - docs/models/operations/reportrequest.md + - docs/models/operations/reportresponse.md + - docs/models/operations/reportresponsebody.md + - docs/models/operations/resetplayqueueglobals.md + - docs/models/operations/resetplayqueuerequest.md + - docs/models/operations/resetplayqueueresponse.md + - docs/models/operations/resetsectiondefaultsglobals.md + - docs/models/operations/resetsectiondefaultsrequest.md + - docs/models/operations/resetsectiondefaultsresponse.md + - docs/models/operations/restartprocessingdownloadqueueitemsglobals.md + - docs/models/operations/restartprocessingdownloadqueueitemsrequest.md + - docs/models/operations/restartprocessingdownloadqueueitemsresponse.md + - docs/models/operations/scanglobals.md + - docs/models/operations/scanrequest.md + - docs/models/operations/scanresponse.md - docs/models/operations/scope.md - - docs/models/operations/searchresult.md - - docs/models/operations/searchtypes.md - - docs/models/operations/server.md - - docs/models/operations/services.md - - docs/models/operations/session.md - - docs/models/operations/setting.md - - docs/models/operations/sharedservers.md - - docs/models/operations/sharedsources.md - - docs/models/operations/showordering.md - - docs/models/operations/similar.md - - docs/models/operations/skip.md - - docs/models/operations/smart.md - - docs/models/operations/sort.md - - docs/models/operations/startalltasksresponse.md + - docs/models/operations/searchhubsglobals.md + - docs/models/operations/searchhubsmediacontainer.md + - docs/models/operations/searchhubsrequest.md + - docs/models/operations/searchhubsresponse.md + - docs/models/operations/searchhubsresponsebody.md + - docs/models/operations/setchannelmapglobals.md + - docs/models/operations/setchannelmaprequest.md + - docs/models/operations/setchannelmapresponse.md + - docs/models/operations/setdevicepreferencesglobals.md + - docs/models/operations/setdevicepreferencesrequest.md + - docs/models/operations/setdevicepreferencesresponse.md + - docs/models/operations/setdvrpreferencesdvr.md + - docs/models/operations/setdvrpreferencesdvrsmediacontainer.md + - docs/models/operations/setdvrpreferencesglobals.md + - docs/models/operations/setdvrpreferencesmediacontainer.md + - docs/models/operations/setdvrpreferencesrequest.md + - docs/models/operations/setdvrpreferencesresponse.md + - docs/models/operations/setdvrpreferencesresponsebody.md + - docs/models/operations/setitemartworkglobals.md + - docs/models/operations/setitemartworkrequest.md + - docs/models/operations/setitemartworkresponse.md + - docs/models/operations/setitempreferencesglobals.md + - docs/models/operations/setitempreferencesrequest.md + - docs/models/operations/setitempreferencesresponse.md + - docs/models/operations/setpreferencesglobals.md + - docs/models/operations/setpreferencesrequest.md + - docs/models/operations/setpreferencesresponse.md + - docs/models/operations/setratingglobals.md + - docs/models/operations/setratingrequest.md + - docs/models/operations/setratingresponse.md + - docs/models/operations/setsectionpreferencesglobals.md + - docs/models/operations/setsectionpreferencesqueryparamprefs.md + - docs/models/operations/setsectionpreferencesrequest.md + - docs/models/operations/setsectionpreferencesresponse.md + - docs/models/operations/setstreamoffsetglobals.md + - docs/models/operations/setstreamoffsetrequest.md + - docs/models/operations/setstreamoffsetresponse.md + - docs/models/operations/setstreamselectionglobals.md + - docs/models/operations/setstreamselectionrequest.md + - docs/models/operations/setstreamselectionresponse.md + - docs/models/operations/shuffleglobals.md + - docs/models/operations/shufflerequest.md + - docs/models/operations/shuffleresponse.md + - docs/models/operations/splititemglobals.md + - docs/models/operations/splititemrequest.md + - docs/models/operations/splititemresponse.md + - docs/models/operations/startanalysisglobals.md + - docs/models/operations/startanalysisrequest.md + - docs/models/operations/startanalysisresponse.md + - docs/models/operations/startbifgenerationglobals.md + - docs/models/operations/startbifgenerationrequest.md + - docs/models/operations/startbifgenerationresponse.md + - docs/models/operations/starttaskglobals.md - docs/models/operations/starttaskrequest.md - docs/models/operations/starttaskresponse.md - - docs/models/operations/startuniversaltranscoderequest.md - - docs/models/operations/startuniversaltranscoderesponse.md + - docs/models/operations/starttasksresponse.md + - docs/models/operations/starttranscodesessionglobals.md + - docs/models/operations/starttranscodesessionqueryparamlocation.md + - docs/models/operations/starttranscodesessionqueryparamprotocol.md + - docs/models/operations/starttranscodesessionqueryparamsubtitles.md + - docs/models/operations/starttranscodesessionrequest.md + - docs/models/operations/starttranscodesessionresponse.md - docs/models/operations/state.md - - docs/models/operations/statisticsbandwidth.md - - docs/models/operations/statisticsmedia.md - - docs/models/operations/statisticsresources.md - docs/models/operations/status.md - - docs/models/operations/stopalltasksresponse.md + - docs/models/operations/stopallrefreshesresponse.md + - docs/models/operations/stopdvrreloadglobals.md + - docs/models/operations/stopdvrreloadrequest.md + - docs/models/operations/stopdvrreloadresponse.md + - docs/models/operations/stopscanglobals.md + - docs/models/operations/stopscanrequest.md + - docs/models/operations/stopscanresponse.md + - docs/models/operations/stoptaskglobals.md - docs/models/operations/stoptaskrequest.md - docs/models/operations/stoptaskresponse.md - - docs/models/operations/stoptranscodesessionrequest.md - - docs/models/operations/stoptranscodesessionresponse.md - - docs/models/operations/stream.md - - docs/models/operations/subscription.md - - docs/models/operations/tag.md - - docs/models/operations/taskname.md - - docs/models/operations/tonight.md - - docs/models/operations/transcodesession.md - - docs/models/operations/trials.md + - docs/models/operations/stoptasksresponse.md + - docs/models/operations/subscriptiontemplate.md + - docs/models/operations/subtitles.md + - docs/models/operations/task.md + - docs/models/operations/terminatesessionglobals.md + - docs/models/operations/terminatesessionrequest.md + - docs/models/operations/terminatesessionresponse.md + - docs/models/operations/transcode.md + - docs/models/operations/transcodeimageglobals.md + - docs/models/operations/transcodeimagerequest.md + - docs/models/operations/transcodeimageresponse.md + - docs/models/operations/transcodejob.md + - docs/models/operations/transcodesubtitlesglobals.md + - docs/models/operations/transcodesubtitlesrequest.md + - docs/models/operations/transcodesubtitlesresponse.md + - docs/models/operations/triggerfallbackglobals.md + - docs/models/operations/triggerfallbackrequest.md + - docs/models/operations/triggerfallbackresponse.md + - docs/models/operations/tunechannelglobals.md + - docs/models/operations/tunechannelrequest.md + - docs/models/operations/tunechannelresponse.md - docs/models/operations/type.md - docs/models/operations/ultrablurcolors.md + - docs/models/operations/unmatchglobals.md + - docs/models/operations/unmatchrequest.md + - docs/models/operations/unmatchresponse.md + - docs/models/operations/unscrobbleglobals.md + - docs/models/operations/unscrobblerequest.md + - docs/models/operations/unscrobbleresponse.md + - docs/models/operations/unshuffleglobals.md + - docs/models/operations/unshufflerequest.md + - docs/models/operations/unshuffleresponse.md + - docs/models/operations/updatehubvisibilityglobals.md + - docs/models/operations/updatehubvisibilityrequest.md + - docs/models/operations/updatehubvisibilityresponse.md + - docs/models/operations/updateitemartworkglobals.md + - docs/models/operations/updateitemartworkrequest.md + - docs/models/operations/updateitemartworkresponse.md + - docs/models/operations/updateitemsglobals.md + - docs/models/operations/updateitemsrequest.md + - docs/models/operations/updateitemsresponse.md + - docs/models/operations/updateplaylistglobals.md - docs/models/operations/updateplaylistrequest.md - docs/models/operations/updateplaylistresponse.md - - docs/models/operations/updateplayprogressrequest.md - - docs/models/operations/updateplayprogressresponse.md + - docs/models/operations/uploadplaylistglobals.md - docs/models/operations/uploadplaylistrequest.md - docs/models/operations/uploadplaylistresponse.md - - docs/models/operations/upscale.md - - docs/models/operations/user.md - - docs/models/operations/userprofile.md - - docs/models/operations/watchedindicator.md - - docs/models/operations/writer.md - - docs/models/sdkerrors/addplaylistcontentsbadrequest.md - - docs/models/sdkerrors/addplaylistcontentserrors.md - - docs/models/sdkerrors/addplaylistcontentsplaylistserrors.md - - docs/models/sdkerrors/addplaylistcontentsunauthorized.md - - docs/models/sdkerrors/applyupdatesbadrequest.md - - docs/models/sdkerrors/applyupdateserrors.md - - docs/models/sdkerrors/applyupdatesunauthorized.md - - docs/models/sdkerrors/applyupdatesupdatererrors.md - - docs/models/sdkerrors/cancelserveractivitiesactivitieserrors.md - - docs/models/sdkerrors/cancelserveractivitiesbadrequest.md - - docs/models/sdkerrors/cancelserveractivitieserrors.md - - docs/models/sdkerrors/cancelserveractivitiesunauthorized.md - - docs/models/sdkerrors/checkforupdatesbadrequest.md - - docs/models/sdkerrors/checkforupdateserrors.md - - docs/models/sdkerrors/checkforupdatesunauthorized.md - - docs/models/sdkerrors/checkforupdatesupdatererrors.md - - docs/models/sdkerrors/clearplaylistcontentsbadrequest.md - - docs/models/sdkerrors/clearplaylistcontentserrors.md - - docs/models/sdkerrors/clearplaylistcontentsplaylistserrors.md - - docs/models/sdkerrors/clearplaylistcontentsunauthorized.md - - docs/models/sdkerrors/createplaylistbadrequest.md - - docs/models/sdkerrors/createplaylisterrors.md - - docs/models/sdkerrors/createplaylistplaylistserrors.md - - docs/models/sdkerrors/createplaylistunauthorized.md - - docs/models/sdkerrors/deletelibrarybadrequest.md - - docs/models/sdkerrors/deletelibraryerrors.md - - docs/models/sdkerrors/deletelibrarylibraryerrors.md - - docs/models/sdkerrors/deletelibraryunauthorized.md - - docs/models/sdkerrors/deleteplaylistbadrequest.md - - docs/models/sdkerrors/deleteplaylisterrors.md - - docs/models/sdkerrors/deleteplaylistplaylistserrors.md - - docs/models/sdkerrors/deleteplaylistunauthorized.md - - docs/models/sdkerrors/enablepapertrailbadrequest.md - - docs/models/sdkerrors/enablepapertrailerrors.md - - docs/models/sdkerrors/enablepapertraillogerrors.md - - docs/models/sdkerrors/enablepapertrailunauthorized.md - - docs/models/sdkerrors/errors.md - - docs/models/sdkerrors/getactorslibrarybadrequest.md - - docs/models/sdkerrors/getactorslibraryerrors.md - - docs/models/sdkerrors/getactorslibrarylibraryerrors.md - - docs/models/sdkerrors/getactorslibraryunauthorized.md - - docs/models/sdkerrors/getalllibrariesbadrequest.md - - docs/models/sdkerrors/getalllibrarieserrors.md - - docs/models/sdkerrors/getalllibrarieslibraryerrors.md - - docs/models/sdkerrors/getalllibrariesunauthorized.md - - docs/models/sdkerrors/getavailableclientsbadrequest.md - - docs/models/sdkerrors/getavailableclientserrors.md - - docs/models/sdkerrors/getavailableclientsservererrors.md - - docs/models/sdkerrors/getavailableclientsunauthorized.md - - docs/models/sdkerrors/getbandwidthstatisticsbadrequest.md - - docs/models/sdkerrors/getbandwidthstatisticserrors.md - - docs/models/sdkerrors/getbandwidthstatisticsstatisticserrors.md - - docs/models/sdkerrors/getbandwidthstatisticsunauthorized.md - - docs/models/sdkerrors/getbannerimagebadrequest.md - - docs/models/sdkerrors/getbannerimageerrors.md - - docs/models/sdkerrors/getbannerimagemediaerrors.md - - docs/models/sdkerrors/getbannerimageunauthorized.md - - docs/models/sdkerrors/getbutlertasksbadrequest.md - - docs/models/sdkerrors/getbutlertasksbutlererrors.md - - docs/models/sdkerrors/getbutlertaskserrors.md - - docs/models/sdkerrors/getbutlertasksunauthorized.md - - docs/models/sdkerrors/getcompanionsdatabadrequest.md - - docs/models/sdkerrors/getcompanionsdataerrors.md - - docs/models/sdkerrors/getcompanionsdataplexerrors.md - - docs/models/sdkerrors/getcompanionsdataunauthorized.md - - docs/models/sdkerrors/getcountrieslibrarybadrequest.md - - docs/models/sdkerrors/getcountrieslibraryerrors.md - - docs/models/sdkerrors/getcountrieslibrarylibraryerrors.md - - docs/models/sdkerrors/getcountrieslibraryunauthorized.md - - docs/models/sdkerrors/getdevicesbadrequest.md - - docs/models/sdkerrors/getdeviceserrors.md - - docs/models/sdkerrors/getdevicesservererrors.md - - docs/models/sdkerrors/getdevicesunauthorized.md - - docs/models/sdkerrors/getfilehashbadrequest.md - - docs/models/sdkerrors/getfilehasherrors.md - - docs/models/sdkerrors/getfilehashlibraryerrors.md - - docs/models/sdkerrors/getfilehashunauthorized.md - - docs/models/sdkerrors/getgenreslibrarybadrequest.md - - docs/models/sdkerrors/getgenreslibraryerrors.md - - docs/models/sdkerrors/getgenreslibrarylibraryerrors.md - - docs/models/sdkerrors/getgenreslibraryunauthorized.md - - docs/models/sdkerrors/getgeodatabadrequest.md - - docs/models/sdkerrors/getgeodataerrors.md - - docs/models/sdkerrors/getgeodataplexerrors.md - - docs/models/sdkerrors/getgeodataunauthorized.md - - docs/models/sdkerrors/getglobalhubsbadrequest.md - - docs/models/sdkerrors/getglobalhubserrors.md - - docs/models/sdkerrors/getglobalhubshubserrors.md - - docs/models/sdkerrors/getglobalhubsunauthorized.md - - docs/models/sdkerrors/gethomedatabadrequest.md - - docs/models/sdkerrors/gethomedataerrors.md - - docs/models/sdkerrors/gethomedataplexerrors.md - - docs/models/sdkerrors/gethomedataunauthorized.md - - docs/models/sdkerrors/getlibrarydetailsbadrequest.md - - docs/models/sdkerrors/getlibrarydetailserrors.md - - docs/models/sdkerrors/getlibrarydetailslibraryerrors.md - - docs/models/sdkerrors/getlibrarydetailsunauthorized.md - - docs/models/sdkerrors/getlibraryhubsbadrequest.md - - docs/models/sdkerrors/getlibraryhubserrors.md - - docs/models/sdkerrors/getlibraryhubshubserrors.md - - docs/models/sdkerrors/getlibraryhubsunauthorized.md - - docs/models/sdkerrors/getlibraryitemsbadrequest.md - - docs/models/sdkerrors/getlibraryitemserrors.md - - docs/models/sdkerrors/getlibraryitemslibraryerrors.md - - docs/models/sdkerrors/getlibraryitemsunauthorized.md - - docs/models/sdkerrors/getlibrarysectionsallbadrequest.md - - docs/models/sdkerrors/getlibrarysectionsallerrors.md - - docs/models/sdkerrors/getlibrarysectionsalllibraryerrors.md - - docs/models/sdkerrors/getlibrarysectionsallunauthorized.md - - docs/models/sdkerrors/getmediametadatabadrequest.md - - docs/models/sdkerrors/getmediametadataerrors.md - - docs/models/sdkerrors/getmediametadatalibraryerrors.md - - docs/models/sdkerrors/getmediametadataunauthorized.md - - docs/models/sdkerrors/getmediaprovidersbadrequest.md - - docs/models/sdkerrors/getmediaproviderserrors.md - - docs/models/sdkerrors/getmediaprovidersservererrors.md - - docs/models/sdkerrors/getmediaprovidersunauthorized.md - - docs/models/sdkerrors/getmetadatachildrenbadrequest.md - - docs/models/sdkerrors/getmetadatachildrenerrors.md - - docs/models/sdkerrors/getmetadatachildrenlibraryerrors.md - - docs/models/sdkerrors/getmetadatachildrenunauthorized.md - - docs/models/sdkerrors/getmyplexaccountbadrequest.md - - docs/models/sdkerrors/getmyplexaccounterrors.md - - docs/models/sdkerrors/getmyplexaccountservererrors.md - - docs/models/sdkerrors/getmyplexaccountunauthorized.md - - docs/models/sdkerrors/getpinbadrequest.md - - docs/models/sdkerrors/getpinerrors.md - - docs/models/sdkerrors/getplaylistbadrequest.md - - docs/models/sdkerrors/getplaylistcontentsbadrequest.md - - docs/models/sdkerrors/getplaylistcontentserrors.md - - docs/models/sdkerrors/getplaylistcontentsplaylistserrors.md - - docs/models/sdkerrors/getplaylistcontentsunauthorized.md - - docs/models/sdkerrors/getplaylisterrors.md - - docs/models/sdkerrors/getplaylistplaylistserrors.md - - docs/models/sdkerrors/getplaylistsbadrequest.md - - docs/models/sdkerrors/getplaylistserrors.md - - docs/models/sdkerrors/getplaylistsplaylistserrors.md - - docs/models/sdkerrors/getplaylistsunauthorized.md - - docs/models/sdkerrors/getplaylistunauthorized.md - - docs/models/sdkerrors/getrecentlyaddedlibrarybadrequest.md - - docs/models/sdkerrors/getrecentlyaddedlibraryerrors.md - - docs/models/sdkerrors/getrecentlyaddedlibrarylibraryerrors.md - - docs/models/sdkerrors/getrecentlyaddedlibraryunauthorized.md - - docs/models/sdkerrors/getrefreshlibrarymetadatabadrequest.md - - docs/models/sdkerrors/getrefreshlibrarymetadataerrors.md - - docs/models/sdkerrors/getrefreshlibrarymetadatalibraryerrors.md - - docs/models/sdkerrors/getrefreshlibrarymetadataunauthorized.md - - docs/models/sdkerrors/getresizedphotobadrequest.md - - docs/models/sdkerrors/getresizedphotoerrors.md - - docs/models/sdkerrors/getresizedphotoservererrors.md - - docs/models/sdkerrors/getresizedphotounauthorized.md - - docs/models/sdkerrors/getresourcesstatisticsbadrequest.md - - docs/models/sdkerrors/getresourcesstatisticserrors.md - - docs/models/sdkerrors/getresourcesstatisticsstatisticserrors.md - - docs/models/sdkerrors/getresourcesstatisticsunauthorized.md - - docs/models/sdkerrors/getsearchalllibrariesbadrequest.md - - docs/models/sdkerrors/getsearchalllibrarieserrors.md - - docs/models/sdkerrors/getsearchalllibrarieslibraryerrors.md - - docs/models/sdkerrors/getsearchalllibrariesunauthorized.md - - docs/models/sdkerrors/getsearchlibrarybadrequest.md - - docs/models/sdkerrors/getsearchlibraryerrors.md - - docs/models/sdkerrors/getsearchlibrarylibraryerrors.md - - docs/models/sdkerrors/getsearchlibraryunauthorized.md - - docs/models/sdkerrors/getsearchresultsbadrequest.md - - docs/models/sdkerrors/getsearchresultserrors.md - - docs/models/sdkerrors/getsearchresultssearcherrors.md - - docs/models/sdkerrors/getsearchresultsunauthorized.md - - docs/models/sdkerrors/getserveractivitiesactivitieserrors.md - - docs/models/sdkerrors/getserveractivitiesbadrequest.md - - docs/models/sdkerrors/getserveractivitieserrors.md - - docs/models/sdkerrors/getserveractivitiesunauthorized.md - - docs/models/sdkerrors/getservercapabilitiesbadrequest.md - - docs/models/sdkerrors/getservercapabilitieserrors.md - - docs/models/sdkerrors/getservercapabilitiesunauthorized.md - - docs/models/sdkerrors/getserveridentityrequesttimeout.md - - docs/models/sdkerrors/getserverlistbadrequest.md - - docs/models/sdkerrors/getserverlisterrors.md - - docs/models/sdkerrors/getserverlistservererrors.md - - docs/models/sdkerrors/getserverlistunauthorized.md - - docs/models/sdkerrors/getserverpreferencesbadrequest.md - - docs/models/sdkerrors/getserverpreferenceserrors.md - - docs/models/sdkerrors/getserverpreferencesservererrors.md - - docs/models/sdkerrors/getserverpreferencesunauthorized.md - - docs/models/sdkerrors/getserverresourcesbadrequest.md - - docs/models/sdkerrors/getserverresourceserrors.md - - docs/models/sdkerrors/getserverresourcesplexerrors.md - - docs/models/sdkerrors/getserverresourcesunauthorized.md - - docs/models/sdkerrors/getsessionhistorybadrequest.md - - docs/models/sdkerrors/getsessionhistoryerrors.md - - docs/models/sdkerrors/getsessionhistorysessionserrors.md - - docs/models/sdkerrors/getsessionhistoryunauthorized.md - - docs/models/sdkerrors/getsessionsbadrequest.md - - docs/models/sdkerrors/getsessionserrors.md - - docs/models/sdkerrors/getsessionssessionserrors.md - - docs/models/sdkerrors/getsessionsunauthorized.md - - docs/models/sdkerrors/getsourceconnectioninformationauthenticationerrors.md - - docs/models/sdkerrors/getsourceconnectioninformationbadrequest.md - - docs/models/sdkerrors/getsourceconnectioninformationerrors.md - - docs/models/sdkerrors/getsourceconnectioninformationunauthorized.md - - docs/models/sdkerrors/getstatisticsbadrequest.md - - docs/models/sdkerrors/getstatisticserrors.md - - docs/models/sdkerrors/getstatisticsstatisticserrors.md - - docs/models/sdkerrors/getstatisticsunauthorized.md - - docs/models/sdkerrors/getthumbimagebadrequest.md - - docs/models/sdkerrors/getthumbimageerrors.md - - docs/models/sdkerrors/getthumbimagemediaerrors.md - - docs/models/sdkerrors/getthumbimageunauthorized.md - - docs/models/sdkerrors/gettimelinebadrequest.md - - docs/models/sdkerrors/gettimelineerrors.md - - docs/models/sdkerrors/gettimelineunauthorized.md - - docs/models/sdkerrors/gettimelinevideoerrors.md - - docs/models/sdkerrors/gettokenbypinidbadrequest.md - - docs/models/sdkerrors/gettokenbypiniderrors.md - - docs/models/sdkerrors/gettokenbypinidplexerrors.md - - docs/models/sdkerrors/gettokenbypinidresponsebody.md - - docs/models/sdkerrors/gettokendetailsauthenticationerrors.md - - docs/models/sdkerrors/gettokendetailsbadrequest.md - - docs/models/sdkerrors/gettokendetailserrors.md - - docs/models/sdkerrors/gettokendetailsunauthorized.md - - docs/models/sdkerrors/gettopwatchedcontentbadrequest.md - - docs/models/sdkerrors/gettopwatchedcontenterrors.md - - docs/models/sdkerrors/gettopwatchedcontentlibraryerrors.md - - docs/models/sdkerrors/gettopwatchedcontentunauthorized.md - - docs/models/sdkerrors/gettranscodesessionsbadrequest.md - - docs/models/sdkerrors/gettranscodesessionserrors.md - - docs/models/sdkerrors/gettranscodesessionssessionserrors.md - - docs/models/sdkerrors/gettranscodesessionsunauthorized.md - - docs/models/sdkerrors/gettransienttokenauthenticationerrors.md - - docs/models/sdkerrors/gettransienttokenbadrequest.md - - docs/models/sdkerrors/gettransienttokenerrors.md - - docs/models/sdkerrors/gettransienttokenunauthorized.md - - docs/models/sdkerrors/getupdatestatusbadrequest.md - - docs/models/sdkerrors/getupdatestatuserrors.md - - docs/models/sdkerrors/getupdatestatusunauthorized.md - - docs/models/sdkerrors/getupdatestatusupdatererrors.md - - docs/models/sdkerrors/getuserfriendsbadrequest.md - - docs/models/sdkerrors/getuserfriendserrors.md - - docs/models/sdkerrors/getuserfriendsplexerrors.md - - docs/models/sdkerrors/getuserfriendsunauthorized.md - - docs/models/sdkerrors/getusersbadrequest.md - - docs/models/sdkerrors/getuserserrors.md - - docs/models/sdkerrors/getusersunauthorized.md - - docs/models/sdkerrors/getusersuserserrors.md - - docs/models/sdkerrors/getwatchlistbadrequest.md - - docs/models/sdkerrors/getwatchlisterrors.md - - docs/models/sdkerrors/getwatchlistunauthorized.md - - docs/models/sdkerrors/getwatchlistwatchlisterrors.md - - docs/models/sdkerrors/loglinebadrequest.md - - docs/models/sdkerrors/loglineerrors.md - - docs/models/sdkerrors/loglinelogerrors.md - - docs/models/sdkerrors/loglineunauthorized.md - - docs/models/sdkerrors/logmultilinebadrequest.md - - docs/models/sdkerrors/logmultilineerrors.md - - docs/models/sdkerrors/logmultilinelogerrors.md - - docs/models/sdkerrors/logmultilineunauthorized.md - - docs/models/sdkerrors/markplayedbadrequest.md - - docs/models/sdkerrors/markplayederrors.md - - docs/models/sdkerrors/markplayedmediaerrors.md - - docs/models/sdkerrors/markplayedunauthorized.md - - docs/models/sdkerrors/markunplayedbadrequest.md - - docs/models/sdkerrors/markunplayederrors.md - - docs/models/sdkerrors/markunplayedmediaerrors.md - - docs/models/sdkerrors/markunplayedunauthorized.md - - docs/models/sdkerrors/performsearchbadrequest.md - - docs/models/sdkerrors/performsearcherrors.md - - docs/models/sdkerrors/performsearchsearcherrors.md - - docs/models/sdkerrors/performsearchunauthorized.md - - docs/models/sdkerrors/performvoicesearchbadrequest.md - - docs/models/sdkerrors/performvoicesearcherrors.md - - docs/models/sdkerrors/performvoicesearchsearcherrors.md - - docs/models/sdkerrors/performvoicesearchunauthorized.md - - docs/models/sdkerrors/postuserssignindataauthenticationerrors.md - - docs/models/sdkerrors/postuserssignindatabadrequest.md - - docs/models/sdkerrors/postuserssignindataerrors.md - - docs/models/sdkerrors/postuserssignindataunauthorized.md - - docs/models/sdkerrors/startalltasksbadrequest.md - - docs/models/sdkerrors/startalltasksbutlererrors.md - - docs/models/sdkerrors/startalltaskserrors.md - - docs/models/sdkerrors/startalltasksunauthorized.md - - docs/models/sdkerrors/starttaskbadrequest.md - - docs/models/sdkerrors/starttaskbutlererrors.md - - docs/models/sdkerrors/starttaskerrors.md - - docs/models/sdkerrors/starttaskunauthorized.md - - docs/models/sdkerrors/startuniversaltranscodebadrequest.md - - docs/models/sdkerrors/startuniversaltranscodeerrors.md - - docs/models/sdkerrors/startuniversaltranscodeunauthorized.md - - docs/models/sdkerrors/startuniversaltranscodevideoerrors.md - - docs/models/sdkerrors/stopalltasksbadrequest.md - - docs/models/sdkerrors/stopalltasksbutlererrors.md - - docs/models/sdkerrors/stopalltaskserrors.md - - docs/models/sdkerrors/stopalltasksunauthorized.md - - docs/models/sdkerrors/stoptaskbadrequest.md - - docs/models/sdkerrors/stoptaskbutlererrors.md - - docs/models/sdkerrors/stoptaskerrors.md - - docs/models/sdkerrors/stoptaskunauthorized.md - - docs/models/sdkerrors/stoptranscodesessionbadrequest.md - - docs/models/sdkerrors/stoptranscodesessionerrors.md - - docs/models/sdkerrors/stoptranscodesessionsessionserrors.md - - docs/models/sdkerrors/stoptranscodesessionunauthorized.md - - docs/models/sdkerrors/updateplaylistbadrequest.md - - docs/models/sdkerrors/updateplaylisterrors.md - - docs/models/sdkerrors/updateplaylistplaylistserrors.md - - docs/models/sdkerrors/updateplaylistunauthorized.md - - docs/models/sdkerrors/updateplayprogressbadrequest.md - - docs/models/sdkerrors/updateplayprogresserrors.md - - docs/models/sdkerrors/updateplayprogressmediaerrors.md - - docs/models/sdkerrors/updateplayprogressunauthorized.md - - docs/models/sdkerrors/uploadplaylistbadrequest.md - - docs/models/sdkerrors/uploadplaylisterrors.md - - docs/models/sdkerrors/uploadplaylistplaylistserrors.md - - docs/models/sdkerrors/uploadplaylistunauthorized.md + - docs/models/operations/voicesearchhubsglobals.md + - docs/models/operations/voicesearchhubsmediacontainer.md + - docs/models/operations/voicesearchhubsrequest.md + - docs/models/operations/voicesearchhubsresponse.md + - docs/models/operations/voicesearchhubsresponsebody.md + - docs/models/operations/writelogresponse.md + - docs/models/operations/writemessageglobals.md + - docs/models/operations/writemessagerequest.md + - docs/models/operations/writemessageresponse.md - docs/sdks/activities/README.md - - docs/sdks/authentication/README.md - docs/sdks/butler/README.md + - docs/sdks/collections/README.md + - docs/sdks/content/README.md + - docs/sdks/devices/README.md + - docs/sdks/downloadqueue/README.md + - docs/sdks/dvrs/README.md + - docs/sdks/epg/README.md + - docs/sdks/events/README.md + - docs/sdks/general/README.md - docs/sdks/hubs/README.md - docs/sdks/library/README.md + - docs/sdks/librarycollections/README.md + - docs/sdks/libraryplaylists/README.md + - docs/sdks/livetv/README.md - docs/sdks/log/README.md - - docs/sdks/media/README.md - - docs/sdks/playlists/README.md - - docs/sdks/plex/README.md - - docs/sdks/plexapi/README.md + - docs/sdks/playlist/README.md + - docs/sdks/playqueue/README.md + - docs/sdks/preferences/README.md + - docs/sdks/provider/README.md + - docs/sdks/rate/README.md - docs/sdks/search/README.md - - docs/sdks/server/README.md - - docs/sdks/sessions/README.md - - docs/sdks/statistics/README.md + - docs/sdks/status/README.md + - docs/sdks/subscriptions/README.md + - docs/sdks/timeline/README.md + - docs/sdks/transcoder/README.md + - docs/sdks/ultrablur/README.md - docs/sdks/updater/README.md - - docs/sdks/users/README.md - - docs/sdks/video/README.md - - docs/sdks/watchlist/README.md - - docs/types/date.md + - downloadqueue.go + - dvrs.go + - epg.go + - events.go + - general.go - go.mod - hubs.go - internal/config/sdkconfiguration.go + - internal/globals/globals.go - internal/hooks/hooks.go - internal/utils/contenttype.go - internal/utils/env.go @@ -1154,28 +1391,32 @@ generatedFiles: - internal/utils/security.go - internal/utils/utils.go - library.go + - librarycollections.go + - libraryplaylists.go + - livetv.go - log.go - - media.go - models/operations/options.go - models/sdkerrors/sdkerror.go - optionalnullable/optionalnullable.go - optionalnullable/optionalnullable_test.go - - playlists.go - - plex.go + - playlist.go + - playqueue.go - plexapi.go + - preferences.go + - provider.go + - rate.go - retry/config.go - search.go - - server.go - - sessions.go - - statistics.go + - status.go + - subscriptions.go + - timeline.go + - transcoder.go - types/bigint.go - types/date.go - types/datetime.go - types/pointers.go + - ultrablur.go - updater.go - - users.go - - video.go - - watchlist.go examples: getServerCapabilities: speakeasy-default-get-server-capabilities: @@ -1271,6 +1512,19 @@ examples: parameters: query: key: 59398 + identifier: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -1489,6 +1743,19 @@ examples: parameters: path: taskName: "RefreshPeriodicMetadata" + task: "RefreshLocalMedia" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -1499,6 +1766,19 @@ examples: parameters: path: taskName: "CleanOldCacheFiles" + task: "CleanOldBundles" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -2065,9 +2345,21 @@ examples: type: "audio" smart: 1 uri: "https://short-term-disconnection.name/" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "200": - application/json: {"MediaContainer": {"size": 7, "Metadata": [{"ratingKey": "96", "key": "/playlists/96/items", "guid": "com.plexapp.agents.none://a2f92937-1408-40e2-b022-63a8a9377e55", "type": "playlist", "title": "A Great Playlist", "summary": "What a great playlist", "smart": false, "playlistType": "video", "icon": "playlist://image.smart", "viewCount": 1, "lastViewedAt": 1705719589, "leafCount": 1, "addedAt": 1705719589, "updatedAt": 1705724593, "composite": "/playlists/96/composite/1705724593", "duration": 141000}]}} + application/json: {"MediaContainer": {"Metadata": [{"composite": "/playlists/96/composite/1705724593", "duration": 141000, "key": "/playlists/96/items", "leafCount": 1, "playlistType": "video", "smart": false, "title": "A Great Playlist", "type": "playlist", "addedAt": 1705719589, "lastViewedAt": 1705719589, "ratingKey": "96", "summary": "What a great playlist", "updatedAt": 1705724593, "viewCount": 1, "guid": "com.plexapp.agents.none://a2f92937-1408-40e2-b022-63a8a9377e55", "icon": "playlist://image.smart"}]}} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": @@ -2086,9 +2378,22 @@ examples: parameters: path: playlistID: 8419.53 + playlistId: 841953 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "200": - application/json: {"MediaContainer": {"size": 1, "Metadata": [{"content": "library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26push%3D1%26title%3D2%26or%3D1%26title%3DSerenity%26pop%3D1", "ratingKey": "95", "key": "/playlists/95/items", "guid": "com.plexapp.agents.none://87425529-380f-44b8-a689-9a0537e7ec91", "type": "playlist", "title": "Smart Movie Playlist", "summary": "", "smart": true, "playlistType": "video", "composite": "/playlists/95/composite/1705717387", "icon": "playlist://image.smart", "duration": 282000, "leafCount": 2, "addedAt": 1705716493, "updatedAt": 1705717387}]}} + application/json: {"MediaContainer": {"Metadata": [{"composite": "/playlists/95/composite/1705717387", "duration": 282000, "key": "/playlists/95/items", "leafCount": 2, "playlistType": "video", "smart": true, "title": "Smart Movie Playlist", "type": "playlist", "addedAt": 1705716493, "ratingKey": "95", "summary": "", "updatedAt": 1705717387, "content": "library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26push%3D1%26title%3D2%26or%3D1%26title%3DSerenity%26pop%3D1", "guid": "com.plexapp.agents.none://87425529-380f-44b8-a689-9a0537e7ec91", "icon": "playlist://image.smart"}]}} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": @@ -2098,6 +2403,19 @@ examples: parameters: path: playlistID: 3432.93 + playlistId: 343293 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -2108,6 +2426,19 @@ examples: parameters: path: playlistID: 1579.66 + playlistId: 157966 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -2159,6 +2490,18 @@ examples: path: "/home/barkley/playlist.m3u" force: 1 sectionID: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -2170,21 +2513,50 @@ examples: query: type: "delegation" scope: "all" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + "200": + application/json: {} getSourceConnectionInformation: speakeasy-default-get-source-connection-information: parameters: query: source: "server://client-identifier" + refresh: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + "200": + application/json: {} getTokenDetails: speakeasy-default-get-token-details: responses: @@ -2302,7 +2674,7 @@ examples: speakeasy-default-get-sessions: responses: "200": - application/json: {"MediaContainer": {"size": 1, "Metadata": [{"addedAt": 1705543312, "art": "/library/metadata/39904/art/1705310687", "duration": 186240, "grandparentArt": "/library/metadata/39904/art/1705310687", "grandparentGuid": "plex://artist/5d07bbfd403c6402904a6480", "grandparentKey": "/library/metadata/39904", "grandparentRatingKey": "39904", "grandparentThumb": "/library/metadata/39904/thumb/1705310687", "grandparentTitle": "Green Day", "guid": "plex://track/6535834f71f22f36f71a8e8f", "index": 1, "key": "/library/metadata/67085", "librarySectionID": "3", "librarySectionKey": "/library/sections/3", "librarySectionTitle": "Music", "musicAnalysisVersion": "1", "originalTitle": "The American Dream Is Killing Me", "parentGuid": "plex://album/65394d6d472b8ab03ef47f12", "parentIndex": 1, "parentKey": "/library/metadata/67084", "parentRatingKey": "67084", "parentStudio": "Reprise Records", "parentThumb": "/library/metadata/67084/thumb/1705543314", "parentTitle": "Saviors", "parentYear": 2024, "ratingCount": 45885, "ratingKey": "67085", "sessionKey": "203", "thumb": "/library/metadata/67084/thumb/1705543314", "title": "The American Dream Is Killing Me", "titleSort": "American Dream Is Killing Me", "type": "track", "updatedAt": 1705543314, "viewOffset": 1000, "Media": [{"audioChannels": 2, "audioCodec": "flac", "bitrate": 1014, "container": "flac", "duration": 186240, "id": "130355", "selected": true, "Part": [{"container": "flac", "duration": 186240, "file": "/music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac", "hasThumbnail": "1", "id": "130625", "key": "/library/parts/130625/1705543268/file.flac", "size": 23644000, "decision": "directplay", "selected": true, "Stream": [{"albumGain": "-12.94", "albumPeak": "1.000000", "albumRange": "4.751014", "audioChannelLayout": "stereo", "bitDepth": 16, "bitrate": 1014, "channels": 2, "codec": "flac", "displayTitle": "FLAC (Stereo)", "extendedDisplayTitle": "FLAC (Stereo)", "gain": "-12.94", "id": "352487", "index": 0, "loudness": "-5.94", "lra": "1.74", "peak": "1.000000", "samplingRate": 44100, "selected": true, "streamType": 2, "location": "direct"}]}]}], "User": {"id": "1", "thumb": "https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661", "title": "Blindkitty38"}, "Player": {"address": "10.10.10.171", "machineIdentifier": "3tsdzir85m2onc3qyr255aq1", "model": "standalone", "platform": "windows", "platformVersion": "10.0.22621", "product": "Plex for Windows", "profile": "Plex Desktop", "remotePublicAddress": "68.248.140.20", "state": "playing", "title": "DESKTOP-BL80MTD", "version": "1.85.0.4071-21128b56", "local": true, "relayed": false, "secure": true, "userID": 1}, "Session": {"id": "93h7e00ncblxncqw9lkfaoxi", "bandwidth": 1050, "location": "lan"}}]}} + application/json: {"MediaContainer": {"Metadata": [{"title": "The American Dream Is Killing Me", "type": "track", "addedAt": 1705543312, "art": "/library/metadata/39904/art/1705310687", "duration": 186240, "grandparentArt": "/library/metadata/39904/art/1705310687", "grandparentKey": "/library/metadata/39904", "grandparentRatingKey": "39904", "grandparentThumb": "/library/metadata/39904/thumb/1705310687", "grandparentTitle": "Green Day", "index": 1, "key": "/library/metadata/67085", "Media": [{"audioChannels": 2, "audioCodec": "flac", "bitrate": 1014, "container": "flac", "duration": 186240, "id": 130355, "Part": [{"container": "flac", "duration": 186240, "file": "/music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac", "id": 130625, "key": "/library/parts/130625/1705543268/file.flac", "size": 23644000, "Stream": [{"audioChannelLayout": "stereo", "bitDepth": 16, "bitrate": 1014, "codec": "flac", "displayTitle": "FLAC (Stereo)", "id": 352487, "index": 0, "samplingRate": 44100, "selected": true, "streamType": 2, "albumGain": "-12.94", "albumPeak": "1.000000", "albumRange": "4.751014", "channels": 2, "extendedDisplayTitle": "FLAC (Stereo)", "gain": "-12.94", "loudness": "-5.94", "lra": "1.74", "peak": "1.000000", "location": "direct"}], "hasThumbnail": "1", "decision": "directplay", "selected": true}], "selected": true}], "originalTitle": "The American Dream Is Killing Me", "parentIndex": 1, "parentKey": "/library/metadata/67084", "parentRatingKey": "67084", "parentThumb": "/library/metadata/67084/thumb/1705543314", "parentTitle": "Saviors", "ratingCount": 45885, "ratingKey": "67085", "thumb": "/library/metadata/67084/thumb/1705543314", "titleSort": "American Dream Is Killing Me", "updatedAt": 1705543314, "viewOffset": 1000, "grandparentGuid": "plex://artist/5d07bbfd403c6402904a6480", "guid": "plex://track/6535834f71f22f36f71a8e8f", "librarySectionID": "3", "librarySectionKey": "/library/sections/3", "librarySectionTitle": "Music", "musicAnalysisVersion": "1", "parentGuid": "plex://album/65394d6d472b8ab03ef47f12", "parentStudio": "Reprise Records", "parentYear": 2024, "sessionKey": "203", "User": {"id": "1", "thumb": "https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661", "title": "Blindkitty38"}, "Player": {"address": "10.10.10.171", "machineIdentifier": "3tsdzir85m2onc3qyr255aq1", "model": "standalone", "platform": "windows", "platformVersion": "10.0.22621", "product": "Plex for Windows", "profile": "Plex Desktop", "remotePublicAddress": "68.248.140.20", "state": "playing", "title": "DESKTOP-BL80MTD", "version": "1.85.0.4071-21128b56", "local": true, "relayed": false, "secure": true, "userID": 1}, "Session": {"id": "93h7e00ncblxncqw9lkfaoxi", "bandwidth": 1050, "location": "lan"}}]}} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": @@ -2466,6 +2838,18 @@ examples: query: tonight: 1 skip: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" responses: "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} @@ -2518,5 +2902,4223 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + getServerInfo: + speakeasy-default-get-server-info: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getIdentity: + speakeasy-default-get-identity: + responses: + "200": + application/json: {} + getNotifications: + speakeasy-default-get-notifications: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/octet-stream: "x-file: example.file" + connectWebSocket: + speakeasy-default-connect-web-socket: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/octet-stream: "x-file: example.file" + getAllPreferences: + speakeasy-default-get-all-preferences: + responses: + "200": + application/json: {} + setPreferences: + speakeasy-default-set-preferences: + parameters: + query: + prefs: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getPreference: + speakeasy-default-get-preference: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + setRating: + speakeasy-default-set-rating: + parameters: + query: + identifier: "" + key: "" + rating: 8722.46 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + report: + speakeasy-default-report: + parameters: + query: + key: "/foo" + ratingKey: "xyz" + state: "playing" + playQueueItemID: "123" + time: 0 + duration: 10000 + continuing: 1 + updated: 14200000 + offline: 1 + timeToFirstFrame: 1000 + timeStalled: 1000 + bandwidth: 100 + bufferedTime: 100 + bufferedSize: 1024 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"livetv": 7, "machineIdentifier": "0123456789abcdef0123456789abcdef012345678", "musicAnalysis": 2, "myPlexMappingState": "mapped", "myPlexSigninState": "ok", "offlineTranscode": 1}} + unscrobble: + speakeasy-default-unscrobble: + parameters: + query: + identifier: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + listActivities: + speakeasy-default-list-activities: + responses: + "200": + application/json: {} + cancelActivity: + speakeasy-default-cancel-activity: + parameters: + path: + activityId: "d6199ba1-fb5e-4cae-bf17-1a5369c1cf1e" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + stopTasks: {} + getTasks: + speakeasy-default-get-tasks: + responses: + "200": + application/json: {} + startTasks: {} + createDownloadQueue: + speakeasy-default-create-download-queue: + responses: + "200": + application/json: {} + getDownloadQueue: + speakeasy-default-get-download-queue: + parameters: + path: + queueId: 922802 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + addDownloadQueueItems: + speakeasy-default-add-download-queue-items: + parameters: + path: + queueId: 984925 + query: + keys: ["/library/metadata/3", "/library/metadata/6"] + advancedSubtitles: "burn" + audioBoost: 50 + audioChannelCount: 5 + autoAdjustQuality: 1 + autoAdjustSubtitle: 1 + directPlay: 1 + directStream: 1 + directStreamAudio: 1 + disableResolutionRotation: 1 + hasMDE: 1 + location: "wan" + mediaBufferSize: 102400 + mediaIndex: 0 + musicBitrate: 5000 + offset: 90.5 + partIndex: 0 + path: "/library/metadata/151671" + peakBitrate: 12000 + photoResolution: "1080x1080" + protocol: "dash" + secondsPerSegment: 5 + subtitleSize: 50 + subtitles: "segmented" + videoBitrate: 12000 + videoQuality: 50 + videoResolution: "1080x1080" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + listDownloadQueueItems: + speakeasy-default-list-download-queue-items: + parameters: + path: + queueId: 524138 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getItemDecision: + speakeasy-default-get-item-decision: + parameters: + path: + queueId: 231605 + itemId: 32 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getDownloadQueueMedia: + speakeasy-default-get-download-queue-media: + parameters: + path: + queueId: 663184 + itemId: 32 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + removeDownloadQueueItems: + speakeasy-default-remove-download-queue-items: + parameters: + path: + queueId: 946275 + itemId: [32, 345, 23] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getDownloadQueueItems: + speakeasy-default-get-download-queue-items: + parameters: + path: + queueId: 809886 + itemId: [32, 345, 23] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + restartProcessingDownloadQueueItems: + speakeasy-default-restart-processing-download-queue-items: + parameters: + path: + queueId: 713001 + itemId: [32, 345, 23] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getAllHubs: + speakeasy-default-get-all-hubs: + parameters: + query: + onlyTransient: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getContinueWatching: + speakeasy-default-get-continue-watching: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getHubItems: + speakeasy-default-get-hub-items: + parameters: + query: + identifier: ["", "", ""] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getPromotedHubs: + speakeasy-default-get-promoted-hubs: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getMetadataHubs: + speakeasy-default-get-metadata-hubs: + parameters: + path: + metadataId: 605482 + query: + onlyTransient: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getPostplayHubs: + speakeasy-default-get-postplay-hubs: + parameters: + path: + metadataId: 441419 + query: + onlyTransient: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getRelatedHubs: + speakeasy-default-get-related-hubs: + parameters: + path: + metadataId: 8858 + query: + onlyTransient: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getSectionHubs: + speakeasy-default-get-section-hubs: + parameters: + path: + sectionId: 336924 + query: + onlyTransient: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + resetSectionDefaults: + speakeasy-default-reset-section-defaults: + parameters: + path: + sectionId: 383022 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + listHubs: + speakeasy-default-list-hubs: + parameters: + path: + sectionId: 442546 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + createCustomHub: + speakeasy-default-create-custom-hub: + parameters: + path: + sectionId: 869922 + query: + metadataItemId: 703843 + promotedToRecommended: 1 + promotedToOwnHome: 1 + promotedToSharedHome: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + moveHub: + speakeasy-default-move-hub: + parameters: + path: + sectionId: 755710 + query: + identifier: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + deleteCustomHub: + speakeasy-default-delete-custom-hub: + parameters: + path: + sectionId: 625677 + identifier: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + updateHubVisibility: + speakeasy-default-update-hub-visibility: + parameters: + path: + sectionId: 341650 + identifier: "" + query: + promotedToRecommended: 1 + promotedToOwnHome: 1 + promotedToSharedHome: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + searchHubs: + speakeasy-default-search-hubs: + parameters: + query: + query: "" + sectionId: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + voiceSearchHubs: + speakeasy-default-voice-search-hubs: + parameters: + query: + query: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + getLibraryItems: + speakeasy-default-get-library-items: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + deleteCaches: {} + cleanBundles: {} + ingestTransientItem: + speakeasy-default-ingest-transient-item: + parameters: + query: + url: "file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv" + virtualFilePath: "/Avatar.mkv" + computeHashes: 1 + ingestNonMatches: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getLibraryMatches: + speakeasy-default-get-library-matches: + parameters: + query: + includeFullMetadata: 1 + includeAncestorMetadata: 1 + includeAlternateMetadataSources: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + optimizeDatabase: + speakeasy-default-optimize-database: + parameters: + query: + async: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getRandomArtwork: + speakeasy-default-get-random-artwork: + parameters: + query: + sections: [5, 6] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getSections: + speakeasy-default-get-sections: + responses: + "200": + application/json: {} + addSection: + speakeasy-default-add-section: + parameters: + query: + name: "" + type: 39544 + agent: "" + language: "" + locations: ["O:\\fatboy\\Media\\Ripped\\Music", "O:\\fatboy\\Media\\My Music"] + prefs: {} + relative: 1 + importFromiTunes: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Directory": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + stopAllRefreshes: + speakeasy-default-stop-all-refreshes: + responses: + "200": + application/json: {"MediaContainer": {"livetv": 7, "machineIdentifier": "0123456789abcdef0123456789abcdef012345678", "musicAnalysis": 2, "myPlexMappingState": "mapped", "myPlexSigninState": "ok", "offlineTranscode": 1}} + getSectionsPrefs: + speakeasy-default-get-sections-prefs: + parameters: + query: + type: 460221 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"livetv": 7, "machineIdentifier": "0123456789abcdef0123456789abcdef012345678", "musicAnalysis": 2, "myPlexMappingState": "mapped", "myPlexSigninState": "ok", "offlineTranscode": 1}} + refreshSectionsMetadata: + speakeasy-default-refresh-sections-metadata: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getTags: + speakeasy-default-get-tags: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + deleteMetadataItem: + speakeasy-default-delete-metadata-item: + parameters: + path: + ids: "" + query: + proxy: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + editMetadataItem: + speakeasy-default-edit-metadata-item: + parameters: + path: + ids: ["", ""] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + detectAds: + speakeasy-default-detect-ads: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getAllItemLeaves: + speakeasy-default-get-all-item-leaves: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + analyzeMetadata: + speakeasy-default-analyze-metadata: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + generateThumbs: + speakeasy-default-generate-thumbs: + parameters: + path: + ids: "" + query: + force: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + detectCredits: + speakeasy-default-detect-credits: + parameters: + path: + ids: "" + query: + force: 1 + manual: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getExtras: + speakeasy-default-get-extras: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + addExtras: + speakeasy-default-add-extras: + parameters: + path: + ids: "" + query: + url: "https://super-mortise.biz/" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getFile: + speakeasy-default-get-file: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + audio/mpeg3: "x-file: example.file" + image/jpeg: "x-file: example.file" + startBifGeneration: + speakeasy-default-start-bif-generation: + parameters: + path: + ids: "" + query: + force: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + detectIntros: + speakeasy-default-detect-intros: + parameters: + path: + ids: "" + query: + force: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + createMarker: + speakeasy-default-create-marker: + parameters: + path: + ids: "" + query: + type: 248391 + startTimeOffset: 535191 + attributes: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + matchItem: + speakeasy-default-match-item: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + listMatches: + speakeasy-default-list-matches: + parameters: + path: + ids: "" + query: + manual: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + mergeItems: + speakeasy-default-merge-items: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + listSonicallySimilar: + speakeasy-default-list-sonically-similar: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + setItemPreferences: + speakeasy-default-set-item-preferences: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + refreshItemsMetadata: + speakeasy-default-refresh-items-metadata: + parameters: + path: + ids: "" + query: + markUpdated: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getRelatedItems: + speakeasy-default-get-related-items: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Hub": [{"type": "track", "context": "hub.home.onDeck", "hubIdentifier": "home.onDeck", "key": "/hubs/sections/home/onDeck", "Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}], "size": 1, "subtype": "podcast", "totalSize": 8}]}} + listSimilar: + speakeasy-default-list-similar: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + splitItem: + speakeasy-default-split-item: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + addSubtitles: + speakeasy-default-add-subtitles: + parameters: + path: + ids: "" + query: + forced: 1 + hearingImpaired: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getItemTree: + speakeasy-default-get-item-tree: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"MetadataItem": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "MetadataItem": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}]}} + unmatch: + speakeasy-default-unmatch: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + listTopUsers: + speakeasy-default-list-top-users: + parameters: + path: + ids: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + detectVoiceActivity: + speakeasy-default-detect-voice-activity: + parameters: + path: + ids: "" + query: + force: 1 + manual: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getAugmentationStatus: + speakeasy-default-get-augmentation-status: + parameters: + path: + augmentationId: "" + query: + wait: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + setStreamSelection: + speakeasy-default-set-stream-selection: + parameters: + path: + partId: 360489 + query: + allParts: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getPerson: + speakeasy-default-get-person: + parameters: + path: + personId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Directory": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}} + listPersonMedia: + speakeasy-default-list-person-media: + parameters: + path: + personId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + deleteLibrarySection: + speakeasy-default-delete-library-section: + parameters: + path: + sectionId: "" + query: + async: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getLibraryDetails: + speakeasy-default-get-library-details: + parameters: + path: + sectionId: "" + query: + includeDetails: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Directory": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + editSection: + speakeasy-default-edit-section: + parameters: + path: + sectionId: "" + query: + agent: "" + locations: ["O:\\fatboy\\Media\\Ripped\\Music", "O:\\fatboy\\Media\\My Music"] + prefs: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + updateItems: + speakeasy-default-update-items: + parameters: + path: + sectionId: "" + query: + field.locked: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + startAnalysis: + speakeasy-default-start-analysis: + parameters: + path: + sectionId: 158829 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + autocomplete: + speakeasy-default-autocomplete: + parameters: + path: + sectionId: 942007 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getCollections: + speakeasy-default-get-collections: + parameters: + path: + sectionId: 348838 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getCommon: + speakeasy-default-get-common: + parameters: + path: + sectionId: 298154 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + emptyTrash: + speakeasy-default-empty-trash: + parameters: + path: + sectionId: 30052 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getSectionFilters: + speakeasy-default-get-section-filters: + parameters: + path: + sectionId: 380557 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getFirstCharacters: + speakeasy-default-get-first-characters: + parameters: + path: + sectionId: 3947 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + deleteIndexes: + speakeasy-default-delete-indexes: + parameters: + path: + sectionId: 588437 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + deleteIntros: + speakeasy-default-delete-intros: + parameters: + path: + sectionId: 498656 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getSectionPreferences: + speakeasy-default-get-section-preferences: + parameters: + path: + sectionId: 754869 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + setSectionPreferences: + speakeasy-default-set-section-preferences: + parameters: + path: + sectionId: 349936 + query: + prefs: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + cancelRefresh: + speakeasy-default-cancel-refresh: + parameters: + path: + sectionId: 326852 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + refreshSection: + speakeasy-default-refresh-section: + parameters: + path: + sectionId: 450300 + query: + force: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getAvailableSorts: + speakeasy-default-get-available-sorts: + parameters: + path: + sectionId: 212498 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getStreamLevels: + speakeasy-default-get-stream-levels: + parameters: + path: + streamId: 447611 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getStreamLoudness: + speakeasy-default-get-stream-loudness: + parameters: + path: + streamId: 277271 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + text/plain: "" + getChapterImage: + speakeasy-default-get-chapter-image: + parameters: + path: + mediaId: 892563 + chapter: 48348 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + image/jpeg: "x-file: example.file" + setItemArtwork: + speakeasy-default-set-item-artwork: + parameters: + path: + ids: "" + element: "banner" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + updateItemArtwork: + speakeasy-default-update-item-artwork: + parameters: + path: + ids: "" + element: "clearLogo" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + deleteMarker: + speakeasy-default-delete-marker: + parameters: + path: + ids: "" + marker: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + editMarker: + speakeasy-default-edit-marker: + parameters: + path: + ids: "" + marker: "" + query: + type: 884347 + startTimeOffset: 517251 + attributes: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + deleteMediaItem: + speakeasy-default-delete-media-item: + parameters: + path: + ids: "" + mediaItem: "" + query: + proxy: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getPartIndex: + speakeasy-default-get-part-index: + parameters: + path: + partId: 724750 + index: "sd" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/octet-stream: "x-file: example.file" + deleteCollection: + speakeasy-default-delete-collection: + parameters: + path: + sectionId: 283619 + collectionId: 680895 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getSectionImage: + speakeasy-default-get-section-image: + parameters: + path: + sectionId: 925611 + updatedAt: 117413 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + deleteStream: + speakeasy-default-delete-stream: + parameters: + path: + streamId: 841510 + ext: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getStream: + speakeasy-default-get-stream: + parameters: + path: + streamId: 314506 + ext: "" + query: + autoAdjustSubtitle: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + setStreamOffset: + speakeasy-default-set-stream-offset: + parameters: + path: + streamId: 606295 + ext: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getItemArtwork: + speakeasy-default-get-item-artwork: + parameters: + path: + ids: "" + element: "poster" + timestamp: 999555 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + audio/mpeg3: "x-file: example.file" + image/jpeg: "x-file: example.file" + getMediaPart: + speakeasy-default-get-media-part: + parameters: + path: + partId: 877105 + changestamp: 970622 + filename: "example.file" + query: + download: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getImageFromBif: + speakeasy-default-get-image-from-bif: + parameters: + path: + partId: 304273 + index: "sd" + offset: 939569 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + image/jpeg: "x-file: example.file" + createCollection: + speakeasy-default-create-collection: + parameters: + query: + sectionId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + listDVRs: + speakeasy-default-list-DV-rs: + responses: + "200": + application/json: {} + createDVR: + speakeasy-default-create-DVR: + parameters: + query: + lineup: "lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT" + device: ["device[]=device://tv.plex.grabbers.hdhomerun/1053C0CA"] + language: "eng" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + deleteDVR: + speakeasy-default-delete-DVR: + parameters: + path: + dvrId: 855088 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getDVR: + speakeasy-default-get-DVR: + parameters: + path: + dvrId: 973518 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + deleteLineup: + speakeasy-default-delete-lineup: + parameters: + path: + dvrId: 454470 + query: + lineup: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + addLineup: + speakeasy-default-add-lineup: + parameters: + path: + dvrId: 945235 + query: + lineup: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + setDVRPreferences: + speakeasy-default-set-DVR-preferences: + parameters: + path: + dvrId: 116357 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + stopDVRReload: + speakeasy-default-stop-DVR-reload: + parameters: + path: + dvrId: 348053 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + reloadGuide: + speakeasy-default-reload-guide: + parameters: + path: + dvrId: 140753 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + tuneChannel: + speakeasy-default-tune-channel: + parameters: + path: + dvrId: 834281 + channel: "2.1" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + removeDeviceFromDVR: + speakeasy-default-remove-device-from-DVR: + parameters: + path: + dvrId: 945416 + deviceId: 260761 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + addDeviceToDVR: + speakeasy-default-add-device-to-DVR: + parameters: + path: + dvrId: 334755 + deviceId: 852930 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + computeChannelMap: + speakeasy-default-compute-channel-map: + parameters: + query: + device: "" + lineup: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getChannels: + speakeasy-default-get-channels: + parameters: + query: + lineup: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getCountries: + speakeasy-default-get-countries: + responses: + "200": + application/json: {} + getAllLanguages: + speakeasy-default-get-all-languages: + responses: + "200": + application/json: {} + getLineup: + speakeasy-default-get-lineup: + parameters: + query: + device: "" + lineupGroup: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getLineupChannels: + speakeasy-default-get-lineup-channels: + parameters: + query: + lineup: ["", ""] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getCountriesLineups: + speakeasy-default-get-countries-lineups: + parameters: + path: + country: "Malawi" + epgId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getCountryRegions: + speakeasy-default-get-country-regions: + parameters: + path: + country: "Morocco" + epgId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + listLineups: + speakeasy-default-list-lineups: + parameters: + path: + country: "Vanuatu" + epgId: "" + region: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getLiveTVSession: + speakeasy-default-get-live-TV-session: + parameters: + path: + sessionId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getSessionPlaylistIndex: + speakeasy-default-get-session-playlist-index: + parameters: + path: + sessionId: "" + consumerId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getSessionSegment: + speakeasy-default-get-session-segment: + parameters: + path: + sessionId: "" + consumerId: "" + segmentId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + writeLog: + speakeasy-default-write-log: + requestBody: + text/plain: "x-file: example.file" + writeMessage: + speakeasy-default-write-message: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + enablePapertrail: + speakeasy-default-enable-papertrail: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getAvailableGrabbers: + speakeasy-default-get-available-grabbers: + parameters: + query: + protocol: "livetv" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + listDevices: + speakeasy-default-list-devices: + responses: + "200": + application/json: {} + addDevice: + speakeasy-default-add-device: + parameters: + query: + uri: "http://10.0.0.5" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + discoverDevices: + speakeasy-default-discover-devices: + responses: + "200": + application/json: {} + removeDevice: + speakeasy-default-remove-device: + parameters: + path: + deviceId: 685908 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getDeviceDetails: + speakeasy-default-get-device-details: + parameters: + path: + deviceId: 170949 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + modifyDevice: + speakeasy-default-modify-device: + parameters: + path: + deviceId: 879135 + query: + enabled: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + setChannelmap: + speakeasy-default-set-channelmap: + parameters: + path: + deviceId: 937661 + query: + channelMapping: {} + channelMappingByKey: {} + channelsEnabled: ["46.1,44.1,45.1"] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getDevicesChannels: + speakeasy-default-get-devices-channels: + parameters: + path: + deviceId: 517209 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + setDevicePreferences: + speakeasy-default-set-device-preferences: + parameters: + path: + deviceId: 420973 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + stopScan: + speakeasy-default-stop-scan: + parameters: + path: + deviceId: 576494 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + scan: + speakeasy-default-scan: + parameters: + path: + deviceId: 57391 + query: + source: "Cable" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getThumb: + speakeasy-default-get-thumb: + parameters: + path: + deviceId: 960617 + version: 1025 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + listProviders: + speakeasy-default-list-providers: + responses: + "200": + application/json: {"MediaContainer": {"livetv": 7, "machineIdentifier": "0123456789abcdef0123456789abcdef012345678", "musicAnalysis": 2, "myPlexMappingState": "mapped", "myPlexSigninState": "ok", "offlineTranscode": 1}} + addProvider: + speakeasy-default-add-provider: + parameters: + query: + url: "https://steep-obedience.name/" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + refreshProviders: {} + deleteMediaProvider: + speakeasy-default-delete-media-provider: + parameters: + path: + provider: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getAllSubscriptions: + speakeasy-default-get-all-subscriptions: + parameters: + query: + includeGrabs: 1 + includeStorage: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"MediaSubscription": [{"MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}]}} + createSubscription: + speakeasy-default-create-subscription: + parameters: + query: + targetLibrarySectionID: 1 + targetSectionLocationID: 3 + type: 2 + hints: {} + prefs: {} + params: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"MediaSubscription": [{"MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}]}} + processSubscriptions: {} + getScheduledRecordings: + speakeasy-default-get-scheduled-recordings: + responses: + "200": + application/json: {"MediaContainer": {"MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}} + getTemplate: + speakeasy-default-get-template: + parameters: + query: + guid: "plex://episode/5fc70265c40548002d539d23" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"SubscriptionTemplate": [{"MediaSubscription": [{"title": "This Episode", "MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}]}]}} + cancelGrab: + speakeasy-default-cancel-grab: + parameters: + path: + operationId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + deleteSubscription: + speakeasy-default-delete-subscription: + parameters: + path: + subscriptionId: 974618 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getSubscription: + speakeasy-default-get-subscription: + parameters: + path: + subscriptionId: 186713 + query: + includeGrabs: 1 + includeStorage: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"MediaSubscription": [{"MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}]}} + editSubscriptionPreferences: + speakeasy-default-edit-subscription-preferences: + parameters: + path: + subscriptionId: 673918 + query: + prefs: {} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"MediaSubscription": [{"MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}]}} + reorderSubscription: + speakeasy-default-reorder-subscription: + parameters: + path: + subscriptionId: 440634 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"MediaSubscription": [{"MediaGrabOperation": [{"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}]}]}} + transcodeImage: + speakeasy-default-transcode-image: + parameters: + query: + url: "/library/metadata/265/thumb/1715112705" + background: "#ff5522" + upscale: 1 + minSize: 1 + rotate: 1 + blendColor: "#ff5522" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + image/jpeg: "x-file: example.file" + image/png: "x-file: example.file" + image/x-portable-pixmap: "x-file: example.file" + makeDecision: + speakeasy-default-make-decision: + parameters: + path: + transcodeType: "music" + query: + advancedSubtitles: "burn" + audioBoost: 50 + audioChannelCount: 5 + autoAdjustQuality: 1 + autoAdjustSubtitle: 1 + directPlay: 1 + directStream: 1 + directStreamAudio: 1 + disableResolutionRotation: 1 + hasMDE: 1 + location: "wan" + mediaBufferSize: 102400 + mediaIndex: 0 + musicBitrate: 5000 + offset: 90.5 + partIndex: 0 + path: "/library/metadata/151671" + peakBitrate: 12000 + photoResolution: "1080x1080" + protocol: "dash" + secondsPerSegment: 5 + subtitleSize: 50 + subtitles: "none" + videoBitrate: 12000 + videoQuality: 50 + videoResolution: "1080x1080" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + X-Plex-Client-Profile-Extra: "add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)" + X-Plex-Client-Profile-Name: "generic" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + triggerFallback: + speakeasy-default-trigger-fallback: + parameters: + path: + transcodeType: "audio" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + transcodeSubtitles: + speakeasy-default-transcode-subtitles: + parameters: + path: + transcodeType: "audio" + query: + advancedSubtitles: "burn" + audioBoost: 50 + audioChannelCount: 5 + autoAdjustQuality: 1 + autoAdjustSubtitle: 1 + directPlay: 1 + directStream: 1 + directStreamAudio: 1 + disableResolutionRotation: 1 + hasMDE: 1 + location: "wan" + mediaBufferSize: 102400 + mediaIndex: 0 + musicBitrate: 5000 + offset: 90.5 + partIndex: 0 + path: "/library/metadata/151671" + peakBitrate: 12000 + photoResolution: "1080x1080" + protocol: "dash" + secondsPerSegment: 5 + subtitleSize: 50 + subtitles: "embedded" + videoBitrate: 12000 + videoQuality: 50 + videoResolution: "1080x1080" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + X-Plex-Client-Profile-Extra: "add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)" + X-Plex-Client-Profile-Name: "generic" + startTranscodeSession: + speakeasy-default-start-transcode-session: + parameters: + path: + transcodeType: "music" + extension: "mpd" + query: + advancedSubtitles: "burn" + audioBoost: 50 + audioChannelCount: 5 + autoAdjustQuality: 1 + autoAdjustSubtitle: 1 + directPlay: 1 + directStream: 1 + directStreamAudio: 1 + disableResolutionRotation: 1 + hasMDE: 1 + location: "wan" + mediaBufferSize: 102400 + mediaIndex: 0 + musicBitrate: 5000 + offset: 90.5 + partIndex: 0 + path: "/library/metadata/151671" + peakBitrate: 12000 + photoResolution: "1080x1080" + protocol: "dash" + secondsPerSegment: 5 + subtitleSize: 50 + subtitles: "none" + videoBitrate: 12000 + videoQuality: 50 + videoResolution: "1080x1080" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + X-Plex-Client-Profile-Extra: "add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)" + X-Plex-Client-Profile-Name: "generic" + responses: + "200": + video/x-matroska: "x-file: example.file" + listPlaylists: + speakeasy-default-list-playlists: + parameters: + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getPlaylistItems: + speakeasy-default-get-playlist-items: + parameters: + path: + playlistId: 118195 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getPlaylistGenerators: + speakeasy-default-get-playlist-generators: + parameters: + path: + playlistId: 162342 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + clearPlaylistItems: + speakeasy-default-clear-playlist-items: + parameters: + path: + playlistId: 552140 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + addPlaylistItems: + speakeasy-default-add-playlist-items: + parameters: + path: + playlistId: 533723 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + deletePlaylistItem: + speakeasy-default-delete-playlist-item: + parameters: + path: + playlistId: 981646 + generatorId: 194010 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getPlaylistGenerator: + speakeasy-default-get-playlist-generator: + parameters: + path: + playlistId: 744880 + generatorId: 322168 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + modifyPlaylistGenerator: + speakeasy-default-modify-playlist-generator: + parameters: + path: + playlistId: 972007 + generatorId: 208334 + query: + Item: {"Location": {"uri": "library://82503060-0d68-4603-b594-8b071d54819e/item/%2Flibrary%2Fmetadata%2F146"}, "locationID": -1, "Policy": {"value": null, "scope": "all", "unwatched": 0}, "target": "", "targetTagID": 1, "title": "Jack-Jack Attack", "type": 42} + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getPlaylistGeneratorItems: + speakeasy-default-get-playlist-generator-items: + parameters: + path: + playlistId: 77230 + generatorId: 979714 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": {"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}}} + movePlaylistItem: + speakeasy-default-move-playlist-item: + parameters: + path: + playlistId: 940298 + playlistItemId: 375626 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + refreshPlaylist: + speakeasy-default-refresh-playlist: + parameters: + path: + playlistId: 895314 + generatorId: 629742 + metadataId: 724422 + action: "disable" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + createPlayQueue: + speakeasy-default-create-play-queue: + parameters: + query: + type: "audio" + shuffle: 1 + repeat: 1 + continuous: 1 + recursive: 1 + onDeck: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getPlayQueue: + speakeasy-default-get-play-queue: + parameters: + path: + playQueueId: 210646 + query: + own: 1 + includeBefore: 1 + includeAfter: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + addToPlayQueue: + speakeasy-default-add-to-play-queue: + parameters: + path: + playQueueId: 919248 + query: + next: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + clearPlayQueue: + speakeasy-default-clear-play-queue: + parameters: + path: + playQueueId: 86357 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + resetPlayQueue: + speakeasy-default-reset-play-queue: + parameters: + path: + playQueueId: 581891 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + shuffle: + speakeasy-default-shuffle: + parameters: + path: + playQueueId: 316150 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + unshuffle: + speakeasy-default-unshuffle: + parameters: + path: + playQueueId: 484388 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + deletePlayQueueItem: + speakeasy-default-delete-play-queue-item: + parameters: + path: + playQueueId: 285738 + playQueueItemId: 464354 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + movePlayQueueItem: + speakeasy-default-move-play-queue-item: + parameters: + path: + playQueueId: 31341 + playQueueItemId: 495865 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getColors: + speakeasy-default-get-colors: + parameters: + query: + url: "/library/metadata/217745/art/1718931408" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getImage: + speakeasy-default-get-image: + parameters: + query: + topLeft: "3f280a" + topRight: "6b4713" + bottomRight: "0f2a43" + bottomLeft: "1c425d" + width: 1920 + height: 1080 + noise: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + image/png: "x-file: example.file" + listSessions: + speakeasy-default-list-sessions: + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getBackgroundTasks: + speakeasy-default-get-background-tasks: + responses: + "200": + application/json: {} + listPlaybackHistory: + speakeasy-default-list-playback-history: + parameters: + query: + sort: ["viewedAt:desc,accountID"] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + terminateSession: + speakeasy-default-terminate-session: + parameters: + query: + sessionId: "cdefghijklmnopqrstuvwxyz" + reason: "Stop Playing" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + deleteHistory: + speakeasy-default-delete-history: + parameters: + path: + historyId: 953579 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getHistoryItem: + speakeasy-default-get-history-item: + parameters: + path: + historyId: 832213 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + checkUpdates: + speakeasy-default-check-updates: + parameters: + query: + download: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + getUpdatesStatus: + speakeasy-default-get-updates-status: + responses: + "200": + application/json: {} + getCollectionItems: + speakeasy-default-get-collection-items: + parameters: + path: + collectionId: 314585 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getMetadataItem: + speakeasy-default-get-metadata-item: + parameters: + path: + ids: [] + query: + asyncCheckFiles: 1 + asyncRefreshLocalMediaAgent: 1 + asyncRefreshAnalysis: 1 + checkFiles: 1 + skipRefresh: 1 + checkFileAvailability: 1 + asyncAugmentMetadata: 1 + augmentCount: 1 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getAlbums: + speakeasy-default-get-albums: + parameters: + path: + sectionId: 817133 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + listContent: + speakeasy-default-list-content: + parameters: + path: + sectionId: "" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getAllLeaves: + speakeasy-default-get-all-leaves: + parameters: + path: + sectionId: 633197 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getArts: + speakeasy-default-get-arts: + parameters: + path: + sectionId: 859200 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getCategories: + speakeasy-default-get-categories: + parameters: + path: + sectionId: 21841 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getCluster: + speakeasy-default-get-cluster: + parameters: + path: + sectionId: 138560 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getSonicPath: + speakeasy-default-get-sonic-path: + parameters: + path: + sectionId: 914549 + query: + startID: 629990 + endID: 687740 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getFolders: + speakeasy-default-get-folders: + parameters: + path: + sectionId: 892532 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + listMoments: + speakeasy-default-list-moments: + parameters: + path: + sectionId: 403239 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {} + getSonicallySimilar: + speakeasy-default-get-sonically-similar: + parameters: + path: + sectionId: 525956 + query: + values: [] + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + getCollectionImage: + speakeasy-default-get-collection-image: + parameters: + path: + collectionId: 474227 + updatedAt: 759379 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + image/jpeg: "x-file: example.file" + addCollectionItems: + speakeasy-default-add-collection-items: + parameters: + path: + collectionId: 338144 + query: + uri: "https://expensive-bakeware.com" + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + deleteCollectionItem: + speakeasy-default-delete-collection-item: + parameters: + path: + collectionId: 320928 + itemId: 406983 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} + moveCollectionItem: + speakeasy-default-move-collection-item: + parameters: + path: + collectionId: 239532 + itemId: 513864 + header: + accepts: "application/xml" + X-Plex-Client-Identifier: "abc123" + X-Plex-Product: "Plex for Roku" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Device: "Roku 3" + X-Plex-Model: "4200X" + X-Plex-Device-Vendor: "Roku" + X-Plex-Device-Name: "Living Room TV" + X-Plex-Marketplace: "googlePlay" + responses: + "200": + application/json: {"MediaContainer": {"Metadata": [{"Autotag": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Country": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Director": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Genre": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Guid": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Media": [{"aspectRatio": 2.35, "audioChannels": 2, "audioCodec": "aac", "audioProfile": "lc", "bitrate": 5612, "container": "mov", "duration": 150192, "has64bitOffsets": false, "hasVoiceActivity": true, "height": 544, "id": 1, "optimizedForStreaming": false, "Part": [{"audioProfile": "lc", "container": "mov", "duration": 150192, "file": "/home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov", "has64bitOffsets": false, "id": 1, "key": "/library/parts/1/1531779263/file.mov", "optimizedForStreaming": false, "size": 105355654, "Stream": [{"default": true, "audioChannelLayout": "stereo", "bitDepth": 8, "bitrate": 5466, "canAutoSync": true, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codec": "h264", "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "displayTitle": "English (H.264 Main)", "frameRate": 23.976, "hasScalingMatrix": false, "height": 544, "id": 1, "index": 0, "key": "/library/streams/1", "language": "English", "languageCode": "eng", "level": 31, "profile": "main", "refFrames": 2, "samplingRate": 48000, "streamIdentifier": 1, "streamType": 1, "width": 1280}], "videoProfile": "main"}], "videoCodec": "h264", "videoFrameRate": "24p", "videoProfile": "main", "videoResolution": "720", "width": 1280}], "Rating": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Role": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}], "Writer": [{"filter": "actor=49", "role": "Secretary", "tag": "Shaun Lawton", "tagKey": "5d3ee12c4cde6a001c3e0b27", "thumb": "http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg"}]}]}} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Go SDK Changes Detected:\n* `PlexApi.Butler.StartTask()`: \n * `request` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `PlexApi.Butler.StopTask()`: \n * `request` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `PlexApi.Updater.ApplyUpdates()`: \n * `request` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `PlexApi.General.GetServerInfo()`: **Added**\n* `PlexApi.General.GetIdentity()`: **Added**\n* `PlexApi.General.GetSourceConnectionInformation()`: **Added**\n* `PlexApi.General.GetTransientToken()`: **Added**\n* `PlexApi.Events.GetNotifications()`: **Added**\n* `PlexApi.Events.ConnectWebSocket()`: **Added**\n* `PlexApi.Preferences.GetAllPreferences()`: **Added**\n* `PlexApi.Preferences.SetPreferences()`: **Added**\n* `PlexApi.Preferences.GetPreference()`: **Added**\n* `PlexApi.Rate.SetRating()`: **Added**\n* `PlexApi.Timeline.MarkPlayed()`: **Added**\n* `PlexApi.Timeline.Report()`: **Added**\n* `PlexApi.Timeline.Unscrobble()`: **Added**\n* `PlexApi.Activities.ListActivities()`: **Added**\n* `PlexApi.Activities.CancelActivity()`: **Added**\n* `PlexApi.Butler.StopTasks()`: **Added**\n* `PlexApi.Butler.GetTasks()`: **Added**\n* `PlexApi.Butler.StartTasks()`: **Added**\n* `PlexApi.DownloadQueue.CreateDownloadQueue()`: **Added**\n* `PlexApi.DownloadQueue.GetDownloadQueue()`: **Added**\n* `PlexApi.DownloadQueue.AddDownloadQueueItems()`: **Added**\n* `PlexApi.DownloadQueue.ListDownloadQueueItems()`: **Added**\n* `PlexApi.DownloadQueue.GetItemDecision()`: **Added**\n* `PlexApi.DownloadQueue.GetDownloadQueueMedia()`: **Added**\n* `PlexApi.DownloadQueue.RemoveDownloadQueueItems()`: **Added**\n* `PlexApi.DownloadQueue.GetDownloadQueueItems()`: **Added**\n* `PlexApi.DownloadQueue.RestartProcessingDownloadQueueItems()`: **Added**\n* `PlexApi.Hubs.GetAllHubs()`: **Added**\n* `PlexApi.Hubs.GetContinueWatching()`: **Added**\n* `PlexApi.Hubs.GetHubItems()`: **Added**\n* `PlexApi.Hubs.GetPromotedHubs()`: **Added**\n* `PlexApi.Hubs.GetMetadataHubs()`: **Added**\n* `PlexApi.Hubs.GetPostplayHubs()`: **Added**\n* `PlexApi.Hubs.GetRelatedHubs()`: **Added**\n* `PlexApi.Hubs.GetSectionHubs()`: **Added**\n* `PlexApi.Hubs.ResetSectionDefaults()`: **Added**\n* `PlexApi.Hubs.ListHubs()`: **Added**\n* `PlexApi.Hubs.CreateCustomHub()`: **Added**\n* `PlexApi.Hubs.MoveHub()`: **Added**\n* `PlexApi.Hubs.DeleteCustomHub()`: **Added**\n* `PlexApi.Hubs.UpdateHubVisibility()`: **Added**\n* `PlexApi.Search.SearchHubs()`: **Added**\n* `PlexApi.Search.VoiceSearchHubs()`: **Added**\n* `PlexApi.Library.GetLibraryItems()`: **Added**\n* `PlexApi.Library.DeleteCaches()`: **Added**\n* `PlexApi.Library.CleanBundles()`: **Added**\n* `PlexApi.Library.IngestTransientItem()`: **Added**\n* `PlexApi.Library.GetLibraryMatches()`: **Added**\n* `PlexApi.Library.OptimizeDatabase()`: **Added**\n* `PlexApi.Library.GetRandomArtwork()`: **Added**\n* `PlexApi.Library.GetSections()`: **Added**\n* `PlexApi.Library.AddSection()`: **Added**\n* `PlexApi.Library.StopAllRefreshes()`: **Added**\n* `PlexApi.Library.GetSectionsPrefs()`: **Added**\n* `PlexApi.Library.RefreshSectionsMetadata()`: **Added**\n* `PlexApi.Library.GetTags()`: **Added**\n* `PlexApi.Library.DeleteMetadataItem()`: **Added**\n* `PlexApi.Library.EditMetadataItem()`: **Added**\n* `PlexApi.Library.DetectAds()`: **Added**\n* `PlexApi.Library.GetAllItemLeaves()`: **Added**\n* `PlexApi.Library.AnalyzeMetadata()`: **Added**\n* `PlexApi.Library.GenerateThumbs()`: **Added**\n* `PlexApi.Library.DetectCredits()`: **Added**\n* `PlexApi.Library.GetExtras()`: **Added**\n* `PlexApi.Library.AddExtras()`: **Added**\n* `PlexApi.Library.GetFile()`: **Added**\n* `PlexApi.Library.StartBifGeneration()`: **Added**\n* `PlexApi.Library.DetectIntros()`: **Added**\n* `PlexApi.Library.CreateMarker()`: **Added**\n* `PlexApi.Library.MatchItem()`: **Added**\n* `PlexApi.Library.ListMatches()`: **Added**\n* `PlexApi.Library.MergeItems()`: **Added**\n* `PlexApi.Library.ListSonicallySimilar()`: **Added**\n* `PlexApi.Library.SetItemPreferences()`: **Added**\n* `PlexApi.Library.RefreshItemsMetadata()`: **Added**\n* `PlexApi.Library.GetRelatedItems()`: **Added**\n* `PlexApi.Library.ListSimilar()`: **Added**\n* `PlexApi.Library.SplitItem()`: **Added**\n* `PlexApi.Library.AddSubtitles()`: **Added**\n* `PlexApi.Library.GetItemTree()`: **Added**\n* `PlexApi.Library.Unmatch()`: **Added**\n* `PlexApi.Library.ListTopUsers()`: **Added**\n* `PlexApi.Library.DetectVoiceActivity()`: **Added**\n* `PlexApi.Library.GetAugmentationStatus()`: **Added**\n* `PlexApi.Library.SetStreamSelection()`: **Added**\n* `PlexApi.Library.GetPerson()`: **Added**\n* `PlexApi.Library.ListPersonMedia()`: **Added**\n* `PlexApi.Library.DeleteLibrarySection()`: **Added**\n* `PlexApi.Library.GetLibraryDetails()`: **Added**\n* `PlexApi.Library.EditSection()`: **Added**\n* `PlexApi.Library.UpdateItems()`: **Added**\n* `PlexApi.Library.StartAnalysis()`: **Added**\n* `PlexApi.Library.Autocomplete()`: **Added**\n* `PlexApi.Library.GetCollections()`: **Added**\n* `PlexApi.Library.GetCommon()`: **Added**\n* `PlexApi.Library.EmptyTrash()`: **Added**\n* `PlexApi.Library.GetSectionFilters()`: **Added**\n* `PlexApi.Library.GetFirstCharacters()`: **Added**\n* `PlexApi.Library.DeleteIndexes()`: **Added**\n* `PlexApi.Library.DeleteIntros()`: **Added**\n* `PlexApi.Library.GetSectionPreferences()`: **Added**\n* `PlexApi.Library.SetSectionPreferences()`: **Added**\n* `PlexApi.Library.CancelRefresh()`: **Added**\n* `PlexApi.Library.RefreshSection()`: **Added**\n* `PlexApi.Library.GetAvailableSorts()`: **Added**\n* `PlexApi.Library.GetStreamLevels()`: **Added**\n* `PlexApi.Library.GetStreamLoudness()`: **Added**\n* `PlexApi.Library.GetChapterImage()`: **Added**\n* `PlexApi.Library.SetItemArtwork()`: **Added**\n* `PlexApi.Library.UpdateItemArtwork()`: **Added**\n* `PlexApi.Library.DeleteMarker()`: **Added**\n* `PlexApi.Library.EditMarker()`: **Added**\n* `PlexApi.Library.DeleteMediaItem()`: **Added**\n* `PlexApi.Library.GetPartIndex()`: **Added**\n* `PlexApi.Library.DeleteCollection()`: **Added**\n* `PlexApi.Library.GetSectionImage()`: **Added**\n* `PlexApi.Library.DeleteStream()`: **Added**\n* `PlexApi.Library.GetStream()`: **Added**\n* `PlexApi.Library.SetStreamOffset()`: **Added**\n* `PlexApi.Library.GetItemArtwork()`: **Added**\n* `PlexApi.Library.GetMediaPart()`: **Added**\n* `PlexApi.Library.GetImageFromBif()`: **Added**\n* `PlexApi.Collections.CreateCollection()`: **Added**\n* `PlexApi.DvRs.ListDvRs()`: **Added**\n* `PlexApi.DvRs.CreateDvr()`: **Added**\n* `PlexApi.DvRs.DeleteDvr()`: **Added**\n* `PlexApi.DvRs.GetDvr()`: **Added**\n* `PlexApi.DvRs.DeleteLineup()`: **Added**\n* `PlexApi.DvRs.AddLineup()`: **Added**\n* `PlexApi.DvRs.SetDvrPreferences()`: **Added**\n* `PlexApi.DvRs.StopDvrReload()`: **Added**\n* `PlexApi.DvRs.ReloadGuide()`: **Added**\n* `PlexApi.DvRs.TuneChannel()`: **Added**\n* `PlexApi.DvRs.RemoveDeviceFromDvr()`: **Added**\n* `PlexApi.DvRs.AddDeviceToDvr()`: **Added**\n* `PlexApi.Epg.ComputeChannelMap()`: **Added**\n* `PlexApi.Epg.GetChannels()`: **Added**\n* `PlexApi.Epg.GetCountries()`: **Added**\n* `PlexApi.Epg.GetAllLanguages()`: **Added**\n* `PlexApi.Epg.GetLineup()`: **Added**\n* `PlexApi.Epg.GetLineupChannels()`: **Added**\n* `PlexApi.Epg.GetCountriesLineups()`: **Added**\n* `PlexApi.Epg.GetCountryRegions()`: **Added**\n* `PlexApi.Epg.ListLineups()`: **Added**\n* `PlexApi.LiveTv.GetSessions()`: **Added**\n* `PlexApi.LiveTv.GetLiveTvSession()`: **Added**\n* `PlexApi.LiveTv.GetSessionPlaylistIndex()`: **Added**\n* `PlexApi.LiveTv.GetSessionSegment()`: **Added**\n* `PlexApi.Log.WriteLog()`: **Added**\n* `PlexApi.Log.WriteMessage()`: **Added**\n* `PlexApi.Log.EnablePapertrail()`: **Added**\n* `PlexApi.Devices.GetAvailableGrabbers()`: **Added**\n* `PlexApi.Devices.ListDevices()`: **Added**\n* `PlexApi.Devices.AddDevice()`: **Added**\n* `PlexApi.Devices.DiscoverDevices()`: **Added**\n* `PlexApi.Devices.RemoveDevice()`: **Added**\n* `PlexApi.Devices.GetDeviceDetails()`: **Added**\n* `PlexApi.Devices.ModifyDevice()`: **Added**\n* `PlexApi.Devices.SetChannelmap()`: **Added**\n* `PlexApi.Devices.GetDevicesChannels()`: **Added**\n* `PlexApi.Devices.SetDevicePreferences()`: **Added**\n* `PlexApi.Devices.StopScan()`: **Added**\n* `PlexApi.Devices.Scan()`: **Added**\n* `PlexApi.Devices.GetThumb()`: **Added**\n* `PlexApi.Provider.ListProviders()`: **Added**\n* `PlexApi.Provider.AddProvider()`: **Added**\n* `PlexApi.Provider.RefreshProviders()`: **Added**\n* `PlexApi.Provider.DeleteMediaProvider()`: **Added**\n* `PlexApi.Subscriptions.GetAllSubscriptions()`: **Added**\n* `PlexApi.Subscriptions.CreateSubscription()`: **Added**\n* `PlexApi.Subscriptions.ProcessSubscriptions()`: **Added**\n* `PlexApi.Subscriptions.GetScheduledRecordings()`: **Added**\n* `PlexApi.Subscriptions.GetTemplate()`: **Added**\n* `PlexApi.Subscriptions.CancelGrab()`: **Added**\n* `PlexApi.Subscriptions.DeleteSubscription()`: **Added**\n* `PlexApi.Subscriptions.GetSubscription()`: **Added**\n* `PlexApi.Subscriptions.EditSubscriptionPreferences()`: **Added**\n* `PlexApi.Subscriptions.ReorderSubscription()`: **Added**\n* `PlexApi.Transcoder.TranscodeImage()`: **Added**\n* `PlexApi.Transcoder.MakeDecision()`: **Added**\n* `PlexApi.Transcoder.TriggerFallback()`: **Added**\n* `PlexApi.Transcoder.TranscodeSubtitles()`: **Added**\n* `PlexApi.Transcoder.StartTranscodeSession()`: **Added**\n* `PlexApi.Playlist.ListPlaylists()`: **Added**\n* `PlexApi.Playlist.GetPlaylist()`: **Added**\n* `PlexApi.Playlist.GetPlaylistItems()`: **Added**\n* `PlexApi.LibraryPlaylists.CreatePlaylist()`: **Added**\n* `PlexApi.LibraryPlaylists.UploadPlaylist()`: **Added**\n* `PlexApi.LibraryPlaylists.DeletePlaylist()`: **Added**\n* `PlexApi.LibraryPlaylists.UpdatePlaylist()`: **Added**\n* `PlexApi.LibraryPlaylists.GetPlaylistGenerators()`: **Added**\n* `PlexApi.LibraryPlaylists.ClearPlaylistItems()`: **Added**\n* `PlexApi.LibraryPlaylists.AddPlaylistItems()`: **Added**\n* `PlexApi.LibraryPlaylists.DeletePlaylistItem()`: **Added**\n* `PlexApi.LibraryPlaylists.GetPlaylistGenerator()`: **Added**\n* `PlexApi.LibraryPlaylists.ModifyPlaylistGenerator()`: **Added**\n* `PlexApi.LibraryPlaylists.GetPlaylistGeneratorItems()`: **Added**\n* `PlexApi.LibraryPlaylists.MovePlaylistItem()`: **Added**\n* `PlexApi.LibraryPlaylists.RefreshPlaylist()`: **Added**\n* `PlexApi.PlayQueue.CreatePlayQueue()`: **Added**\n* `PlexApi.PlayQueue.GetPlayQueue()`: **Added**\n* `PlexApi.PlayQueue.AddToPlayQueue()`: **Added**\n* `PlexApi.PlayQueue.ClearPlayQueue()`: **Added**\n* `PlexApi.PlayQueue.ResetPlayQueue()`: **Added**\n* `PlexApi.PlayQueue.Shuffle()`: **Added**\n* `PlexApi.PlayQueue.Unshuffle()`: **Added**\n* `PlexApi.PlayQueue.DeletePlayQueueItem()`: **Added**\n* `PlexApi.PlayQueue.MovePlayQueueItem()`: **Added**\n* `PlexApi.UltraBlur.GetColors()`: **Added**\n* `PlexApi.UltraBlur.GetImage()`: **Added**\n* `PlexApi.Status.ListSessions()`: **Added**\n* `PlexApi.Status.GetBackgroundTasks()`: **Added**\n* `PlexApi.Status.ListPlaybackHistory()`: **Added**\n* `PlexApi.Status.TerminateSession()`: **Added**\n* `PlexApi.Status.DeleteHistory()`: **Added**\n* `PlexApi.Status.GetHistoryItem()`: **Added**\n* `PlexApi.Updater.CheckUpdates()`: **Added**\n* `PlexApi.Updater.GetUpdatesStatus()`: **Added**\n* `PlexApi.Content.GetCollectionItems()`: **Added**\n* `PlexApi.Content.GetMetadataItem()`: **Added**\n* `PlexApi.Content.GetAlbums()`: **Added**\n* `PlexApi.Content.ListContent()`: **Added**\n* `PlexApi.Content.GetAllLeaves()`: **Added**\n* `PlexApi.Content.GetArts()`: **Added**\n* `PlexApi.Content.GetCategories()`: **Added**\n* `PlexApi.Content.GetCluster()`: **Added**\n* `PlexApi.Content.GetSonicPath()`: **Added**\n* `PlexApi.Content.GetFolders()`: **Added**\n* `PlexApi.Content.ListMoments()`: **Added**\n* `PlexApi.Content.GetSonicallySimilar()`: **Added**\n* `PlexApi.Content.GetCollectionImage()`: **Added**\n* `PlexApi.LibraryCollections.AddCollectionItems()`: **Added**\n* `PlexApi.LibraryCollections.DeleteCollectionItem()`: **Added**\n* `PlexApi.LibraryCollections.MoveCollectionItem()`: **Added**\n* `PlexApi.Server.GetServerCapabilities()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.GetServerPreferences()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.GetAvailableClients()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.GetDevices()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.Get-Server-Identity()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.GetMyPlexAccount()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.GetResizedPhoto()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.Get-Media-Providers()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Server.GetServerList()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Media.MarkPlayed()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Media.MarkUnplayed()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Media.UpdatePlayProgress()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Media.Get-Banner-Image()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Media.Get-Thumb-Image()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Video.GetTimeline()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Video.StartUniversalTranscode()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Activities.GetServerActivities()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Activities.CancelServerActivities()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Butler.GetButlerTasks()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Butler.StartAllTasks()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Butler.StopAllTasks()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.GetCompanionsData()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.GetUserFriends()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.GetGeoData()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.GetHomeData()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.Get-Server-Resources()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.GetPin()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Plex.GetTokenByPinId()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Hubs.GetGlobalHubs()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Hubs.Get-Recently-Added()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Hubs.GetLibraryHubs()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Search.PerformSearch()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Search.PerformVoiceSearch()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Search.GetSearchResults()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.GetFileHash()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Recently-Added-Library()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-All-Libraries()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Library-Details()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.DeleteLibrary()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Library-Items()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Library-Sections-All()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Refresh-Library-Metadata()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Search-Library()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Genres-Library()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Countries-Library()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Actors-Library()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Search-All-Libraries()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Media-Meta-Data()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Media-Arts()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Post-Media-Arts()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Get-Media-Posters()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.Post-Media-Poster()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.GetMetadataChildren()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Library.GetTopWatchedContent()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Watchlist.Get-Watch-List()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Log.LogLine()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Log.LogMultiLine()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Log.EnablePaperTrail()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.CreatePlaylist()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.GetPlaylists()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.GetPlaylist()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.DeletePlaylist()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.UpdatePlaylist()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.GetPlaylistContents()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.ClearPlaylistContents()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.AddPlaylistContents()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Playlists.UploadPlaylist()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Authentication.GetTransientToken()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Authentication.GetSourceConnectionInformation()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Authentication.GetTokenDetails()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Authentication.Post-Users-Sign-In-Data()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Statistics.GetStatistics()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Statistics.GetResourcesStatistics()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Statistics.GetBandwidthStatistics()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Sessions.GetSessions()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Sessions.GetSessionHistory()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Sessions.GetTranscodeSessions()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Sessions.StopTranscodeSession()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Updater.GetUpdateStatus()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Updater.CheckForUpdates()`: **Deleted** **Breaking** :warning:\n* `PlexApi.Users.Get-Users()`: **Deleted** **Breaking** :warning:\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 96b1d05..a5512f7 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -22,7 +22,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false go: - version: 0.25.0 + version: 0.26.0 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: PlexAPIError diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0fa2866..7942803 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.635.1 +speakeasyVersion: 1.636.3 sources: my-source: sourceNamespace: my-source @@ -9,26 +9,29 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787 - sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0 + sourceRevisionDigest: sha256:bc60551015634fd59475cf17983ca3aedcab591426d526ab1e3634b1feedaec1 + sourceBlobDigest: sha256:fc8cd5343a94564b646830738f38e065d61e2ea63e4a1383ce07533586889950 tags: - latest - - speakeasy-sdk-regen-1759795832 + - speakeasy-sdk-regen-1760248355 + - 1.1.1 targets: plexgo: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787 - sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0 + sourceRevisionDigest: sha256:bc60551015634fd59475cf17983ca3aedcab591426d526ab1e3634b1feedaec1 + sourceBlobDigest: sha256:fc8cd5343a94564b646830738f38e065d61e2ea63e4a1383ce07533586889950 codeSamplesNamespace: code-samples-go-plexgo - codeSamplesRevisionDigest: sha256:f5a86774481f3e1235a867167b1ae386f68f21ddfd77c07662ae7f91306f064e + codeSamplesRevisionDigest: sha256:661a20cdc0e343c05f51c94f3957daaf8a66fcae72913af90414116c8ae4d28c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest sources: plexapi: inputs: - - location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main + - location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/refs/heads/main/plex-api-spec.yaml + registry: + location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi targets: plexgo: target: go diff --git a/README.md b/README.md index 3db67f5..41b3f9b 100644 --- a/README.md +++ b/README.md @@ -10,41 +10,13 @@ ## Summary -Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server -# Plex Media Server OpenAPI Specification - -An Open Source OpenAPI Specification for Plex Media Server - -Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) - -## Documentation - -[API Documentation](https://plexapi.dev) - -## SDKs - -The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). - -| Language | Repository | Releases | Other | -| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | -| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | -| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | -| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | -| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | -| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | -| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | -| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | -| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - ## Table of Contents * [github.com/LukeHagar/plexgo](#githubcomlukehagarplexgo) -* [Plex Media Server OpenAPI Specification](#plex-media-server-openapi-specification) - * [Documentation](#documentation) - * [SDKs](#sdks) * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) * [Available Resources and Operations](#available-resources-and-operations) @@ -53,7 +25,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa * [Server Selection](#server-selection) * [Custom HTTP Client](#custom-http-client) * [Authentication](#authentication) - * [Special Types](#special-types) * [Development](#development) * [Maturity](#maturity) * [Contributions](#contributions) @@ -80,6 +51,8 @@ package main import ( "context" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -87,14 +60,55 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerCapabilities(ctx) + res, err := s.Transcoder.StartTranscodeSession(ctx, operations.StartTranscodeSessionRequest{ + TranscodeType: components.TranscodeTypeMusic, + Extension: operations.ExtensionMpd, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.StartTranscodeSessionQueryParamLocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.StartTranscodeSessionQueryParamProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.ResponseStream != nil { // handle response } } @@ -110,139 +124,324 @@ func main() { ### [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 - -### [Authentication](docs/sdks/authentication/README.md) - -* [GetTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token -* [GetSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information -* [GetTokenDetails](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details -* [PostUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data +* [ListActivities](docs/sdks/activities/README.md#listactivities) - Get all activities +* [CancelActivity](docs/sdks/activities/README.md#cancelactivity) - Cancel a running activity ### [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 +* [StopTasks](docs/sdks/butler/README.md#stoptasks) - Stop all Butler tasks +* [GetTasks](docs/sdks/butler/README.md#gettasks) - Get all Butler tasks +* [StartTasks](docs/sdks/butler/README.md#starttasks) - Start all Butler tasks * [StopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task +* [StartTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task + +### [Collections](docs/sdks/collections/README.md) + +* [CreateCollection](docs/sdks/collections/README.md#createcollection) - Create collection + +### [Content](docs/sdks/content/README.md) + +* [GetCollectionItems](docs/sdks/content/README.md#getcollectionitems) - Get items in a collection +* [GetMetadataItem](docs/sdks/content/README.md#getmetadataitem) - Get a metadata item +* [GetAlbums](docs/sdks/content/README.md#getalbums) - Set section albums +* [ListContent](docs/sdks/content/README.md#listcontent) - Get items in the section +* [GetAllLeaves](docs/sdks/content/README.md#getallleaves) - Set section leaves +* [GetArts](docs/sdks/content/README.md#getarts) - Set section artwork +* [GetCategories](docs/sdks/content/README.md#getcategories) - Set section categories +* [GetCluster](docs/sdks/content/README.md#getcluster) - Set section clusters +* [GetSonicPath](docs/sdks/content/README.md#getsonicpath) - Similar tracks to transition from one to another +* [GetFolders](docs/sdks/content/README.md#getfolders) - Get all folder locations +* [ListMoments](docs/sdks/content/README.md#listmoments) - Set section moments +* [GetSonicallySimilar](docs/sdks/content/README.md#getsonicallysimilar) - The nearest audio tracks +* [GetCollectionImage](docs/sdks/content/README.md#getcollectionimage) - Get a collection's image + +### [Devices](docs/sdks/devices/README.md) + +* [GetAvailableGrabbers](docs/sdks/devices/README.md#getavailablegrabbers) - Get available grabbers +* [ListDevices](docs/sdks/devices/README.md#listdevices) - Get all devices +* [AddDevice](docs/sdks/devices/README.md#adddevice) - Add a device +* [DiscoverDevices](docs/sdks/devices/README.md#discoverdevices) - Tell grabbers to discover devices +* [RemoveDevice](docs/sdks/devices/README.md#removedevice) - Remove a device +* [GetDeviceDetails](docs/sdks/devices/README.md#getdevicedetails) - Get device details +* [ModifyDevice](docs/sdks/devices/README.md#modifydevice) - Enable or disable a device +* [SetChannelmap](docs/sdks/devices/README.md#setchannelmap) - Set a device's channel mapping +* [GetDevicesChannels](docs/sdks/devices/README.md#getdeviceschannels) - Get a device's channels +* [SetDevicePreferences](docs/sdks/devices/README.md#setdevicepreferences) - Set device preferences +* [StopScan](docs/sdks/devices/README.md#stopscan) - Tell a device to stop scanning for channels +* [Scan](docs/sdks/devices/README.md#scan) - Tell a device to scan for channels +* [GetThumb](docs/sdks/devices/README.md#getthumb) - Get device thumb + +### [DownloadQueue](docs/sdks/downloadqueue/README.md) + +* [CreateDownloadQueue](docs/sdks/downloadqueue/README.md#createdownloadqueue) - Create download queue +* [GetDownloadQueue](docs/sdks/downloadqueue/README.md#getdownloadqueue) - Get a download queue +* [AddDownloadQueueItems](docs/sdks/downloadqueue/README.md#adddownloadqueueitems) - Add to download queue +* [ListDownloadQueueItems](docs/sdks/downloadqueue/README.md#listdownloadqueueitems) - Get download queue items +* [GetItemDecision](docs/sdks/downloadqueue/README.md#getitemdecision) - Grab download queue item decision +* [GetDownloadQueueMedia](docs/sdks/downloadqueue/README.md#getdownloadqueuemedia) - Grab download queue media +* [RemoveDownloadQueueItems](docs/sdks/downloadqueue/README.md#removedownloadqueueitems) - Delete download queue items +* [GetDownloadQueueItems](docs/sdks/downloadqueue/README.md#getdownloadqueueitems) - Get download queue items +* [RestartProcessingDownloadQueueItems](docs/sdks/downloadqueue/README.md#restartprocessingdownloadqueueitems) - Restart processing of items from the decision + +### [DVRs](docs/sdks/dvrs/README.md) + +* [ListDVRs](docs/sdks/dvrs/README.md#listdvrs) - Get DVRs +* [CreateDVR](docs/sdks/dvrs/README.md#createdvr) - Create a DVR +* [DeleteDVR](docs/sdks/dvrs/README.md#deletedvr) - Delete a single DVR +* [GetDVR](docs/sdks/dvrs/README.md#getdvr) - Get a single DVR +* [DeleteLineup](docs/sdks/dvrs/README.md#deletelineup) - Delete a DVR Lineup +* [AddLineup](docs/sdks/dvrs/README.md#addlineup) - Add a DVR Lineup +* [SetDVRPreferences](docs/sdks/dvrs/README.md#setdvrpreferences) - Set DVR preferences +* [StopDVRReload](docs/sdks/dvrs/README.md#stopdvrreload) - Tell a DVR to stop reloading program guide +* [ReloadGuide](docs/sdks/dvrs/README.md#reloadguide) - Tell a DVR to reload program guide +* [TuneChannel](docs/sdks/dvrs/README.md#tunechannel) - Tune a channel on a DVR +* [RemoveDeviceFromDVR](docs/sdks/dvrs/README.md#removedevicefromdvr) - Remove a device from an existing DVR +* [AddDeviceToDVR](docs/sdks/dvrs/README.md#adddevicetodvr) - Add a device to an existing DVR + +### [Epg](docs/sdks/epg/README.md) + +* [ComputeChannelMap](docs/sdks/epg/README.md#computechannelmap) - Compute the best channel map +* [GetChannels](docs/sdks/epg/README.md#getchannels) - Get channels for a lineup +* [GetCountries](docs/sdks/epg/README.md#getcountries) - Get all countries +* [GetAllLanguages](docs/sdks/epg/README.md#getalllanguages) - Get all languages +* [GetLineup](docs/sdks/epg/README.md#getlineup) - Compute the best lineup +* [GetLineupChannels](docs/sdks/epg/README.md#getlineupchannels) - Get the channels for mulitple lineups +* [GetCountriesLineups](docs/sdks/epg/README.md#getcountrieslineups) - Get lineups for a country via postal code +* [GetCountryRegions](docs/sdks/epg/README.md#getcountryregions) - Get regions for a country +* [ListLineups](docs/sdks/epg/README.md#listlineups) - Get lineups for a region + +### [Events](docs/sdks/events/README.md) + +* [GetNotifications](docs/sdks/events/README.md#getnotifications) - Connect to Eventsource +* [ConnectWebSocket](docs/sdks/events/README.md#connectwebsocket) - Connect to WebSocket + +### [General](docs/sdks/general/README.md) + +* [GetServerInfo](docs/sdks/general/README.md#getserverinfo) - Get PMS info +* [GetIdentity](docs/sdks/general/README.md#getidentity) - Get PMS identity +* [GetSourceConnectionInformation](docs/sdks/general/README.md#getsourceconnectioninformation) - Get Source Connection Information +* [GetTransientToken](docs/sdks/general/README.md#gettransienttoken) - Get Transient Tokens ### [Hubs](docs/sdks/hubs/README.md) -* [GetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs -* [GetRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added -* [GetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs +* [GetAllHubs](docs/sdks/hubs/README.md#getallhubs) - Get global hubs +* [GetContinueWatching](docs/sdks/hubs/README.md#getcontinuewatching) - Get the continue watching hub +* [GetHubItems](docs/sdks/hubs/README.md#gethubitems) - Get a hub's items +* [GetPromotedHubs](docs/sdks/hubs/README.md#getpromotedhubs) - Get the hubs which are promoted +* [GetMetadataHubs](docs/sdks/hubs/README.md#getmetadatahubs) - Get hubs for section by metadata item +* [GetPostplayHubs](docs/sdks/hubs/README.md#getpostplayhubs) - Get postplay hubs +* [GetRelatedHubs](docs/sdks/hubs/README.md#getrelatedhubs) - Get related hubs +* [GetSectionHubs](docs/sdks/hubs/README.md#getsectionhubs) - Get section hubs +* [ResetSectionDefaults](docs/sdks/hubs/README.md#resetsectiondefaults) - Reset hubs to defaults +* [ListHubs](docs/sdks/hubs/README.md#listhubs) - Get hubs +* [CreateCustomHub](docs/sdks/hubs/README.md#createcustomhub) - Create a custom hub +* [MoveHub](docs/sdks/hubs/README.md#movehub) - Move Hub +* [DeleteCustomHub](docs/sdks/hubs/README.md#deletecustomhub) - Delete a custom hub +* [UpdateHubVisibility](docs/sdks/hubs/README.md#updatehubvisibility) - Change hub visibility ### [Library](docs/sdks/library/README.md) -* [GetFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value -* [GetRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added -* [GetAllLibraries](docs/sdks/library/README.md#getalllibraries) - Get All Libraries -* [GetLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details -* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section -* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items -* [GetLibrarySectionsAll](docs/sdks/library/README.md#getlibrarysectionsall) - Get Library section media by tag ALL -* [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library -* [GetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library -* [GetGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media -* [GetCountriesLibrary](docs/sdks/library/README.md#getcountrieslibrary) - Get Countries of library media -* [GetActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media -* [GetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries -* [GetMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata -* [GetMediaArts](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork -* [PostMediaArts](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork -* [GetMediaPosters](docs/sdks/library/README.md#getmediaposters) - Get Media Posters -* [PostMediaPoster](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster -* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children -* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content +* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get all items in library +* [DeleteCaches](docs/sdks/library/README.md#deletecaches) - Delete library caches +* [CleanBundles](docs/sdks/library/README.md#cleanbundles) - Clean bundles +* [IngestTransientItem](docs/sdks/library/README.md#ingesttransientitem) - Ingest a transient item +* [GetLibraryMatches](docs/sdks/library/README.md#getlibrarymatches) - Get library matches +* [OptimizeDatabase](docs/sdks/library/README.md#optimizedatabase) - Optimize the Database +* [GetRandomArtwork](docs/sdks/library/README.md#getrandomartwork) - Get random artwork +* [GetSections](docs/sdks/library/README.md#getsections) - Get library sections (main Media Provider Only) +* [AddSection](docs/sdks/library/README.md#addsection) - Add a library section +* [StopAllRefreshes](docs/sdks/library/README.md#stopallrefreshes) - Stop refresh +* [GetSectionsPrefs](docs/sdks/library/README.md#getsectionsprefs) - Get section prefs +* [RefreshSectionsMetadata](docs/sdks/library/README.md#refreshsectionsmetadata) - Refresh all sections +* [GetTags](docs/sdks/library/README.md#gettags) - Get all library tags of a type +* [DeleteMetadataItem](docs/sdks/library/README.md#deletemetadataitem) - Delete a metadata item +* [EditMetadataItem](docs/sdks/library/README.md#editmetadataitem) - Edit a metadata item +* [DetectAds](docs/sdks/library/README.md#detectads) - Ad-detect an item +* [GetAllItemLeaves](docs/sdks/library/README.md#getallitemleaves) - Get the leaves of an item +* [AnalyzeMetadata](docs/sdks/library/README.md#analyzemetadata) - Analyze an item +* [GenerateThumbs](docs/sdks/library/README.md#generatethumbs) - Generate thumbs of chapters for an item +* [DetectCredits](docs/sdks/library/README.md#detectcredits) - Credit detect a metadata item +* [GetExtras](docs/sdks/library/README.md#getextras) - Get an item's extras +* [AddExtras](docs/sdks/library/README.md#addextras) - Add to an item's extras +* [GetFile](docs/sdks/library/README.md#getfile) - Get a file from a metadata or media bundle +* [StartBifGeneration](docs/sdks/library/README.md#startbifgeneration) - Start BIF generation of an item +* [DetectIntros](docs/sdks/library/README.md#detectintros) - Intro detect an item +* [CreateMarker](docs/sdks/library/README.md#createmarker) - Create a marker +* [MatchItem](docs/sdks/library/README.md#matchitem) - Match a metadata item +* [ListMatches](docs/sdks/library/README.md#listmatches) - Get metadata matches for an item +* [MergeItems](docs/sdks/library/README.md#mergeitems) - Merge a metadata item +* [ListSonicallySimilar](docs/sdks/library/README.md#listsonicallysimilar) - Get nearest tracks to metadata item +* [SetItemPreferences](docs/sdks/library/README.md#setitempreferences) - Set metadata preferences +* [RefreshItemsMetadata](docs/sdks/library/README.md#refreshitemsmetadata) - Refresh a metadata item +* [GetRelatedItems](docs/sdks/library/README.md#getrelateditems) - Get related items +* [ListSimilar](docs/sdks/library/README.md#listsimilar) - Get similar items +* [SplitItem](docs/sdks/library/README.md#splititem) - Split a metadata item +* [AddSubtitles](docs/sdks/library/README.md#addsubtitles) - Add subtitles +* [GetItemTree](docs/sdks/library/README.md#getitemtree) - Get metadata items as a tree +* [Unmatch](docs/sdks/library/README.md#unmatch) - Unmatch a metadata item +* [ListTopUsers](docs/sdks/library/README.md#listtopusers) - Get metadata top users +* [DetectVoiceActivity](docs/sdks/library/README.md#detectvoiceactivity) - Detect voice activity +* [GetAugmentationStatus](docs/sdks/library/README.md#getaugmentationstatus) - Get augmentation status +* [SetStreamSelection](docs/sdks/library/README.md#setstreamselection) - Set stream selection +* [GetPerson](docs/sdks/library/README.md#getperson) - Get person details +* [ListPersonMedia](docs/sdks/library/README.md#listpersonmedia) - Get media for a person +* [DeleteLibrarySection](docs/sdks/library/README.md#deletelibrarysection) - Delete a library section +* [GetLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get a library section by id +* [EditSection](docs/sdks/library/README.md#editsection) - Edit a library section +* [UpdateItems](docs/sdks/library/README.md#updateitems) - Set the fields of the filtered items +* [StartAnalysis](docs/sdks/library/README.md#startanalysis) - Analyze a section +* [Autocomplete](docs/sdks/library/README.md#autocomplete) - Get autocompletions for search +* [GetCollections](docs/sdks/library/README.md#getcollections) - Get collections in a section +* [GetCommon](docs/sdks/library/README.md#getcommon) - Get common fields for items +* [EmptyTrash](docs/sdks/library/README.md#emptytrash) - Empty section trash +* [GetSectionFilters](docs/sdks/library/README.md#getsectionfilters) - Get section filters +* [GetFirstCharacters](docs/sdks/library/README.md#getfirstcharacters) - Get list of first characters +* [DeleteIndexes](docs/sdks/library/README.md#deleteindexes) - Delete section indexes +* [DeleteIntros](docs/sdks/library/README.md#deleteintros) - Delete section intro markers +* [GetSectionPreferences](docs/sdks/library/README.md#getsectionpreferences) - Get section prefs +* [SetSectionPreferences](docs/sdks/library/README.md#setsectionpreferences) - Set section prefs +* [CancelRefresh](docs/sdks/library/README.md#cancelrefresh) - Cancel section refresh +* [RefreshSection](docs/sdks/library/README.md#refreshsection) - Refresh section +* [GetAvailableSorts](docs/sdks/library/README.md#getavailablesorts) - Get a section sorts +* [GetStreamLevels](docs/sdks/library/README.md#getstreamlevels) - Get loudness about a stream in json +* [GetStreamLoudness](docs/sdks/library/README.md#getstreamloudness) - Get loudness about a stream +* [GetChapterImage](docs/sdks/library/README.md#getchapterimage) - Get a chapter image +* [SetItemArtwork](docs/sdks/library/README.md#setitemartwork) - Set an item's artwork, theme, etc +* [UpdateItemArtwork](docs/sdks/library/README.md#updateitemartwork) - Set an item's artwork, theme, etc +* [DeleteMarker](docs/sdks/library/README.md#deletemarker) - Delete a marker +* [EditMarker](docs/sdks/library/README.md#editmarker) - Edit a marker +* [DeleteMediaItem](docs/sdks/library/README.md#deletemediaitem) - Delete a media item +* [GetPartIndex](docs/sdks/library/README.md#getpartindex) - Get BIF index for a part +* [DeleteCollection](docs/sdks/library/README.md#deletecollection) - Delete a collection +* [GetSectionImage](docs/sdks/library/README.md#getsectionimage) - Get a section composite image +* [DeleteStream](docs/sdks/library/README.md#deletestream) - Delete a stream +* [GetStream](docs/sdks/library/README.md#getstream) - Get a stream +* [SetStreamOffset](docs/sdks/library/README.md#setstreamoffset) - Set a stream offset +* [GetItemArtwork](docs/sdks/library/README.md#getitemartwork) - Get an item's artwork, theme, etc +* [GetMediaPart](docs/sdks/library/README.md#getmediapart) - Get a media part +* [GetImageFromBif](docs/sdks/library/README.md#getimagefrombif) - Get an image from part BIF + +### [LibraryCollections](docs/sdks/librarycollections/README.md) + +* [AddCollectionItems](docs/sdks/librarycollections/README.md#addcollectionitems) - Add items to a collection +* [DeleteCollectionItem](docs/sdks/librarycollections/README.md#deletecollectionitem) - Delete an item from a collection +* [MoveCollectionItem](docs/sdks/librarycollections/README.md#movecollectionitem) - Reorder an item in the collection + +### [LibraryPlaylists](docs/sdks/libraryplaylists/README.md) + +* [CreatePlaylist](docs/sdks/libraryplaylists/README.md#createplaylist) - Create a Playlist +* [UploadPlaylist](docs/sdks/libraryplaylists/README.md#uploadplaylist) - Upload +* [DeletePlaylist](docs/sdks/libraryplaylists/README.md#deleteplaylist) - Delete a Playlist +* [UpdatePlaylist](docs/sdks/libraryplaylists/README.md#updateplaylist) - Editing a Playlist +* [GetPlaylistGenerators](docs/sdks/libraryplaylists/README.md#getplaylistgenerators) - Get a playlist's generators +* [ClearPlaylistItems](docs/sdks/libraryplaylists/README.md#clearplaylistitems) - Clearing a playlist +* [AddPlaylistItems](docs/sdks/libraryplaylists/README.md#addplaylistitems) - Adding to a Playlist +* [DeletePlaylistItem](docs/sdks/libraryplaylists/README.md#deleteplaylistitem) - Delete a Generator +* [GetPlaylistGenerator](docs/sdks/libraryplaylists/README.md#getplaylistgenerator) - Get a playlist generator +* [ModifyPlaylistGenerator](docs/sdks/libraryplaylists/README.md#modifyplaylistgenerator) - Modify a Generator +* [GetPlaylistGeneratorItems](docs/sdks/libraryplaylists/README.md#getplaylistgeneratoritems) - Get a playlist generator's items +* [MovePlaylistItem](docs/sdks/libraryplaylists/README.md#moveplaylistitem) - Moving items in a playlist +* [RefreshPlaylist](docs/sdks/libraryplaylists/README.md#refreshplaylist) - Reprocess a generator + +### [LiveTV](docs/sdks/livetv/README.md) + +* [GetSessions](docs/sdks/livetv/README.md#getsessions) - Get all sessions +* [GetLiveTVSession](docs/sdks/livetv/README.md#getlivetvsession) - Get a single session +* [GetSessionPlaylistIndex](docs/sdks/livetv/README.md#getsessionplaylistindex) - Get a session playlist index +* [GetSessionSegment](docs/sdks/livetv/README.md#getsessionsegment) - Get a single session segment ### [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 +* [WriteLog](docs/sdks/log/README.md#writelog) - Logging a multi-line message to the Plex Media Server log +* [WriteMessage](docs/sdks/log/README.md#writemessage) - Logging a single-line message to the Plex Media Server log +* [EnablePapertrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail -### [Media](docs/sdks/media/README.md) +### [Playlist](docs/sdks/playlist/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 -* [GetBannerImage](docs/sdks/media/README.md#getbannerimage) - Get Banner Image -* [GetThumbImage](docs/sdks/media/README.md#getthumbimage) - Get Thumb Image +* [ListPlaylists](docs/sdks/playlist/README.md#listplaylists) - List playlists +* [GetPlaylist](docs/sdks/playlist/README.md#getplaylist) - Retrieve Playlist +* [GetPlaylistItems](docs/sdks/playlist/README.md#getplaylistitems) - Retrieve Playlist Contents -### [Playlists](docs/sdks/playlists/README.md) +### [PlayQueue](docs/sdks/playqueue/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 +* [CreatePlayQueue](docs/sdks/playqueue/README.md#createplayqueue) - Create a play queue +* [GetPlayQueue](docs/sdks/playqueue/README.md#getplayqueue) - Retrieve a play queue +* [AddToPlayQueue](docs/sdks/playqueue/README.md#addtoplayqueue) - Add a generator or playlist to a play queue +* [ClearPlayQueue](docs/sdks/playqueue/README.md#clearplayqueue) - Clear a play queue +* [ResetPlayQueue](docs/sdks/playqueue/README.md#resetplayqueue) - Reset a play queue +* [Shuffle](docs/sdks/playqueue/README.md#shuffle) - Shuffle a play queue +* [Unshuffle](docs/sdks/playqueue/README.md#unshuffle) - Unshuffle a play queue +* [DeletePlayQueueItem](docs/sdks/playqueue/README.md#deleteplayqueueitem) - Delete an item from a play queue +* [MovePlayQueueItem](docs/sdks/playqueue/README.md#moveplayqueueitem) - Move an item in a play queue -### [Plex](docs/sdks/plex/README.md) +### [Preferences](docs/sdks/preferences/README.md) -* [GetCompanionsData](docs/sdks/plex/README.md#getcompanionsdata) - Get Companions Data -* [GetUserFriends](docs/sdks/plex/README.md#getuserfriends) - Get list of friends of the user logged in -* [GetGeoData](docs/sdks/plex/README.md#getgeodata) - Get Geo Data -* [GetHomeData](docs/sdks/plex/README.md#gethomedata) - Get Plex Home Data -* [GetServerResources](docs/sdks/plex/README.md#getserverresources) - Get Server Resources -* [GetPin](docs/sdks/plex/README.md#getpin) - Get a Pin -* [GetTokenByPinID](docs/sdks/plex/README.md#gettokenbypinid) - Get Access Token by PinId +* [GetAllPreferences](docs/sdks/preferences/README.md#getallpreferences) - Get all preferences +* [SetPreferences](docs/sdks/preferences/README.md#setpreferences) - Set preferences +* [GetPreference](docs/sdks/preferences/README.md#getpreference) - Get a preferences +### [Provider](docs/sdks/provider/README.md) + +* [ListProviders](docs/sdks/provider/README.md#listproviders) - Get the list of available media providers +* [AddProvider](docs/sdks/provider/README.md#addprovider) - Add a media provider +* [RefreshProviders](docs/sdks/provider/README.md#refreshproviders) - Refresh media providers +* [DeleteMediaProvider](docs/sdks/provider/README.md#deletemediaprovider) - Delete a media provider + +### [Rate](docs/sdks/rate/README.md) + +* [SetRating](docs/sdks/rate/README.md#setrating) - Rate an item ### [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 +* [SearchHubs](docs/sdks/search/README.md#searchhubs) - Search Hub +* [VoiceSearchHubs](docs/sdks/search/README.md#voicesearchhubs) - Voice Search Hub -### [Server](docs/sdks/server/README.md) +### [Status](docs/sdks/status/README.md) -* [GetServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get 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 -* [GetMediaProviders](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers -* [GetServerList](docs/sdks/server/README.md#getserverlist) - Get Server List +* [ListSessions](docs/sdks/status/README.md#listsessions) - List Sessions +* [GetBackgroundTasks](docs/sdks/status/README.md#getbackgroundtasks) - Get background tasks +* [ListPlaybackHistory](docs/sdks/status/README.md#listplaybackhistory) - List Playback History +* [TerminateSession](docs/sdks/status/README.md#terminatesession) - Terminate a session +* [DeleteHistory](docs/sdks/status/README.md#deletehistory) - Delete Single History Item +* [GetHistoryItem](docs/sdks/status/README.md#gethistoryitem) - Get Single History Item -### [Sessions](docs/sdks/sessions/README.md) +### [Subscriptions](docs/sdks/subscriptions/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 +* [GetAllSubscriptions](docs/sdks/subscriptions/README.md#getallsubscriptions) - Get all subscriptions +* [CreateSubscription](docs/sdks/subscriptions/README.md#createsubscription) - Create a subscription +* [ProcessSubscriptions](docs/sdks/subscriptions/README.md#processsubscriptions) - Process all subscriptions +* [GetScheduledRecordings](docs/sdks/subscriptions/README.md#getscheduledrecordings) - Get all scheduled recordings +* [GetTemplate](docs/sdks/subscriptions/README.md#gettemplate) - Get the subscription template +* [CancelGrab](docs/sdks/subscriptions/README.md#cancelgrab) - Cancel an existing grab +* [DeleteSubscription](docs/sdks/subscriptions/README.md#deletesubscription) - Delete a subscription +* [GetSubscription](docs/sdks/subscriptions/README.md#getsubscription) - Get a single subscription +* [EditSubscriptionPreferences](docs/sdks/subscriptions/README.md#editsubscriptionpreferences) - Edit a subscription +* [ReorderSubscription](docs/sdks/subscriptions/README.md#reordersubscription) - Re-order a subscription -### [Statistics](docs/sdks/statistics/README.md) +### [Timeline](docs/sdks/timeline/README.md) -* [GetStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics -* [GetResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics -* [GetBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics +* [MarkPlayed](docs/sdks/timeline/README.md#markplayed) - Mark an item as played +* [Report](docs/sdks/timeline/README.md#report) - Report media timeline +* [Unscrobble](docs/sdks/timeline/README.md#unscrobble) - Mark an item as unplayed + +### [Transcoder](docs/sdks/transcoder/README.md) + +* [TranscodeImage](docs/sdks/transcoder/README.md#transcodeimage) - Transcode an image +* [MakeDecision](docs/sdks/transcoder/README.md#makedecision) - Make a decision on media playback +* [TriggerFallback](docs/sdks/transcoder/README.md#triggerfallback) - Manually trigger a transcoder fallback +* [TranscodeSubtitles](docs/sdks/transcoder/README.md#transcodesubtitles) - Transcode subtitles +* [StartTranscodeSession](docs/sdks/transcoder/README.md#starttranscodesession) - Start A Transcoding Session + +### [UltraBlur](docs/sdks/ultrablur/README.md) + +* [GetColors](docs/sdks/ultrablur/README.md#getcolors) - Get UltraBlur Colors +* [GetImage](docs/sdks/ultrablur/README.md#getimage) - Get UltraBlur Image ### [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 - -### [Users](docs/sdks/users/README.md) - -* [GetUsers](docs/sdks/users/README.md#getusers) - Get list of all connected users - -### [Video](docs/sdks/video/README.md) - -* [GetTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item -* [StartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode - -### [Watchlist](docs/sdks/watchlist/README.md) - -* [GetWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist +* [ApplyUpdates](docs/sdks/updater/README.md#applyupdates) - Applying updates +* [CheckUpdates](docs/sdks/updater/README.md#checkupdates) - Checking for updates +* [GetUpdatesStatus](docs/sdks/updater/README.md#getupdatesstatus) - Querying status of updates @@ -259,6 +458,8 @@ package main import ( "context" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/retry" "log" "models/operations" @@ -268,10 +469,21 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerCapabilities(ctx, operations.WithRetries( + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}, operations.WithRetries( retry.Config{ Strategy: "backoff", Backoff: &retry.BackoffStrategy{ @@ -285,7 +497,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithDirectory != nil { // handle response } } @@ -299,6 +511,8 @@ package main import ( "context" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/retry" "log" ) @@ -318,14 +532,25 @@ func main() { }, RetryConnectionErrors: false, }), + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerCapabilities(ctx) + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithDirectory != nil { // handle response } } @@ -340,13 +565,11 @@ Handling errors in this SDK should largely match your expectations. All operatio By Default, an API error will return `sdkerrors.SDKError`. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. -For example, the `GetServerCapabilities` function may return the following errors: +For example, the `GetServerInfo` function may return the following errors: -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ----------- | ---------------- | -| sdkerrors.GetServerCapabilitiesBadRequest | 400 | application/json | -| sdkerrors.GetServerCapabilitiesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ----------- | ------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ### Example @@ -357,6 +580,8 @@ import ( "context" "errors" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/sdkerrors" "log" ) @@ -365,24 +590,23 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerCapabilities(ctx) + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) if err != nil { - var e *sdkerrors.GetServerCapabilitiesBadRequest - if errors.As(err, &e) { - // handle error - log.Fatal(e.Error()) - } - - var e *sdkerrors.GetServerCapabilitiesUnauthorized - if errors.As(err, &e) { - // handle error - log.Fatal(e.Error()) - } - var e *sdkerrors.SDKError if errors.As(err, &e) { // handle error @@ -397,15 +621,26 @@ func main() { ## Server Selection -### Server Variables +### Select Server by Index -The default server `{protocol}://{ip}:{port}` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following options are available when initializing the SDK client instance: +You can override the default server globally using the `WithServerIndex(serverIndex int)` 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: -| Variable | Option | Supported Values | Default | Description | -| ---------- | --------------------------------------- | -------------------------- | --------------- | ---------------------------------------------- | -| `protocol` | `WithProtocol(protocol ServerProtocol)` | - `"http"`
- `"https"` | `"https"` | The protocol to use for the server connection | -| `ip` | `WithIP(ip string)` | string | `"10.10.10.47"` | The IP address or hostname of your Plex Server | -| `port` | `WithPort(port string)` | string | `"32400"` | The port of your Plex Server | +| # | Server | Variables | Description | +| --- | ---------------------------------------------------------- | -------------------------------------------- | ----------- | +| 0 | `https://{IP-description}.{identifier}.plex.direct:{port}` | `identifier`
`IP-description`
`port` | | +| 1 | `{protocol}://{host}:{port}` | `protocol`
`host`
`port` | | +| 2 | `https://{server_url}` | `server_url` | | + +If the selected server has variables, you may override its default values using the associated option(s): + +| Variable | Option | Default | Description | +| ---------------- | ----------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `identifier` | `WithIdentifier(identifier string)` | `"0123456789abcdef0123456789abcdef"` | The unique identifier of this particular PMS | +| `IP-description` | `WithIPDescription(ipDescription string)` | `"1-2-3-4"` | A `-` separated string of the IPv4 or IPv6 address components | +| `port` | `WithPort(port string)` | `"32400"` | The Port number configured on the PMS. Typically (`32400`).
If using a reverse proxy, this would be the port number configured on the proxy.
| +| `protocol` | `WithProtocol(protocol string)` | `"http"` | The network protocol to use. Typically (`http` or `https`) | +| `host` | `WithHost(host string)` | `"localhost"` | The Host of the PMS.
If using on a local network, this is the internal IP address of the server hosting the PMS.
If using on an external network, this is the external IP address for your network, and requires port forwarding.
If using a reverse proxy, this would be the external DNS domain for your network, and requires the proxy handle port forwarding.
| +| `server_url` | `WithGlobalServerURL(serverURL string)` | `"http://localhost:32400"` | The full manual URL to access the PMS | #### Example @@ -415,70 +650,7 @@ package main import ( "context" "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithProtocol("https"), - plexgo.WithIP("4982:bc2a:b4f8:efb5:2394:5bc3:ab4f:0e6d"), - plexgo.WithPort("44765"), - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetServerCapabilities(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } -} - -``` - -### Override Server URL Per-Client - -The default server can be overridden globally using the `WithServerURL(serverURL string)` option when initializing the SDK client instance. For example: -```go -package main - -import ( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithServerURL("https://10.10.10.47:32400"), - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetServerCapabilities(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } -} - -``` - -### Override Server URL Per-Operation - -The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example: -```go -package main - -import ( - "context" - "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -487,14 +659,73 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithServerIndex(1), + plexgo.WithProtocol(""), + plexgo.WithHost("electric-excess.name"), + plexgo.WithPort("36393"), + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Plex.GetCompanionsData(ctx, operations.WithServerURL("https://plex.tv/api/v2")) + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) if err != nil { log.Fatal(err) } - if res.ResponseBodies != nil { + if res.MediaContainerWithDirectory != nil { + // handle response + } +} + +``` + +### Override Server URL Per-Client + +The default server can also be overridden globally using the `WithServerURL(serverURL string)` option when initializing the SDK client instance. For example: +```go +package main + +import ( + "context" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithServerURL("https://http://localhost:32400"), + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDirectory != nil { // handle response } } @@ -539,9 +770,9 @@ This can be a convenient way to configure timeouts, cookies, proxies, custom hea This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------- | ------ | ------- | -| `AccessToken` | apiKey | API key | +| Name | Type | Scheme | +| ------- | ------ | ------- | +| `Token` | apiKey | API key | You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example: ```go @@ -550,6 +781,8 @@ package main import ( "context" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -558,13 +791,24 @@ func main() { s := plexgo.New( plexgo.WithSecurity(""), + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), ) - res, err := s.Server.GetServerCapabilities(ctx) + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithDirectory != nil { // handle response } } @@ -572,32 +816,6 @@ func main() { ``` - -## Special Types - -This SDK defines the following custom types to assist with marshalling and unmarshalling data. - -### Date - -`types.Date` is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". - -#### Usage - -```go -d1 := types.NewDate(time.Now()) // returns *types.Date - -d2 := types.DateFromTime(time.Now()) // returns types.Date - -d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error - -d4, err := types.DateFromString("2019-01-01") // returns types.Date, error - -d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error - -d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error -``` - - # Development diff --git a/RELEASES.md b/RELEASES.md index 5e3b772..bf44960 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1212,4 +1212,14 @@ Based on: ### Generated - [go v0.25.0] . ### Releases -- [Go v0.25.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.25.0 - . \ No newline at end of file +- [Go v0.25.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.25.0 - . + +## 2025-10-12 05:52:17 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.636.3 (2.723.11) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.26.0] . +### Releases +- [Go v0.26.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.26.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 70f78b3..8637b9f 100644 --- a/USAGE.md +++ b/USAGE.md @@ -5,6 +5,8 @@ package main import ( "context" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -12,14 +14,55 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerCapabilities(ctx) + res, err := s.Transcoder.StartTranscodeSession(ctx, operations.StartTranscodeSessionRequest{ + TranscodeType: components.TranscodeTypeMusic, + Extension: operations.ExtensionMpd, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.StartTranscodeSessionQueryParamLocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.StartTranscodeSessionQueryParamProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.ResponseStream != nil { // handle response } } diff --git a/activities.go b/activities.go index d8d8cf3..c980104 100644 --- a/activities.go +++ b/activities.go @@ -16,13 +16,11 @@ import ( "net/url" ) -// 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 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 are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. type Activities struct { rootSDK *PlexAPI sdkConfiguration config.SDKConfiguration @@ -37,9 +35,9 @@ func newActivities(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *h } } -// GetServerActivities - Get Server Activities -// Get Server Activities -func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations.Option) (*operations.GetServerActivitiesResponse, error) { +// ListActivities - Get all activities +// List all activities on the server. Admins can see all activities but other users can only see their own +func (s *Activities) ListActivities(ctx context.Context, opts ...operations.Option) (*operations.ListActivitiesResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -68,8 +66,8 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getServerActivities", - OAuth2Scopes: []string{}, + OperationID: "listActivities", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -175,7 +173,7 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -190,7 +188,7 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations } } - res := &operations.GetServerActivitiesResponse{ + res := &operations.ListActivitiesResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -205,7 +203,7 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations return nil, err } - var out operations.GetServerActivitiesResponseBody + var out operations.ListActivitiesResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -218,50 +216,6 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerActivitiesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerActivitiesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -286,11 +240,21 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations } -// CancelServerActivities - Cancel Server Activities -// Cancel Server Activities -func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string, opts ...operations.Option) (*operations.CancelServerActivitiesResponse, error) { - request := operations.CancelServerActivitiesRequest{ - ActivityUUID: activityUUID, +// CancelActivity - Cancel a running activity +// Cancel a running activity. Admins can cancel all activities but other users can only cancel their own +func (s *Activities) CancelActivity(ctx context.Context, request operations.CancelActivityRequest, opts ...operations.Option) (*operations.CancelActivityResponse, error) { + globals := operations.CancelActivityGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -311,7 +275,7 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityId}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -321,8 +285,8 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "cancelServerActivities", - OAuth2Scopes: []string{}, + OperationID: "cancelActivity", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -341,9 +305,11 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + utils.PopulateHeaders(ctx, req, request, globals) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -428,7 +394,7 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -443,7 +409,7 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st } } - res := &operations.CancelServerActivitiesResponse{ + res := &operations.CancelActivityResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -452,49 +418,9 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st switch { case httpRes.StatusCode == 200: case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.CancelServerActivitiesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.CancelServerActivitiesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + fallthrough + case httpRes.StatusCode == 404: + fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/authentication.go b/authentication.go deleted file mode 100644 index 8da3c31..0000000 --- a/authentication.go +++ /dev/null @@ -1,1009 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Authentication - API Calls regarding authentication for Plex Media Server -type Authentication struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newAuthentication(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Authentication { - return &Authentication{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// 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 *Authentication) GetTransientToken(ctx context.Context, type_ operations.GetTransientTokenQueryParamType, scope operations.Scope, opts ...operations.Option) (*operations.GetTransientTokenResponse, error) { - request := operations.GetTransientTokenRequest{ - Type: type_, - Scope: scope, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/security/token") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getTransientToken", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTransientTokenResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTransientTokenBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTransientTokenUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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 *Authentication) GetSourceConnectionInformation(ctx context.Context, source string, opts ...operations.Option) (*operations.GetSourceConnectionInformationResponse, error) { - request := operations.GetSourceConnectionInformationRequest{ - Source: source, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/security/resources") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getSourceConnectionInformation", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetSourceConnectionInformationResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSourceConnectionInformationBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSourceConnectionInformationUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetTokenDetails - Get Token Details -// Get the User data from the provided X-Plex-Token -func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations.Option) (*operations.GetTokenDetailsResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetTokenDetailsServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/user") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getTokenDetails", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTokenDetailsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetTokenDetailsUserPlexAccount - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.UserPlexAccount = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTokenDetailsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTokenDetailsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// PostUsersSignInData - Get User Sign In Data -// Sign in user with username and password and return user data with Plex authentication token -func (s *Authentication) PostUsersSignInData(ctx context.Context, request operations.PostUsersSignInDataRequest, opts ...operations.Option) (*operations.PostUsersSignInDataResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.PostUsersSignInDataServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/users/signin") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "post-users-sign-in-data", - OAuth2Scopes: []string{}, - SecuritySource: nil, - } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "form", `request:"mediaType=application/x-www-form-urlencoded"`) - if err != nil { - return nil, err - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) - 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 reqContentType != "" { - req.Header.Set("Content-Type", reqContentType) - } - - utils.PopulateHeaders(ctx, req, request, nil) - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.PostUsersSignInDataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.PostUsersSignInDataUserPlexAccount - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.UserPlexAccount = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.PostUsersSignInDataBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.PostUsersSignInDataUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/butler.go b/butler.go index 9fd8279..d36b937 100644 --- a/butler.go +++ b/butler.go @@ -16,7 +16,7 @@ import ( "net/url" ) -// Butler is the task manager of the Plex Media Server Ecosystem. +// Butler - The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks. type Butler struct { rootSDK *PlexAPI sdkConfiguration config.SDKConfiguration @@ -31,9 +31,9 @@ func newButler(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks } } -// GetButlerTasks - Get Butler tasks -// Returns a list of butler tasks -func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) (*operations.GetButlerTasksResponse, error) { +// StopTasks - Stop all Butler tasks +// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. +func (s *Butler) StopTasks(ctx context.Context, opts ...operations.Option) (*operations.StopTasksResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -62,8 +62,193 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getButlerTasks", - OAuth2Scopes: []string{}, + OperationID: "stopTasks", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StopTasksResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetTasks - Get all Butler tasks +// Get the list of butler tasks and their scheduling +func (s *Butler) GetTasks(ctx context.Context, opts ...operations.Option) (*operations.GetTasksResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/butler") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getTasks", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -169,7 +354,7 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -184,7 +369,7 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) } } - res := &operations.GetButlerTasksResponse{ + res := &operations.GetTasksResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -199,7 +384,7 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) return nil, err } - var out operations.GetButlerTasksResponseBody + var out operations.GetTasksResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -212,50 +397,6 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetButlerTasksBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetButlerTasksUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -280,13 +421,14 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) } -// StartAllTasks - Start all Butler tasks +// StartTasks - 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, opts ...operations.Option) (*operations.StartAllTasksResponse, error) { +// +// 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) StartTasks(ctx context.Context, opts ...operations.Option) (*operations.StartTasksResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -315,8 +457,8 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) ( SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "startAllTasks", - OAuth2Scopes: []string{}, + OperationID: "startTasks", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -335,7 +477,7 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) ( if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { @@ -422,7 +564,7 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) ( _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -437,7 +579,7 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) ( } } - res := &operations.StartAllTasksResponse{ + res := &operations.StartTasksResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -445,518 +587,6 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) ( switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StartAllTasksBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StartAllTasksUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.StopAllTasksResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/butler") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "stopAllTasks", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.StopAllTasksResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StopAllTasksBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StopAllTasksUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.StartTaskResponse, error) { - request := operations.StartTaskRequest{ - TaskName: taskName, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "startTask", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.StartTaskResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - fallthrough - case httpRes.StatusCode == 202: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StartTaskBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StartTaskUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -982,10 +612,20 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op } // 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, opts ...operations.Option) (*operations.StopTaskResponse, error) { - request := operations.StopTaskRequest{ - TaskName: taskName, +// This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists +func (s *Butler) StopTask(ctx context.Context, request operations.StopTaskRequest, opts ...operations.Option) (*operations.StopTaskResponse, error) { + globals := operations.StopTaskGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -1006,7 +646,7 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{task}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1017,7 +657,7 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask BaseURL: baseURL, Context: ctx, OperationID: "stopTask", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1036,9 +676,11 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + utils.PopulateHeaders(ctx, req, request, globals) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -1123,7 +765,7 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1146,50 +788,211 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StopTaskBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StopTaskUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StartTask - Start a single Butler task +// This endpoint will attempt to start a specific Butler task by name. +func (s *Butler) StartTask(ctx context.Context, request operations.StartTaskRequest, opts ...operations.Option) (*operations.StartTaskResponse, error) { + globals := operations.StartTaskGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{task}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "startTask", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StartTaskResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + fallthrough + case httpRes.StatusCode == 202: case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: diff --git a/codeSamples.yaml b/codeSamples.yaml index 0bcdc18..954cb23 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -13,7 +13,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -21,14 +23,67 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerCapabilities(ctx) + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithDirectory != nil { + // handle response + } + } + - target: $["paths"]["/:/eventsource/notifications"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Events.GetNotifications(ctx, operations.GetNotificationsRequest{}) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != nil { // handle response } } @@ -53,73 +108,15 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerPreferences(ctx) + res, err := s.Preferences.GetAllPreferences(ctx) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithSettings != nil { // handle response } } - - target: $["paths"]["/:/progress"]["post"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.UpdatePlayProgress(ctx, "", 90000, "played") - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/:/scrobble"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.MarkPlayed(ctx, 59398) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/:/timeline"]["get"] + - target: $["paths"]["/:/prefs"]["put"] update: x-codeSamples: - lang: go @@ -129,6 +126,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -138,20 +136,22 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{ - RatingKey: 23409, - Key: "/library/metadata/23409", - State: operations.StatePlaying, - HasMDE: 1, - Time: 2000, - Duration: 10000, - Context: "home:hub.continueWatching", - PlayQueueItemID: 1, - PlayBackTime: 2000, - Row: 1, + res, err := s.Preferences.SetPreferences(ctx, operations.SetPreferencesRequest{ + Prefs: operations.Prefs{}, }) if err != nil { log.Fatal(err) @@ -160,7 +160,7 @@ actions: // handle response } } - - target: $["paths"]["/:/unscrobble"]["get"] + - target: $["paths"]["/:/prefs/get"]["get"] update: x-codeSamples: - lang: go @@ -170,7 +170,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -178,10 +180,67 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Media.MarkUnplayed(ctx, 59398) + res, err := s.Preferences.GetPreference(ctx, operations.GetPreferenceRequest{}) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSettings != nil { + // handle response + } + } + - target: $["paths"]["/:/rate"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Rate.SetRating(ctx, operations.SetRatingRequest{ + Identifier: "", + Key: "", + Rating: 8722.46, + }) if err != nil { log.Fatal(err) } @@ -189,6 +248,193 @@ actions: // handle response } } + - target: $["paths"]["/:/scrobble"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Timeline.MarkPlayed(ctx, operations.MarkPlayedRequest{ + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/:/timeline"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Timeline.Report(ctx, operations.ReportRequest{ + Key: plexgo.Pointer("/foo"), + RatingKey: plexgo.Pointer("xyz"), + State: operations.StatePlaying.ToPointer(), + PlayQueueItemID: plexgo.Pointer("123"), + Time: plexgo.Pointer[int64](0), + Duration: plexgo.Pointer[int64](10000), + Continuing: components.BoolIntOne.ToPointer(), + Updated: plexgo.Pointer[int64](14200000), + Offline: components.BoolIntOne.ToPointer(), + TimeToFirstFrame: plexgo.Pointer[int64](1000), + TimeStalled: plexgo.Pointer[int64](1000), + Bandwidth: plexgo.Pointer[int64](100), + BufferedTime: plexgo.Pointer[int64](100), + BufferedSize: plexgo.Pointer[int64](1024), + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/:/unscrobble"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Timeline.Unscrobble(ctx, operations.UnscrobbleRequest{ + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/:/websocket/notifications"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Events.ConnectWebSocket(ctx, operations.ConnectWebSocketRequest{}) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != nil { + // handle response + } + } - target: $["paths"]["/activities"]["get"] update: x-codeSamples: @@ -210,7 +456,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Activities.GetServerActivities(ctx) + res, err := s.Activities.ListActivities(ctx) if err != nil { log.Fatal(err) } @@ -218,7 +464,7 @@ actions: // handle response } } - - target: $["paths"]["/activities/{activityUUID}"]["delete"] + - target: $["paths"]["/activities/{activityId}"]["delete"] update: x-codeSamples: - lang: go @@ -228,7 +474,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -236,10 +484,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Activities.CancelServerActivities(ctx, "25b71ed5-0f9d-461c-baa7-d404e9e10d3e") + res, err := s.Activities.CancelActivity(ctx, operations.CancelActivityRequest{ + ActivityID: "d6199ba1-fb5e-4cae-bf17-1a5369c1cf1e", + }) if err != nil { log.Fatal(err) } @@ -268,7 +529,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Butler.StopAllTasks(ctx) + res, err := s.Butler.StopTasks(ctx) if err != nil { log.Fatal(err) } @@ -297,7 +558,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Butler.GetButlerTasks(ctx) + res, err := s.Butler.GetTasks(ctx) if err != nil { log.Fatal(err) } @@ -326,7 +587,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Butler.StartAllTasks(ctx) + res, err := s.Butler.StartTasks(ctx) if err != nil { log.Fatal(err) } @@ -334,7 +595,7 @@ actions: // handle response } } - - target: $["paths"]["/butler/{taskName}"]["delete"] + - target: $["paths"]["/butler/{task}"]["delete"] update: x-codeSamples: - lang: go @@ -344,6 +605,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -353,10 +615,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Butler.StopTask(ctx, operations.PathParamTaskNameCleanOldCacheFiles) + res, err := s.Butler.StopTask(ctx, operations.StopTaskRequest{ + Task: operations.TaskCleanOldBundles, + }) if err != nil { log.Fatal(err) } @@ -364,7 +639,7 @@ actions: // handle response } } - - target: $["paths"]["/butler/{taskName}"]["post"] + - target: $["paths"]["/butler/{task}"]["post"] update: x-codeSamples: - lang: go @@ -374,6 +649,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -383,10 +659,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Butler.StartTask(ctx, operations.TaskNameRefreshPeriodicMetadata) + res, err := s.Butler.StartTask(ctx, operations.StartTaskRequest{ + Task: operations.PathParamTaskRefreshLocalMedia, + }) if err != nil { log.Fatal(err) } @@ -394,7 +683,7 @@ actions: // handle response } } - - target: $["paths"]["/clients"]["get"] + - target: $["paths"]["/downloadQueue"]["post"] update: x-codeSamples: - lang: go @@ -415,7 +704,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Server.GetAvailableClients(ctx) + res, err := s.DownloadQueue.CreateDownloadQueue(ctx) if err != nil { log.Fatal(err) } @@ -423,7 +712,7 @@ actions: // handle response } } - - target: $["paths"]["/companions"]["get"] + - target: $["paths"]["/downloadQueue/{queueId}"]["get"] update: x-codeSamples: - lang: go @@ -433,7 +722,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -441,39 +732,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Plex.GetCompanionsData(ctx) - if err != nil { - log.Fatal(err) - } - if res.ResponseBodies != nil { - // handle response - } - } - - target: $["paths"]["/devices"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetDevices(ctx) + res, err := s.DownloadQueue.GetDownloadQueue(ctx, operations.GetDownloadQueueRequest{ + QueueID: 922802, + }) if err != nil { log.Fatal(err) } @@ -481,7 +756,7 @@ actions: // handle response } } - - target: $["paths"]["/friends"]["get"] + - target: $["paths"]["/downloadQueue/{queueId}/add"]["post"] update: x-codeSamples: - lang: go @@ -491,7 +766,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -499,66 +776,52 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Plex.GetUserFriends(ctx) - if err != nil { - log.Fatal(err) - } - if res.Friends != nil { - // handle response - } - } - - target: $["paths"]["/geoip"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Plex.GetGeoData(ctx) - if err != nil { - log.Fatal(err) - } - if res.GeoData != nil { - // handle response - } - } - - target: $["paths"]["/home"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Plex.GetHomeData(ctx) + res, err := s.DownloadQueue.AddDownloadQueueItems(ctx, operations.AddDownloadQueueItemsRequest{ + QueueID: 984925, + Keys: []string{ + "/library/metadata/3", + "/library/metadata/6", + }, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: components.LocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: components.ProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + }) if err != nil { log.Fatal(err) } @@ -566,6 +829,287 @@ actions: // handle response } } + - target: $["paths"]["/downloadQueue/{queueId}/item/{itemId}/decision"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetItemDecision(ctx, operations.GetItemDecisionRequest{ + QueueID: 231605, + ItemID: 32, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDecision != nil { + // handle response + } + } + - target: $["paths"]["/downloadQueue/{queueId}/item/{itemId}/media"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetDownloadQueueMedia(ctx, operations.GetDownloadQueueMediaRequest{ + QueueID: 663184, + ItemID: 32, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/downloadQueue/{queueId}/items"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.ListDownloadQueueItems(ctx, operations.ListDownloadQueueItemsRequest{ + QueueID: 524138, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/downloadQueue/{queueId}/items/{itemId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.RemoveDownloadQueueItems(ctx, operations.RemoveDownloadQueueItemsRequest{ + QueueID: 946275, + ItemID: []int64{ + 32, + 345, + 23, + }, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/downloadQueue/{queueId}/items/{itemId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetDownloadQueueItems(ctx, operations.GetDownloadQueueItemsRequest{ + QueueID: 809886, + ItemID: []int64{ + 32, + 345, + 23, + }, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/downloadQueue/{queueId}/items/{itemId}/restart"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.RestartProcessingDownloadQueueItems(ctx, operations.RestartProcessingDownloadQueueItemsRequest{ + QueueID: 713001, + ItemID: []int64{ + 32, + 345, + 23, + }, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } - target: $["paths"]["/hubs"]["get"] update: x-codeSamples: @@ -576,35 +1120,7 @@ actions: import( "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Hubs.GetGlobalHubs(ctx, nil, nil) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/hubs/home/recentlyAdded"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -614,14 +1130,22 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Hubs.GetRecentlyAdded(ctx, operations.GetRecentlyAddedRequest{ - ContentDirectoryID: 39486, - SectionID: plexgo.Pointer[int64](2), - Type: operations.TypeTvShow, - IncludeMeta: operations.IncludeMetaEnable.ToPointer(), + res, err := s.Hubs.GetAllHubs(ctx, operations.GetAllHubsRequest{ + OnlyTransient: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) @@ -630,6 +1154,273 @@ actions: // handle response } } + - target: $["paths"]["/hubs/continueWatching"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetContinueWatching(ctx, operations.GetContinueWatchingRequest{}) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/hubs/items"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetHubItems(ctx, operations.GetHubItemsRequest{ + Identifier: []string{ + "", + "", + "", + }, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/hubs/metadata/{metadataId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetMetadataHubs(ctx, operations.GetMetadataHubsRequest{ + MetadataID: 605482, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithHubs != nil { + // handle response + } + } + - target: $["paths"]["/hubs/metadata/{metadataId}/postplay"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetPostplayHubs(ctx, operations.GetPostplayHubsRequest{ + MetadataID: 441419, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithHubs != nil { + // handle response + } + } + - target: $["paths"]["/hubs/metadata/{metadataId}/related"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetRelatedHubs(ctx, operations.GetRelatedHubsRequest{ + MetadataID: 8858, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithHubs != nil { + // handle response + } + } + - target: $["paths"]["/hubs/promoted"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetPromotedHubs(ctx, operations.GetPromotedHubsRequest{}) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } - target: $["paths"]["/hubs/search"]["get"] update: x-codeSamples: @@ -640,7 +1431,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -648,14 +1441,28 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Search.PerformSearch(ctx, "arnold", nil, plexgo.Pointer[float64](5)) + res, err := s.Search.SearchHubs(ctx, operations.SearchHubsRequest{ + Query: "", + SectionID: plexgo.Pointer[int64](1), + }) if err != nil { log.Fatal(err) } - if res != nil { + if res.Object != nil { // handle response } } @@ -669,7 +1476,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -677,14 +1486,27 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Search.PerformVoiceSearch(ctx, "dead+poop", nil, plexgo.Pointer[float64](5)) + res, err := s.Search.VoiceSearchHubs(ctx, operations.VoiceSearchHubsRequest{ + Query: "", + }) if err != nil { log.Fatal(err) } - if res != nil { + if res.Object != nil { // handle response } } @@ -698,7 +1520,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -706,10 +1530,24 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Hubs.GetLibraryHubs(ctx, 492.74, nil, nil) + res, err := s.Hubs.GetSectionHubs(ctx, operations.GetSectionHubsRequest{ + SectionID: 336924, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) if err != nil { log.Fatal(err) } @@ -717,6 +1555,280 @@ actions: // handle response } } + - target: $["paths"]["/hubs/sections/{sectionId}/manage"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.ResetSectionDefaults(ctx, operations.ResetSectionDefaultsRequest{ + SectionID: 383022, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/hubs/sections/{sectionId}/manage"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.ListHubs(ctx, operations.ListHubsRequest{ + SectionID: 442546, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/hubs/sections/{sectionId}/manage"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.CreateCustomHub(ctx, operations.CreateCustomHubRequest{ + SectionID: 869922, + MetadataItemID: 703843, + PromotedToRecommended: components.BoolIntOne.ToPointer(), + PromotedToOwnHome: components.BoolIntOne.ToPointer(), + PromotedToSharedHome: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/hubs/sections/{sectionId}/manage/move"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.MoveHub(ctx, operations.MoveHubRequest{ + SectionID: 755710, + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res.GetResponses200 != nil { + // handle response + } + } + - target: $["paths"]["/hubs/sections/{sectionId}/manage/{identifier}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.DeleteCustomHub(ctx, operations.DeleteCustomHubRequest{ + SectionID: 625677, + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/hubs/sections/{sectionId}/manage/{identifier}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.UpdateHubVisibility(ctx, operations.UpdateHubVisibilityRequest{ + SectionID: 341650, + Identifier: "", + PromotedToRecommended: components.BoolIntOne.ToPointer(), + PromotedToOwnHome: components.BoolIntOne.ToPointer(), + PromotedToSharedHome: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } - target: $["paths"]["/identity"]["get"] update: x-codeSamples: @@ -736,7 +1848,7 @@ actions: s := plexgo.New() - res, err := s.Server.GetServerIdentity(ctx) + res, err := s.General.GetIdentity(ctx) if err != nil { log.Fatal(err) } @@ -744,7 +1856,7 @@ actions: // handle response } } - - target: $["paths"]["/library/all/top"]["get"] + - target: $["paths"]["/library/all"]["get"] update: x-codeSamples: - lang: go @@ -754,6 +1866,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -763,18 +1876,29 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetTopWatchedContent(ctx, operations.GetTopWatchedContentQueryParamTypeTvShow, operations.GetTopWatchedContentQueryParamIncludeGuidsEnable.ToPointer()) + res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithMetadata != nil { // handle response } } - - target: $["paths"]["/library/hashes"]["get"] + - target: $["paths"]["/library/caches"]["delete"] update: x-codeSamples: - lang: go @@ -795,7 +1919,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Library.GetFileHash(ctx, "file://C:\\Image.png&type=13", nil) + res, err := s.Library.DeleteCaches(ctx) if err != nil { log.Fatal(err) } @@ -803,7 +1927,7 @@ actions: // handle response } } - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] + - target: $["paths"]["/library/clean/bundles"]["put"] update: x-codeSamples: - lang: go @@ -814,7 +1938,6 @@ actions: import( "context" "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -825,88 +1948,59 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Library.GetMediaMetaData(ctx, operations.GetMediaMetaDataRequest{ - RatingKey: "21119,21617", - IncludeConcerts: plexgo.Pointer(true), - IncludeExtras: plexgo.Pointer(true), - IncludeOnDeck: plexgo.Pointer(true), - IncludePopularLeaves: plexgo.Pointer(true), - IncludePreferences: plexgo.Pointer(true), - IncludeReviews: plexgo.Pointer(true), - IncludeChapters: plexgo.Pointer(true), - IncludeStations: plexgo.Pointer(true), - IncludeExternalMedia: plexgo.Pointer(true), - AsyncAugmentMetadata: plexgo.Pointer(true), - AsyncCheckFiles: plexgo.Pointer(true), - AsyncRefreshAnalysis: plexgo.Pointer(true), - AsyncRefreshLocalMediaAgent: plexgo.Pointer(true), + res, err := s.Library.CleanBundles(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/collections"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Collections.CreateCollection(ctx, operations.CreateCollectionRequest{ + SectionID: "", }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithMetadata != nil { // handle response } } - - target: $["paths"]["/library/metadata/{ratingKey}/arts"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetMediaArts(ctx, 16099) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/metadata/{ratingKey}/arts"]["post"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.PostMediaArts(ctx, 2268, plexgo.Pointer("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] + - target: $["paths"]["/library/collections/{collectionId}/composite/{updatedAt}"]["get"] update: x-codeSamples: - lang: go @@ -916,6 +2010,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -925,16 +2020,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Media.GetBannerImage(ctx, operations.GetBannerImageRequest{ - RatingKey: 9518, - Width: 396, - Height: 396, - MinSize: 1, - Upscale: 1, - XPlexToken: "CV5xoxjTpFKUzBTShsaf", + res, err := s.Content.GetCollectionImage(ctx, operations.GetCollectionImageRequest{ + CollectionID: 474227, + UpdatedAt: 759379, }) if err != nil { log.Fatal(err) @@ -943,94 +2045,7 @@ actions: // handle response } } - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetMetadataChildren(ctx, 2403.67, plexgo.Pointer("Stream")) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/metadata/{ratingKey}/posters"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetMediaPosters(ctx, 16099) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/metadata/{ratingKey}/posters"]["post"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.PostMediaPoster(ctx, 2268, plexgo.Pointer("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"] + - target: $["paths"]["/library/collections/{collectionId}/items"]["get"] update: x-codeSamples: - lang: go @@ -1040,6 +2055,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1049,16 +2065,295 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Media.GetThumbImage(ctx, operations.GetThumbImageRequest{ - RatingKey: 9518, - Width: 396, - Height: 396, - MinSize: 1, - Upscale: 1, - XPlexToken: "CV5xoxjTpFKUzBTShsaf", + res, err := s.Content.GetCollectionItems(ctx, operations.GetCollectionItemsRequest{ + CollectionID: 314585, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/collections/{collectionId}/items"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryCollections.AddCollectionItems(ctx, operations.AddCollectionItemsRequest{ + CollectionID: 338144, + URI: "https://expensive-bakeware.com", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/collections/{collectionId}/items/{itemId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryCollections.DeleteCollectionItem(ctx, operations.DeleteCollectionItemRequest{ + CollectionID: 320928, + ItemID: 406983, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/collections/{collectionId}/items/{itemId}/move"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryCollections.MoveCollectionItem(ctx, operations.MoveCollectionItemRequest{ + CollectionID: 239532, + ItemID: 513864, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/file"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.IngestTransientItem(ctx, operations.IngestTransientItemRequest{ + URL: plexgo.Pointer("file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv"), + VirtualFilePath: plexgo.Pointer("/Avatar.mkv"), + ComputeHashes: components.BoolIntOne.ToPointer(), + IngestNonMatches: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/matches"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetLibraryMatches(ctx, operations.GetLibraryMatchesRequest{ + IncludeFullMetadata: components.BoolIntOne.ToPointer(), + IncludeAncestorMetadata: components.BoolIntOne.ToPointer(), + IncludeAlternateMetadataSources: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/media/{mediaId}/chapterImages/{chapter}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetChapterImage(ctx, operations.GetChapterImageRequest{ + MediaID: 892563, + Chapter: 48348, }) if err != nil { log.Fatal(err) @@ -1067,7 +2362,7 @@ actions: // handle response } } - - target: $["paths"]["/library/recentlyAdded"]["get"] + - target: $["paths"]["/library/metadata/augmentations/{augmentationId}"]["get"] update: x-codeSamples: - lang: go @@ -1077,6 +2372,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1086,37 +2382,1928 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetRecentlyAddedLibrary(ctx, operations.GetRecentlyAddedLibraryRequest{ - ContentDirectoryID: plexgo.Pointer[int64](2), - PinnedContentDirectoryID: []int64{ - 3, + res, err := s.Library.GetAugmentationStatus(ctx, operations.GetAugmentationStatusRequest{ + AugmentationID: "", + Wait: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteMetadataItem(ctx, operations.DeleteMetadataItemRequest{ + Ids: "", + Proxy: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetMetadataItem(ctx, operations.GetMetadataItemRequest{ + Ids: []string{}, + AsyncCheckFiles: components.BoolIntOne.ToPointer(), + AsyncRefreshLocalMediaAgent: components.BoolIntOne.ToPointer(), + AsyncRefreshAnalysis: components.BoolIntOne.ToPointer(), + CheckFiles: components.BoolIntOne.ToPointer(), + SkipRefresh: components.BoolIntOne.ToPointer(), + CheckFileAvailability: components.BoolIntOne.ToPointer(), + AsyncAugmentMetadata: components.BoolIntOne.ToPointer(), + AugmentCount: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EditMetadataItem(ctx, operations.EditMetadataItemRequest{ + Ids: []string{ + "", + "", + }, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/addetect"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectAds(ctx, operations.DetectAdsRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/allLeaves"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetAllItemLeaves(ctx, operations.GetAllItemLeavesRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/analyze"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AnalyzeMetadata(ctx, operations.AnalyzeMetadataRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/chapterThumbs"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GenerateThumbs(ctx, operations.GenerateThumbsRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/credits"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectCredits(ctx, operations.DetectCreditsRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + Manual: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/extras"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetExtras(ctx, operations.GetExtrasRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/extras"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AddExtras(ctx, operations.AddExtrasRequest{ + Ids: "", + URL: "https://super-mortise.biz/", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/file"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetFile(ctx, operations.GetFileRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.TwoHundredAudioMpeg3ResponseStream != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/index"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.StartBifGeneration(ctx, operations.StartBifGenerationRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/intro"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectIntros(ctx, operations.DetectIntrosRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/marker"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.CreateMarker(ctx, operations.CreateMarkerRequest{ + Ids: "", + Type: 248391, + StartTimeOffset: 535191, + Attributes: &operations.Attributes{}, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/marker/{marker}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteMarker(ctx, operations.DeleteMarkerRequest{ + Ids: "", + Marker: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/marker/{marker}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EditMarker(ctx, operations.EditMarkerRequest{ + Ids: "", + Marker: "", + Type: 884347, + StartTimeOffset: 517251, + Attributes: &operations.QueryParamAttributes{}, + }) + if err != nil { + log.Fatal(err) + } + if res.PostResponses200 != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/match"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.MatchItem(ctx, operations.MatchItemRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/matches"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListMatches(ctx, operations.ListMatchesRequest{ + Ids: "", + Manual: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/media/{mediaItem}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteMediaItem(ctx, operations.DeleteMediaItemRequest{ + Ids: "", + MediaItem: "", + Proxy: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/merge"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.MergeItems(ctx, operations.MergeItemsRequest{ + IdsPathParameter: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/nearest"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListSonicallySimilar(ctx, operations.ListSonicallySimilarRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/prefs"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetItemPreferences(ctx, operations.SetItemPreferencesRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/refresh"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.RefreshItemsMetadata(ctx, operations.RefreshItemsMetadataRequest{ + Ids: "", + MarkUpdated: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/related"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetRelatedItems(ctx, operations.GetRelatedItemsRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/similar"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListSimilar(ctx, operations.ListSimilarRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/split"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SplitItem(ctx, operations.SplitItemRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/subtitles"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AddSubtitles(ctx, operations.AddSubtitlesRequest{ + Ids: "", + Forced: components.BoolIntOne.ToPointer(), + HearingImpaired: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/tree"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetItemTree(ctx, operations.GetItemTreeRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithNestedMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/unmatch"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.Unmatch(ctx, operations.UnmatchRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/users/top"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListTopUsers(ctx, operations.ListTopUsersRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/voiceActivity"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectVoiceActivity(ctx, operations.DetectVoiceActivityRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + Manual: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/{element}"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetItemArtwork(ctx, operations.SetItemArtworkRequest{ + Ids: "", + Element: operations.ElementBanner, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/{element}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.UpdateItemArtwork(ctx, operations.UpdateItemArtworkRequest{ + Ids: "", + Element: operations.PathParamElementClearLogo, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ids}/{element}/{timestamp}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetItemArtwork(ctx, operations.GetItemArtworkRequest{ + Ids: "", + Element: operations.GetItemArtworkPathParamElementPoster, + Timestamp: 999555, + }) + if err != nil { + log.Fatal(err) + } + if res.TwoHundredAudioMpeg3ResponseStream != nil { + // handle response + } + } + - target: $["paths"]["/library/optimize"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.OptimizeDatabase(ctx, operations.OptimizeDatabaseRequest{ + Async: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/parts/{partId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetStreamSelection(ctx, operations.SetStreamSelectionRequest{ + PartID: 360489, + AllParts: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/parts/{partId}/indexes/{index}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetPartIndex(ctx, operations.GetPartIndexRequest{ + PartID: 724750, + Index: operations.IndexSd, + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != nil { + // handle response + } + } + - target: $["paths"]["/library/parts/{partId}/indexes/{index}/{offset}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetImageFromBif(ctx, operations.GetImageFromBifRequest{ + PartID: 304273, + Index: operations.PathParamIndexSd, + Offset: 939569, + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != nil { + // handle response + } + } + - target: $["paths"]["/library/parts/{partId}/{changestamp}/{filename}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetMediaPart(ctx, operations.GetMediaPartRequest{ + PartID: 877105, + Changestamp: 970622, + Filename: "example.file", + Download: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/people/{personId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetPerson(ctx, operations.GetPersonRequest{ + PersonID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/people/{personId}/media"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListPersonMedia(ctx, operations.ListPersonMediaRequest{ + PersonID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/randomArtwork"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetRandomArtwork(ctx, operations.GetRandomArtworkRequest{ + Sections: []int64{ 5, - 7, - 13, - 12, - 1, 6, - 14, - 2, - 10, - 16, - 17, }, - SectionID: plexgo.Pointer[int64](2), - Type: operations.QueryParamTypeTvShow, - IncludeMeta: operations.QueryParamIncludeMetaEnable.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithArtwork != nil { // handle response } } - - target: $["paths"]["/library/search"]["get"] + - target: $["paths"]["/library/sections/all"]["get"] update: x-codeSamples: - lang: go @@ -1127,6 +4314,36 @@ actions: import( "context" "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSections(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/all"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -1135,26 +4352,41 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetSearchAllLibraries(ctx, operations.GetSearchAllLibrariesRequest{ - Query: "", - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - SearchTypes: []operations.SearchTypes{ - operations.SearchTypesPeople, + res, err := s.Library.AddSection(ctx, operations.AddSectionRequest{ + Name: "", + Type: 39544, + Agent: "", + Language: "", + Locations: []string{ + "O:\fatboy\\Media\\Ripped\\Music", + "O:\fatboy\\Media\\My Music", }, - IncludeCollections: operations.GetSearchAllLibrariesQueryParamIncludeCollectionsEnable.ToPointer(), - IncludeExternalMedia: operations.GetSearchAllLibrariesQueryParamIncludeExternalMediaEnable.ToPointer(), + Prefs: &operations.QueryParamPrefs{}, + Relative: components.BoolIntOne.ToPointer(), + ImportFromiTunes: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.SlashGetResponses200 != nil { // handle response } } - - target: $["paths"]["/library/sections"]["get"] + - target: $["paths"]["/library/sections/all/refresh"]["delete"] update: x-codeSamples: - lang: go @@ -1175,15 +4407,15 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Library.GetAllLibraries(ctx) + res, err := s.Library.StopAllRefreshes(ctx) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.RequestHandlerSlashGetResponses200 != nil { // handle response } } - - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] + - target: $["paths"]["/library/sections/prefs"]["get"] update: x-codeSamples: - lang: go @@ -1193,6 +4425,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1202,21 +4435,31 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{ - Filter: operations.FilterReleased, - XPlexToken: "CV5xoxjTpFKUzBTShsaf", + res, err := s.Library.GetSectionsPrefs(ctx, operations.GetSectionsPrefsRequest{ + Type: 460221, }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.RequestHandlerSlashGetResponses200 != nil { // handle response } } - - target: $["paths"]["/library/sections/{sectionKey}"]["delete"] + - target: $["paths"]["/library/sections/refresh"]["post"] update: x-codeSamples: - lang: go @@ -1226,7 +4469,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -1234,10 +4479,21 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.DeleteLibrary(ctx, 9518) + res, err := s.Library.RefreshSectionsMetadata(ctx, operations.RefreshSectionsMetadataRequest{}) if err != nil { log.Fatal(err) } @@ -1245,7 +4501,7 @@ actions: // handle response } } - - target: $["paths"]["/library/sections/{sectionKey}"]["get"] + - target: $["paths"]["/library/sections/{sectionId}"]["delete"] update: x-codeSamples: - lang: go @@ -1255,6 +4511,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1264,176 +4521,32 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetLibraryDetails(ctx, 9518, operations.IncludeDetailsZero.ToPointer()) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionKey}/actor"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetActorsLibrary(ctx, 9518, operations.GetActorsLibraryQueryParamTypeTvShow) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionKey}/all"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetLibrarySectionsAll(ctx, operations.GetLibrarySectionsAllRequest{ - SectionKey: 9518, - Type: operations.GetLibrarySectionsAllQueryParamTypeTvShow, - IncludeMeta: operations.GetLibrarySectionsAllQueryParamIncludeMetaEnable.ToPointer(), - IncludeGuids: operations.QueryParamIncludeGuidsEnable.ToPointer(), - IncludeAdvanced: operations.IncludeAdvancedEnable.ToPointer(), - IncludeCollections: operations.QueryParamIncludeCollectionsEnable.ToPointer(), - IncludeExternalMedia: operations.QueryParamIncludeExternalMediaEnable.ToPointer(), + res, err := s.Library.DeleteLibrarySection(ctx, operations.DeleteLibrarySectionRequest{ + SectionID: "", + Async: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionKey}/country"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetCountriesLibrary(ctx, 9518, operations.GetCountriesLibraryQueryParamTypeTvShow) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetGenresLibrary(ctx, 9518, operations.GetGenresLibraryQueryParamTypeTvShow) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetRefreshLibraryMetadata(ctx, 9518, operations.ForceZero.ToPointer()) - if err != nil { - log.Fatal(err) - } if res != nil { // handle response } } - - target: $["paths"]["/library/sections/{sectionKey}/search"]["get"] + - target: $["paths"]["/library/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: go @@ -1443,6 +4556,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1452,45 +4566,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.GetSearchLibraryQueryParamTypeTvShow) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{ - Tag: operations.TagNewest, - IncludeGuids: operations.IncludeGuidsEnable.ToPointer(), - Type: operations.GetLibraryItemsQueryParamTypeTvShow, - SectionKey: 9518, - IncludeMeta: operations.GetLibraryItemsQueryParamIncludeMetaEnable.ToPointer(), + res, err := s.Library.GetLibraryDetails(ctx, operations.GetLibraryDetailsRequest{ + SectionID: "", + IncludeDetails: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) @@ -1499,7 +4591,1519 @@ actions: // handle response } } - - target: $["paths"]["/log"]["get"] + - target: $["paths"]["/library/sections/{sectionId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EditSection(ctx, operations.EditSectionRequest{ + SectionID: "", + Agent: "", + Locations: []string{ + "O:\fatboy\\Media\\Ripped\\Music", + "O:\fatboy\\Media\\My Music", + }, + Prefs: &operations.EditSectionQueryParamPrefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/albums"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetAlbums(ctx, operations.GetAlbumsRequest{ + SectionID: 817133, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/all"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.ListContent(ctx, operations.ListContentRequest{ + SectionID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/all"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.UpdateItems(ctx, operations.UpdateItemsRequest{ + SectionID: "", + FieldLocked: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/allLeaves"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetAllLeaves(ctx, operations.GetAllLeavesRequest{ + SectionID: 633197, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/analyze"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.StartAnalysis(ctx, operations.StartAnalysisRequest{ + SectionID: 158829, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/arts"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetArts(ctx, operations.GetArtsRequest{ + SectionID: 859200, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/autocomplete"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.Autocomplete(ctx, operations.AutocompleteRequest{ + SectionID: 942007, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/categories"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetCategories(ctx, operations.GetCategoriesRequest{ + SectionID: 21841, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/cluster"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetCluster(ctx, operations.GetClusterRequest{ + SectionID: 138560, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/collection/{collectionId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteCollection(ctx, operations.DeleteCollectionRequest{ + SectionID: 283619, + CollectionID: 680895, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/collections"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetCollections(ctx, operations.GetCollectionsRequest{ + SectionID: 348838, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/common"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetCommon(ctx, operations.GetCommonRequest{ + SectionID: 298154, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/composite/{updatedAt}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionImage(ctx, operations.GetSectionImageRequest{ + SectionID: 925611, + UpdatedAt: 117413, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/computePath"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetSonicPath(ctx, operations.GetSonicPathRequest{ + SectionID: 914549, + StartID: 629990, + EndID: 687740, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/emptyTrash"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EmptyTrash(ctx, operations.EmptyTrashRequest{ + SectionID: 30052, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/filters"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionFilters(ctx, operations.GetSectionFiltersRequest{ + SectionID: 380557, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/firstCharacters"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetFirstCharacters(ctx, operations.GetFirstCharactersRequest{ + SectionID: 3947, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/indexes"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteIndexes(ctx, operations.DeleteIndexesRequest{ + SectionID: 588437, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/intros"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteIntros(ctx, operations.DeleteIntrosRequest{ + SectionID: 498656, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/location"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetFolders(ctx, operations.GetFoldersRequest{ + SectionID: 892532, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/moment"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.ListMoments(ctx, operations.ListMomentsRequest{ + SectionID: 403239, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/nearest"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetSonicallySimilar(ctx, operations.GetSonicallySimilarRequest{ + SectionID: 525956, + Values: []int64{}, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/prefs"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionPreferences(ctx, operations.GetSectionPreferencesRequest{ + SectionID: 754869, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSettings != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/prefs"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetSectionPreferences(ctx, operations.SetSectionPreferencesRequest{ + SectionID: 349936, + Prefs: operations.SetSectionPreferencesQueryParamPrefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.CancelRefresh(ctx, operations.CancelRefreshRequest{ + SectionID: 326852, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.RefreshSection(ctx, operations.RefreshSectionRequest{ + SectionID: 450300, + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/sorts"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetAvailableSorts(ctx, operations.GetAvailableSortsRequest{ + SectionID: 212498, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/streams/{streamId}.{ext}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteStream(ctx, operations.DeleteStreamRequest{ + StreamID: 841510, + Ext: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/streams/{streamId}.{ext}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetStream(ctx, operations.GetStreamRequest{ + StreamID: 314506, + Ext: "", + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/streams/{streamId}.{ext}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetStreamOffset(ctx, operations.SetStreamOffsetRequest{ + StreamID: 606295, + Ext: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/streams/{streamId}/levels"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetStreamLevels(ctx, operations.GetStreamLevelsRequest{ + StreamID: 447611, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/streams/{streamId}/loudness"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetStreamLoudness(ctx, operations.GetStreamLoudnessRequest{ + StreamID: 277271, + }) + if err != nil { + log.Fatal(err) + } + if res.Res != nil { + // handle response + } + } + - target: $["paths"]["/library/tags"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetTags(ctx, operations.GetTagsRequest{}) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs"]["get"] update: x-codeSamples: - lang: go @@ -1510,7 +6114,6 @@ actions: import( "context" "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -1521,7 +6124,1091 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Log.LogLine(ctx, operations.LevelThree, "Test log message", "Postman") + res, err := s.DVRs.ListDVRs(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.CreateDVR(ctx, operations.CreateDVRRequest{ + Lineup: plexgo.Pointer("lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT"), + DeviceQueryParameter: []string{ + "d", + "e", + "v", + "i", + "c", + "e", + "[", + "]", + "=", + "d", + "e", + "v", + "i", + "c", + "e", + ":", + "/", + "/", + "t", + "v", + ".", + "p", + "l", + "e", + "x", + ".", + "g", + "r", + "a", + "b", + "b", + "e", + "r", + "s", + ".", + "h", + "d", + "h", + "o", + "m", + "e", + "r", + "u", + "n", + "/", + "1", + "0", + "5", + "3", + "C", + "0", + "C", + "A", + }, + Language: plexgo.Pointer("eng"), + }) + if err != nil { + log.Fatal(err) + } + if res.DvrRequestHandlerSlashGetResponses200 != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.DeleteDVR(ctx, operations.DeleteDVRRequest{ + DvrID: 855088, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.GetDVR(ctx, operations.GetDVRRequest{ + DvrID: 973518, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/channels/{channel}/tune"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.TuneChannel(ctx, operations.TuneChannelRequest{ + DvrID: 834281, + Channel: "2.1", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/devices/{deviceId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.RemoveDeviceFromDVR(ctx, operations.RemoveDeviceFromDVRRequest{ + DvrID: 945416, + DeviceID: 260761, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/devices/{deviceId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.AddDeviceToDVR(ctx, operations.AddDeviceToDVRRequest{ + DvrID: 334755, + DeviceID: 852930, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/lineups"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.DeleteLineup(ctx, operations.DeleteLineupRequest{ + DvrID: 454470, + Lineup: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/lineups"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.AddLineup(ctx, operations.AddLineupRequest{ + DvrID: 945235, + Lineup: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/prefs"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.SetDVRPreferences(ctx, operations.SetDVRPreferencesRequest{ + DvrID: 116357, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/reloadGuide"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.StopDVRReload(ctx, operations.StopDVRReloadRequest{ + DvrID: 348053, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/livetv/dvrs/{dvrId}/reloadGuide"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.ReloadGuide(ctx, operations.ReloadGuideRequest{ + DvrID: 140753, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/channelmap"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.ComputeChannelMap(ctx, operations.ComputeChannelMapRequest{ + DeviceQueryParameter: "", + Lineup: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/channels"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetChannels(ctx, operations.GetChannelsRequest{ + Lineup: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/countries"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetCountries(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/countries/{country}/{epgId}/lineups"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetCountriesLineups(ctx, operations.GetCountriesLineupsRequest{ + Country: "Malawi", + EpgID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithLineup != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/countries/{country}/{epgId}/regions"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetCountryRegions(ctx, operations.GetCountryRegionsRequest{ + Country: "Morocco", + EpgID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/countries/{country}/{epgId}/regions/{region}/lineups"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.ListLineups(ctx, operations.ListLineupsRequest{ + Country: "Vanuatu", + EpgID: "", + Region: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithLineup != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/languages"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetAllLanguages(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/lineup"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetLineup(ctx, operations.GetLineupRequest{ + DeviceQueryParameter: "", + LineupGroup: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/livetv/epg/lineupchannels"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetLineupChannels(ctx, operations.GetLineupChannelsRequest{ + Lineup: []string{ + "", + "", + }, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/livetv/sessions"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetSessions(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/livetv/sessions/{sessionId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetLiveTVSession(ctx, operations.GetLiveTVSessionRequest{ + SessionID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/livetv/sessions/{sessionId}/{consumerId}/index.m3u8"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetSessionPlaylistIndex(ctx, operations.GetSessionPlaylistIndexRequest{ + SessionID: "", + ConsumerID: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/livetv/sessions/{sessionId}/{consumerId}/{segmentId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetSessionSegment(ctx, operations.GetSessionSegmentRequest{ + SessionID: "", + ConsumerID: "", + SegmentID: "", + }) if err != nil { log.Fatal(err) } @@ -1540,6 +7227,7 @@ actions: import( "context" "github.com/LukeHagar/plexgo" + "os" "log" ) @@ -1550,9 +7238,12 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Log.LogMultiLine(ctx, "level=4&message=Test%20message%201&source=postman\n" + - "level=3&message=Test%20message%202&source=postman\n" + - "level=1&message=Test%20message%203&source=postman") + example, fileErr := os.Open("example.file") + if fileErr != nil { + panic(fileErr) + } + + res, err := s.Log.WriteLog(ctx, example) if err != nil { log.Fatal(err) } @@ -1560,7 +7251,135 @@ actions: // handle response } } - - target: $["paths"]["/log/networked"]["get"] + - target: $["paths"]["/log"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Log.WriteMessage(ctx, operations.WriteMessageRequest{}) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/log/networked"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Log.EnablePapertrail(ctx, operations.EnablePapertrailRequest{}) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetAvailableGrabbers(ctx, operations.GetAvailableGrabbersRequest{ + Protocol: plexgo.Pointer("livetv"), + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices"]["get"] update: x-codeSamples: - lang: go @@ -1581,7 +7400,541 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Log.EnablePaperTrail(ctx) + res, err := s.Devices.ListDevices(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.AddDevice(ctx, operations.AddDeviceRequest{ + URI: plexgo.Pointer("http://10.0.0.5"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/discover"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.DiscoverDevices(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.RemoveDevice(ctx, operations.RemoveDeviceRequest{ + DeviceID: 685908, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetDeviceDetails(ctx, operations.GetDeviceDetailsRequest{ + DeviceID: 170949, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.ModifyDevice(ctx, operations.ModifyDeviceRequest{ + DeviceID: 879135, + Enabled: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}/channelmap"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.SetChannelmap(ctx, operations.SetChannelmapRequest{ + DeviceID: 937661, + ChannelMapping: &operations.ChannelMapping{}, + ChannelMappingByKey: &operations.ChannelMappingByKey{}, + ChannelsEnabled: []string{ + "4", + "6", + ".", + "1", + ",", + "4", + "4", + ".", + "1", + ",", + "4", + "5", + ".", + "1", + }, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}/channels"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetDevicesChannels(ctx, operations.GetDevicesChannelsRequest{ + DeviceID: 517209, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}/prefs"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.SetDevicePreferences(ctx, operations.SetDevicePreferencesRequest{ + DeviceID: 420973, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}/scan"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.StopScan(ctx, operations.StopScanRequest{ + DeviceID: 576494, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}/scan"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.Scan(ctx, operations.ScanRequest{ + DeviceID: 57391, + Source: plexgo.Pointer("Cable"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/devices/{deviceId}/thumb/{version}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetThumb(ctx, operations.GetThumbRequest{ + DeviceID: 960617, + VersionPathParameter: 1025, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/grabbers/operations/{operationId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.CancelGrab(ctx, operations.CancelGrabRequest{ + OperationID: "", + }) if err != nil { log.Fatal(err) } @@ -1610,7 +7963,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Server.GetMediaProviders(ctx, "CV5xoxjTpFKUzBTShsaf") + res, err := s.Provider.ListProviders(ctx) if err != nil { log.Fatal(err) } @@ -1618,7 +7971,51 @@ actions: // handle response } } - - target: $["paths"]["/myplex/account"]["get"] + - target: $["paths"]["/media/providers"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Provider.AddProvider(ctx, operations.AddProviderRequest{ + URL: "https://steep-obedience.name/", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/providers/refresh"]["post"] update: x-codeSamples: - lang: go @@ -1639,7 +8036,145 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Server.GetMyPlexAccount(ctx) + res, err := s.Provider.RefreshProviders(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/providers/{provider}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Provider.DeleteMediaProvider(ctx, operations.DeleteMediaProviderRequest{ + Provider: "", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetAllSubscriptions(ctx, operations.GetAllSubscriptionsRequest{ + IncludeGrabs: components.BoolIntOne.ToPointer(), + IncludeStorage: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.CreateSubscription(ctx, operations.CreateSubscriptionRequest{ + TargetLibrarySectionID: plexgo.Pointer[int64](1), + TargetSectionLocationID: plexgo.Pointer[int64](3), + Type: plexgo.Pointer[int64](2), + Hints: &operations.Hints{}, + Prefs: &operations.CreateSubscriptionQueryParamPrefs{}, + Params: &operations.Params{}, + }) if err != nil { log.Fatal(err) } @@ -1647,6 +8182,287 @@ actions: // handle response } } + - target: $["paths"]["/media/subscriptions/process"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.ProcessSubscriptions(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions/scheduled"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetScheduledRecordings(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions/template"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetTemplate(ctx, operations.GetTemplateRequest{ + GUID: plexgo.Pointer("plex://episode/5fc70265c40548002d539d23"), + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions/{subscriptionId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.DeleteSubscription(ctx, operations.DeleteSubscriptionRequest{ + SubscriptionID: 974618, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions/{subscriptionId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetSubscription(ctx, operations.GetSubscriptionRequest{ + SubscriptionID: 186713, + IncludeGrabs: components.BoolIntOne.ToPointer(), + IncludeStorage: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions/{subscriptionId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.EditSubscriptionPreferences(ctx, operations.EditSubscriptionPreferencesRequest{ + SubscriptionID: 673918, + Prefs: &operations.EditSubscriptionPreferencesQueryParamPrefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != nil { + // handle response + } + } + - target: $["paths"]["/media/subscriptions/{subscriptionId}/move"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.ReorderSubscription(ctx, operations.ReorderSubscriptionRequest{ + SubscriptionID: 440634, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != nil { + // handle response + } + } - target: $["paths"]["/photo/:/transcode"]["get"] update: x-codeSamples: @@ -1657,6 +8473,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1666,25 +8483,36 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetResizedPhoto(ctx, operations.GetResizedPhotoRequest{ - Width: 110, - Height: 165, - Blur: 0, - MinSize: operations.MinSizeZero, - Upscale: operations.UpscaleZero, - URL: "/library/metadata/49564/thumb/1654258204", + res, err := s.Transcoder.TranscodeImage(ctx, operations.TranscodeImageRequest{ + URL: plexgo.Pointer("/library/metadata/265/thumb/1715112705"), + Background: plexgo.Pointer("#ff5522"), + Upscale: components.BoolIntOne.ToPointer(), + MinSize: components.BoolIntOne.ToPointer(), + Rotate: components.BoolIntOne.ToPointer(), + BlendColor: plexgo.Pointer("#ff5522"), }) if err != nil { log.Fatal(err) } - if res != nil { + if res.TwoHundredImageJpegResponseStream != nil { // handle response } } - - target: $["paths"]["/pins"]["post"] + - target: $["paths"]["/playQueues"]["post"] update: x-codeSamples: - lang: go @@ -1694,6 +8522,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1702,23 +8531,37 @@ actions: func main() { ctx := context.Background() - s := plexgo.New() + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) - res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{ - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), + res, err := s.PlayQueue.CreatePlayQueue(ctx, operations.CreatePlayQueueRequest{ + Type: operations.TypeAudio, + Shuffle: components.BoolIntOne.ToPointer(), + Repeat: components.BoolIntOne.ToPointer(), + Continuous: components.BoolIntOne.ToPointer(), + Recursive: components.BoolIntOne.ToPointer(), + OnDeck: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.AuthPinContainer != nil { + if res.Object != nil { // handle response } } - - target: $["paths"]["/pins/{pinID}"]["get"] + - target: $["paths"]["/playQueues/{playQueueId}"]["get"] update: x-codeSamples: - lang: go @@ -1728,6 +8571,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1736,20 +8580,342 @@ actions: func main() { ctx := context.Background() - s := plexgo.New() + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) - res, err := s.Plex.GetTokenByPinID(ctx, operations.GetTokenByPinIDRequest{ - PinID: 232248, - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), + res, err := s.PlayQueue.GetPlayQueue(ctx, operations.GetPlayQueueRequest{ + PlayQueueID: 210646, + Own: components.BoolIntOne.ToPointer(), + IncludeBefore: components.BoolIntOne.ToPointer(), + IncludeAfter: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.AuthPinContainer != nil { + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.AddToPlayQueue(ctx, operations.AddToPlayQueueRequest{ + PlayQueueID: 919248, + Next: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}/items"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.ClearPlayQueue(ctx, operations.ClearPlayQueueRequest{ + PlayQueueID: 86357, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}/items/{playQueueItemId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.DeletePlayQueueItem(ctx, operations.DeletePlayQueueItemRequest{ + PlayQueueID: 285738, + PlayQueueItemID: 464354, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}/items/{playQueueItemId}/move"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.MovePlayQueueItem(ctx, operations.MovePlayQueueItemRequest{ + PlayQueueID: 31341, + PlayQueueItemID: 495865, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}/reset"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.ResetPlayQueue(ctx, operations.ResetPlayQueueRequest{ + PlayQueueID: 581891, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}/shuffle"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.Shuffle(ctx, operations.ShuffleRequest{ + PlayQueueID: 316150, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playQueues/{playQueueId}/unshuffle"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.Unshuffle(ctx, operations.UnshuffleRequest{ + PlayQueueID: 484388, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { // handle response } } @@ -1763,7 +8929,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -1771,14 +8939,25 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Playlists.GetPlaylists(ctx, nil, nil) + res, err := s.Playlist.ListPlaylists(ctx, operations.ListPlaylistsRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithPlaylistMetadata != nil { // handle response } } @@ -1792,6 +8971,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1801,19 +8981,25 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Playlists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ - Title: "", - Type: operations.CreatePlaylistQueryParamTypeAudio, - Smart: operations.SmartOne, - URI: "https://short-term-disconnection.name/", - }) + res, err := s.LibraryPlaylists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithPlaylistMetadata != nil { // handle response } } @@ -1827,6 +9013,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1836,10 +9023,24 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Playlists.UploadPlaylist(ctx, "/home/barkley/playlist.m3u", operations.QueryParamForceOne, 1) + res, err := s.LibraryPlaylists.UploadPlaylist(ctx, operations.UploadPlaylistRequest{ + Path: plexgo.Pointer("/home/barkley/playlist.m3u"), + Force: components.BoolIntOne.ToPointer(), + }) if err != nil { log.Fatal(err) } @@ -1847,123 +9048,7 @@ actions: // handle response } } - - target: $["paths"]["/playlists/{playlistID}"]["delete"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.DeletePlaylist(ctx, 3432.93) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.GetPlaylist(ctx, 8419.53) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}"]["put"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.UpdatePlaylist(ctx, 1579.66, nil, nil) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.ClearPlaylistContents(ctx, 4137.37) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] + - target: $["paths"]["/playlists/{playlistId}"]["delete"] update: x-codeSamples: - lang: go @@ -1973,6 +9058,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1982,47 +9068,31 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Playlists.GetPlaylistContents(ctx, 5535.42, operations.GetPlaylistContentsQueryParamTypeTvShow) + res, err := s.LibraryPlaylists.DeletePlaylist(ctx, operations.DeletePlaylistRequest{ + PlaylistID: 343293, + }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res != nil { // handle response } } - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.AddPlaylistContents(ctx, 7013.44, "server://12345/com.plexapp.plugins.library/library/metadata/1", plexgo.Pointer[float64](123)) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/resources"]["get"] + - target: $["paths"]["/playlists/{playlistId}"]["get"] update: x-codeSamples: - lang: go @@ -2032,6 +9102,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -2041,18 +9112,31 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Plex.GetServerResources(ctx, "3381b62b-9ab7-4e37-827b-203e9809eb58", operations.IncludeHTTPSEnable.ToPointer(), operations.IncludeRelayEnable.ToPointer(), operations.IncludeIPv6Enable.ToPointer()) + res, err := s.Playlist.GetPlaylist(ctx, operations.GetPlaylistRequest{ + PlaylistID: 841953, + }) if err != nil { log.Fatal(err) } - if res.PlexDevices != nil { + if res.MediaContainerWithPlaylistMetadata != nil { // handle response } } - - target: $["paths"]["/search"]["get"] + - target: $["paths"]["/playlists/{playlistId}"]["put"] update: x-codeSamples: - lang: go @@ -2062,7 +9146,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -2070,10 +9156,67 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Search.GetSearchResults(ctx, "110") + res, err := s.LibraryPlaylists.UpdatePlaylist(ctx, operations.UpdatePlaylistRequest{ + PlaylistID: 157966, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/generators"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.GetPlaylistGenerators(ctx, operations.GetPlaylistGeneratorsRequest{ + PlaylistID: 162342, + }) if err != nil { log.Fatal(err) } @@ -2081,6 +9224,425 @@ actions: // handle response } } + - target: $["paths"]["/playlists/{playlistId}/items"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.ClearPlaylistItems(ctx, operations.ClearPlaylistItemsRequest{ + PlaylistID: 552140, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Playlist.GetPlaylistItems(ctx, operations.GetPlaylistItemsRequest{ + PlaylistID: 118195, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.AddPlaylistItems(ctx, operations.AddPlaylistItemsRequest{ + PlaylistID: 533723, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items/{generatorId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.DeletePlaylistItem(ctx, operations.DeletePlaylistItemRequest{ + PlaylistID: 981646, + GeneratorID: 194010, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items/{generatorId}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.GetPlaylistGenerator(ctx, operations.GetPlaylistGeneratorRequest{ + PlaylistID: 744880, + GeneratorID: 322168, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items/{generatorId}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.ModifyPlaylistGenerator(ctx, operations.ModifyPlaylistGeneratorRequest{ + PlaylistID: 972007, + GeneratorID: 208334, + Item: &operations.Item{ + Location: &operations.ModifyPlaylistGeneratorQueryParamLocation{ + URI: plexgo.Pointer("library://82503060-0d68-4603-b594-8b071d54819e/item/%2Flibrary%2Fmetadata%2F146"), + }, + LocationID: plexgo.Pointer[int64](-1), + Policy: &operations.Policy{ + Value: plexgo.Pointer[int64](), + Scope: operations.QueryParamScopeAll.ToPointer(), + Unwatched: components.BoolIntZero.ToPointer(), + }, + Target: plexgo.Pointer(""), + TargetTagID: plexgo.Pointer[int64](1), + Title: plexgo.Pointer("Jack-Jack Attack"), + Type: plexgo.Pointer[int64](42), + }, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items/{generatorId}/items"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.GetPlaylistGeneratorItems(ctx, operations.GetPlaylistGeneratorItemsRequest{ + PlaylistID: 77230, + GeneratorID: 979714, + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items/{generatorId}/{metadataId}/{action}"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.RefreshPlaylist(ctx, operations.RefreshPlaylistRequest{ + PlaylistID: 895314, + GeneratorID: 629742, + MetadataID: 724422, + Action: operations.ActionDisable, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistId}/items/{playlistItemId}/move"]["put"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.MovePlaylistItem(ctx, operations.MovePlaylistItemRequest{ + PlaylistID: 940298, + PlaylistItemID: 375626, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != nil { + // handle response + } + } - target: $["paths"]["/security/resources"]["get"] update: x-codeSamples: @@ -2091,35 +9653,7 @@ actions: import( "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Authentication.GetSourceConnectionInformation(ctx, "server://client-identifier") - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/security/token"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -2129,18 +9663,32 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Authentication.GetTransientToken(ctx, operations.GetTransientTokenQueryParamTypeDelegation, operations.ScopeAll) + res, err := s.General.GetSourceConnectionInformation(ctx, operations.GetSourceConnectionInformationRequest{ + Source: "", + Refresh: components.BoolIntOne.ToPointer(), + }) if err != nil { log.Fatal(err) } - if res != nil { + if res.Object != nil { // handle response } } - - target: $["paths"]["/servers"]["get"] + - target: $["paths"]["/security/token"]["post"] update: x-codeSamples: - lang: go @@ -2150,7 +9698,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -2158,10 +9708,24 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Server.GetServerList(ctx) + res, err := s.General.GetTransientToken(ctx, operations.GetTransientTokenRequest{ + Type: operations.QueryParamTypeDelegation, + Scope: operations.ScopeAll, + }) if err != nil { log.Fatal(err) } @@ -2169,7 +9733,7 @@ actions: // handle response } } - - target: $["paths"]["/statistics/bandwidth"]["get"] + - target: $["paths"]["/services/ultrablur/colors"]["get"] update: x-codeSamples: - lang: go @@ -2179,7 +9743,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -2187,10 +9753,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Statistics.GetBandwidthStatistics(ctx, plexgo.Pointer[int64](4)) + res, err := s.UltraBlur.GetColors(ctx, operations.GetColorsRequest{ + URL: plexgo.Pointer("/library/metadata/217745/art/1718931408"), + }) if err != nil { log.Fatal(err) } @@ -2198,7 +9777,7 @@ actions: // handle response } } - - target: $["paths"]["/statistics/media"]["get"] + - target: $["paths"]["/services/ultrablur/image"]["get"] update: x-codeSamples: - lang: go @@ -2208,7 +9787,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -2216,43 +9797,33 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Statistics.GetStatistics(ctx, plexgo.Pointer[int64](4)) + res, err := s.UltraBlur.GetImage(ctx, operations.GetImageRequest{ + TopLeft: plexgo.Pointer("3f280a"), + TopRight: plexgo.Pointer("6b4713"), + BottomRight: plexgo.Pointer("0f2a43"), + BottomLeft: plexgo.Pointer("1c425d"), + Width: plexgo.Pointer[int64](1920), + Height: plexgo.Pointer[int64](1080), + Noise: components.BoolIntOne.ToPointer(), + }) if err != nil { log.Fatal(err) } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/statistics/resources"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Statistics.GetResourcesStatistics(ctx, plexgo.Pointer[int64](4)) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { + if res.ResponseStream != nil { // handle response } } @@ -2277,7 +9848,36 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Sessions.GetSessions(ctx) + res, err := s.Status.ListSessions(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/status/sessions/background"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Status.GetBackgroundTasks(ctx) if err != nil { log.Fatal(err) } @@ -2295,6 +9895,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -2304,10 +9905,47 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Sessions.GetSessionHistory(ctx, plexgo.Pointer("viewedAt:desc"), plexgo.Pointer[int64](1), &operations.QueryParamFilter{}, plexgo.Pointer[int64](12)) + res, err := s.Status.ListPlaybackHistory(ctx, operations.ListPlaybackHistoryRequest{ + Sort: []string{ + "v", + "i", + "e", + "w", + "e", + "d", + "A", + "t", + ":", + "d", + "e", + "s", + "c", + ",", + "a", + "c", + "c", + "o", + "u", + "n", + "t", + "I", + "D", + }, + }) if err != nil { log.Fatal(err) } @@ -2315,7 +9953,7 @@ actions: // handle response } } - - target: $["paths"]["/transcode/sessions"]["get"] + - target: $["paths"]["/status/sessions/history/{historyId}"]["delete"] update: x-codeSamples: - lang: go @@ -2325,7 +9963,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -2333,18 +9973,31 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Sessions.GetTranscodeSessions(ctx) + res, err := s.Status.DeleteHistory(ctx, operations.DeleteHistoryRequest{ + HistoryID: 953579, + }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainer != nil { // handle response } } - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] + - target: $["paths"]["/status/sessions/history/{historyId}"]["get"] update: x-codeSamples: - lang: go @@ -2354,7 +10007,9 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -2362,10 +10017,68 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Sessions.StopTranscodeSession(ctx, "zz7llzqlx8w9vnrsbnwhbmep") + res, err := s.Status.GetHistoryItem(ctx, operations.GetHistoryItemRequest{ + HistoryID: 832213, + }) + if err != nil { + log.Fatal(err) + } + if res.HistoryAllGetResponses200 != nil { + // handle response + } + } + - target: $["paths"]["/status/sessions/terminate"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Status.TerminateSession(ctx, operations.TerminateSessionRequest{ + SessionID: "cdefghijklmnopqrstuvwxyz", + Reason: plexgo.Pointer("Stop Playing"), + }) if err != nil { log.Fatal(err) } @@ -2383,6 +10096,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -2392,10 +10106,24 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Updater.ApplyUpdates(ctx, operations.TonightOne.ToPointer(), operations.SkipOne.ToPointer()) + res, err := s.Updater.ApplyUpdates(ctx, operations.ApplyUpdatesRequest{ + Tonight: components.BoolIntOne.ToPointer(), + Skip: components.BoolIntOne.ToPointer(), + }) if err != nil { log.Fatal(err) } @@ -2413,6 +10141,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -2422,10 +10151,23 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Updater.CheckForUpdates(ctx, operations.DownloadOne.ToPointer()) + res, err := s.Updater.CheckUpdates(ctx, operations.CheckUpdatesRequest{ + Download: components.BoolIntOne.ToPointer(), + }) if err != nil { log.Fatal(err) } @@ -2454,7 +10196,7 @@ actions: plexgo.WithSecurity(""), ) - res, err := s.Updater.GetUpdateStatus(ctx) + res, err := s.Updater.GetUpdatesStatus(ctx) if err != nil { log.Fatal(err) } @@ -2462,117 +10204,7 @@ actions: // handle response } } - - target: $["paths"]["/user"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Authentication.GetTokenDetails(ctx) - if err != nil { - log.Fatal(err) - } - if res.UserPlexAccount != nil { - // handle response - } - } - - target: $["paths"]["/users"]["get"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Users.GetUsers(ctx, operations.GetUsersRequest{ - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - DeviceName: plexgo.Pointer("Chrome"), - DeviceScreenResolution: plexgo.Pointer("1487x1165,2560x1440"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), - ClientFeatures: plexgo.Pointer("external-media,indirect-media,hub-style-list"), - Model: plexgo.Pointer("4200X"), - XPlexSessionID: plexgo.Pointer("97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"), - XPlexLanguage: plexgo.Pointer("en"), - PlatformVersion: plexgo.Pointer("4.3 build 1057"), - XPlexToken: "CV5xoxjTpFKUzBTShsaf", - }) - if err != nil { - log.Fatal(err) - } - if res.Body != nil { - // handle response - } - } - - target: $["paths"]["/users/signin"]["post"] - update: - x-codeSamples: - - lang: go - label: PlexGO - source: |- - package main - - import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Authentication.PostUsersSignInData(ctx, operations.PostUsersSignInDataRequest{ - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), - RequestBody: &operations.PostUsersSignInDataRequestBody{ - Login: "username@email.com", - Password: "password123", - VerificationCode: plexgo.Pointer("123456"), - }, - }) - if err != nil { - log.Fatal(err) - } - if res.UserPlexAccount != nil { - // handle response - } - } - - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] + - target: $["paths"]["/{transcodeType}/:/transcode/universal/decision"]["get"] update: x-codeSamples: - lang: go @@ -2582,6 +10214,7 @@ actions: import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -2591,26 +10224,236 @@ actions: ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ - HasMDE: 1, - Path: "/library/metadata/23409", - MediaIndex: 0, - PartIndex: 0, - Protocol: "hls", - FastSeek: plexgo.Pointer[float64](0), - DirectPlay: plexgo.Pointer[float64](0), - DirectStream: plexgo.Pointer[float64](0), - SubtitleSize: plexgo.Pointer[float64](100), - Subtites: plexgo.Pointer("burn"), - AudioBoost: plexgo.Pointer[float64](100), - Location: plexgo.Pointer("lan"), - MediaBufferSize: plexgo.Pointer[float64](102400), - Session: plexgo.Pointer("zvcage8b7rkioqcm8f4uns4c"), - AddDebugOverlay: plexgo.Pointer[float64](0), - AutoAdjustQuality: plexgo.Pointer[float64](0), + res, err := s.Transcoder.MakeDecision(ctx, operations.MakeDecisionRequest{ + TranscodeType: components.TranscodeTypeMusic, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.LocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.ProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDecision != nil { + // handle response + } + } + - target: $["paths"]["/{transcodeType}/:/transcode/universal/fallback"]["post"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.TriggerFallback(ctx, operations.TriggerFallbackRequest{ + TranscodeType: components.TranscodeTypeAudio, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/{transcodeType}/:/transcode/universal/start.{extension}"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.StartTranscodeSession(ctx, operations.StartTranscodeSessionRequest{ + TranscodeType: components.TranscodeTypeMusic, + Extension: operations.ExtensionMpd, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.StartTranscodeSessionQueryParamLocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.StartTranscodeSessionQueryParamProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != nil { + // handle response + } + } + - target: $["paths"]["/{transcodeType}/:/transcode/universal/subtitles"]["get"] + update: + x-codeSamples: + - lang: go + label: PlexGO + source: |- + package main + + import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.TranscodeSubtitles(ctx, operations.TranscodeSubtitlesRequest{ + TranscodeType: components.TranscodeTypeAudio, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.QueryParamLocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.QueryParamProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), }) if err != nil { log.Fatal(err) diff --git a/collections.go b/collections.go new file mode 100644 index 0000000..a812cac --- /dev/null +++ b/collections.go @@ -0,0 +1,260 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Collections - API Operations against the Collections +type Collections struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newCollections(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Collections { + return &Collections{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// CreateCollection - Create collection +// Create a collection in the library +func (s *Collections) CreateCollection(ctx context.Context, request operations.CreateCollectionRequest, opts ...operations.Option) (*operations.CreateCollectionResponse, error) { + globals := operations.CreateCollectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/collections") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createCollection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateCollectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/content.go b/content.go new file mode 100644 index 0000000..19a40cc --- /dev/null +++ b/content.go @@ -0,0 +1,2925 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" +) + +// Content - The actual content of the media provider +type Content struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newContent(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Content { + return &Content{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetCollectionItems - Get items in a collection +// Get items in a collection. Note if this collection contains more than 100 items, paging must be used. +func (s *Content) GetCollectionItems(ctx context.Context, request operations.GetCollectionItemsRequest, opts ...operations.Option) (*operations.GetCollectionItemsResponse, error) { + globals := operations.GetCollectionItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/collections/{collectionId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCollectionItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCollectionItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetMetadataItem - Get a metadata item +// Get one or more metadata items. +func (s *Content) GetMetadataItem(ctx context.Context, request operations.GetMetadataItemRequest, opts ...operations.Option) (*operations.GetMetadataItemResponse, error) { + globals := operations.GetMetadataItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getMetadataItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetMetadataItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetAlbums - Set section albums +// Get all albums in a music section +func (s *Content) GetAlbums(ctx context.Context, request operations.GetAlbumsRequest, opts ...operations.Option) (*operations.GetAlbumsResponse, error) { + globals := operations.GetAlbumsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/albums", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAlbums", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAlbumsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListContent - Get items in the section +// Get the items in a section, potentially filtering them +func (s *Content) ListContent(ctx context.Context, request operations.ListContentRequest, opts ...operations.Option) (*operations.ListContentResponse, error) { + globals := operations.ListContentGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/all", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listContent", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListContentResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetAllLeaves - Set section leaves +// Get all leaves in a section (such as episodes in a show section) +func (s *Content) GetAllLeaves(ctx context.Context, request operations.GetAllLeavesRequest, opts ...operations.Option) (*operations.GetAllLeavesResponse, error) { + globals := operations.GetAllLeavesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/allLeaves", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAllLeaves", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAllLeavesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetArts - Set section artwork +// Get artwork for a library section +func (s *Content) GetArts(ctx context.Context, request operations.GetArtsRequest, opts ...operations.Option) (*operations.GetArtsResponse, error) { + globals := operations.GetArtsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/arts", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getArts", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetArtsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithArtwork + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithArtwork = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCategories - Set section categories +// Get categories in a library section +func (s *Content) GetCategories(ctx context.Context, request operations.GetCategoriesRequest, opts ...operations.Option) (*operations.GetCategoriesResponse, error) { + globals := operations.GetCategoriesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/categories", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCategories", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCategoriesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithArtwork + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithArtwork = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCluster - Set section clusters +// Get clusters in a library section (typically for photos) +func (s *Content) GetCluster(ctx context.Context, request operations.GetClusterRequest, opts ...operations.Option) (*operations.GetClusterResponse, error) { + globals := operations.GetClusterGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/cluster", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCluster", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetClusterResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithArtwork + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithArtwork = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSonicPath - Similar tracks to transition from one to another +// Get a list of audio tracks starting at one and ending at another which are similar across the path +func (s *Content) GetSonicPath(ctx context.Context, request operations.GetSonicPathRequest, opts ...operations.Option) (*operations.GetSonicPathResponse, error) { + globals := operations.GetSonicPathGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/computePath", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSonicPath", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSonicPathResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetFolders - Get all folder locations +// Get all folder locations of the media in a section +func (s *Content) GetFolders(ctx context.Context, request operations.GetFoldersRequest, opts ...operations.Option) (*operations.GetFoldersResponse, error) { + globals := operations.GetFoldersGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/location", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getFolders", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetFoldersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetFoldersResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListMoments - Set section moments +// Get moments in a library section (typically for photos) +func (s *Content) ListMoments(ctx context.Context, request operations.ListMomentsRequest, opts ...operations.Option) (*operations.ListMomentsResponse, error) { + globals := operations.ListMomentsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/moment", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listMoments", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListMomentsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithArtwork + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithArtwork = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSonicallySimilar - The nearest audio tracks +// Get the nearest audio tracks to a particular analysis +func (s *Content) GetSonicallySimilar(ctx context.Context, request operations.GetSonicallySimilarRequest, opts ...operations.Option) (*operations.GetSonicallySimilarResponse, error) { + globals := operations.GetSonicallySimilarGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/nearest", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSonicallySimilar", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSonicallySimilarResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCollectionImage - Get a collection's image +// Get an image for the collection based on the items within +func (s *Content) GetCollectionImage(ctx context.Context, request operations.GetCollectionImageRequest, opts ...operations.Option) (*operations.GetCollectionImageResponse, error) { + globals := operations.GetCollectionImageGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/collections/{collectionId}/composite/{updatedAt}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCollectionImage", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "image/jpeg") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCollectionImageResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/devices.go b/devices.go new file mode 100644 index 0000000..68474ee --- /dev/null +++ b/devices.go @@ -0,0 +1,2918 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Devices - Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices +// +// Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below. +// +// Example SSDP output +// ``` +// +// +// +// 1 +// 0 +// +// +// urn:plex-tv:device:Media:1 +// Turing Hopper 3000 +// Plex, Inc. +// https://plex.tv/ +// Turing Hopper 3000 Media Grabber +// Plex Media Grabber +// 1 +// https://plex.tv +// uuid:42fde8e4-93b6-41e5-8a63-12d848655811 +// +// +// http://10.0.0.5:8088 +// urn:plex-tv:service:MediaGrabber:1 +// urn:plex-tv:serviceId:MediaGrabber +// +// +// +// +// +// ``` +// +// - UDN: (string) A UUID for the device. This should be unique across models of a device at minimum. +// - URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted. +type Devices struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newDevices(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Devices { + return &Devices{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetAvailableGrabbers - Get available grabbers +// Get available grabbers visible to the server +func (s *Devices) GetAvailableGrabbers(ctx context.Context, request operations.GetAvailableGrabbersRequest, opts ...operations.Option) (*operations.GetAvailableGrabbersResponse, error) { + globals := operations.GetAvailableGrabbersGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/grabbers") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAvailableGrabbers", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAvailableGrabbersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetAvailableGrabbersResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListDevices - Get all devices +// Get the list of all devices present +func (s *Devices) ListDevices(ctx context.Context, opts ...operations.Option) (*operations.ListDevicesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/grabbers/devices") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listDevices", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListDevicesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddDevice - Add a device +// This endpoint adds a device to an existing grabber. The device is identified, and added to the correct grabber. +func (s *Devices) AddDevice(ctx context.Context, request operations.AddDeviceRequest, opts ...operations.Option) (*operations.AddDeviceResponse, error) { + globals := operations.AddDeviceGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/grabbers/devices") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addDevice", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddDeviceResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DiscoverDevices - Tell grabbers to discover devices +// Tell grabbers to discover devices +func (s *Devices) DiscoverDevices(ctx context.Context, opts ...operations.Option) (*operations.DiscoverDevicesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/grabbers/devices/discover") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "discoverDevices", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DiscoverDevicesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RemoveDevice - Remove a device +// Remove a devices by its id along with its channel mappings +func (s *Devices) RemoveDevice(ctx context.Context, request operations.RemoveDeviceRequest, opts ...operations.Option) (*operations.RemoveDeviceResponse, error) { + globals := operations.RemoveDeviceGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "removeDevice", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RemoveDeviceResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.RemoveDeviceResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetDeviceDetails - Get device details +// Get a device's details by its id +func (s *Devices) GetDeviceDetails(ctx context.Context, request operations.GetDeviceDetailsRequest, opts ...operations.Option) (*operations.GetDeviceDetailsResponse, error) { + globals := operations.GetDeviceDetailsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getDeviceDetails", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetDeviceDetailsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ModifyDevice - Enable or disable a device +// Enable or disable a device by its id +func (s *Devices) ModifyDevice(ctx context.Context, request operations.ModifyDeviceRequest, opts ...operations.Option) (*operations.ModifyDeviceResponse, error) { + globals := operations.ModifyDeviceGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "modifyDevice", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ModifyDeviceResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ModifyDeviceResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetChannelmap - Set a device's channel mapping +// Set a device's channel mapping +func (s *Devices) SetChannelmap(ctx context.Context, request operations.SetChannelmapRequest, opts ...operations.Option) (*operations.SetChannelmapResponse, error) { + globals := operations.SetChannelmapGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}/channelmap", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setChannelmap", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetChannelmapResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetDevicesChannels - Get a device's channels +// Get a device's channels by its id +func (s *Devices) GetDevicesChannels(ctx context.Context, request operations.GetDevicesChannelsRequest, opts ...operations.Option) (*operations.GetDevicesChannelsResponse, error) { + globals := operations.GetDevicesChannelsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}/channels", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getDevicesChannels", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetDevicesChannelsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetDevicesChannelsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetDevicePreferences - Set device preferences +// Set device preferences by its id +func (s *Devices) SetDevicePreferences(ctx context.Context, request operations.SetDevicePreferencesRequest, opts ...operations.Option) (*operations.SetDevicePreferencesResponse, error) { + globals := operations.SetDevicePreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}/prefs", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setDevicePreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetDevicePreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StopScan - Tell a device to stop scanning for channels +// Tell a device to stop scanning for channels +func (s *Devices) StopScan(ctx context.Context, request operations.StopScanRequest, opts ...operations.Option) (*operations.StopScanResponse, error) { + globals := operations.StopScanGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}/scan", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "stopScan", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StopScanResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Scan - Tell a device to scan for channels +// Tell a device to scan for channels +func (s *Devices) Scan(ctx context.Context, request operations.ScanRequest, opts ...operations.Option) (*operations.ScanResponse, error) { + globals := operations.ScanGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}/scan", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "scan", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ScanResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDevice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDevice = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetThumb - Get device thumb +// Get a device's thumb for display to the user +func (s *Devices) GetThumb(ctx context.Context, request operations.GetThumbRequest, opts ...operations.Option) (*operations.GetThumbResponse, error) { + globals := operations.GetThumbGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/devices/{deviceId}/thumb/{version}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getThumb", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetThumbResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 301: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/docs/models/components/accepts.md b/docs/models/components/accepts.md new file mode 100644 index 0000000..2bf5cf2 --- /dev/null +++ b/docs/models/components/accepts.md @@ -0,0 +1,9 @@ +# Accepts + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `AcceptsApplicationJSON` | application/json | +| `AcceptsApplicationXML` | application/xml | \ No newline at end of file diff --git a/docs/models/components/advancedsubtitles.md b/docs/models/components/advancedsubtitles.md new file mode 100644 index 0000000..ee8d876 --- /dev/null +++ b/docs/models/components/advancedsubtitles.md @@ -0,0 +1,10 @@ +# AdvancedSubtitles + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `AdvancedSubtitlesBurn` | burn | +| `AdvancedSubtitlesText` | text | +| `AdvancedSubtitlesUnknown` | unknown | \ No newline at end of file diff --git a/docs/models/components/airingstype.md b/docs/models/components/airingstype.md new file mode 100644 index 0000000..1288a21 --- /dev/null +++ b/docs/models/components/airingstype.md @@ -0,0 +1,9 @@ +# AiringsType + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `AiringsTypeNewAiringsOnly` | New Airings Only | +| `AiringsTypeNewAndRepeatAirings` | New and Repeat Airings | \ No newline at end of file diff --git a/docs/models/components/boolint.md b/docs/models/components/boolint.md new file mode 100644 index 0000000..3cb1a89 --- /dev/null +++ b/docs/models/components/boolint.md @@ -0,0 +1,9 @@ +# BoolInt + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `BoolIntZero` | 0 | +| `BoolIntOne` | 1 | \ No newline at end of file diff --git a/docs/models/components/channel.md b/docs/models/components/channel.md new file mode 100644 index 0000000..38806fd --- /dev/null +++ b/docs/models/components/channel.md @@ -0,0 +1,15 @@ +# Channel + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `CallSign` | **string* | :heavy_minus_sign: | N/A | +| `ChannelVcn` | **string* | :heavy_minus_sign: | N/A | +| `Hd` | **bool* | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/channelmapping.md b/docs/models/components/channelmapping.md new file mode 100644 index 0000000..b006916 --- /dev/null +++ b/docs/models/components/channelmapping.md @@ -0,0 +1,11 @@ +# ChannelMapping + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ChannelKey` | **string* | :heavy_minus_sign: | N/A | +| `DeviceIdentifier` | **string* | :heavy_minus_sign: | N/A | +| `Enabled` | **string* | :heavy_minus_sign: | N/A | +| `LineupIdentifier` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/composite.md b/docs/models/components/composite.md new file mode 100644 index 0000000..5980406 --- /dev/null +++ b/docs/models/components/composite.md @@ -0,0 +1,18 @@ +# Composite + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Type` | **int64* | :heavy_minus_sign: | Limit composite to specified metadata types | +| `Format` | [*components.Format](../../models/components/format.md) | :heavy_minus_sign: | The image type | +| `BackgroundColor` | **string* | :heavy_minus_sign: | 6 character hex RGB value for background color for image | +| `Border` | **int64* | :heavy_minus_sign: | The width of the intra-image border | +| `Cols` | **int64* | :heavy_minus_sign: | Number of columns to construct in the composite image | +| `Crop` | [*components.Crop](../../models/components/crop.md) | :heavy_minus_sign: | Where to crop source images to fit into composite image proportions | +| `Height` | **int64* | :heavy_minus_sign: | The height of the image | +| `Media` | [*components.CompositeMedia](../../models/components/compositemedia.md) | :heavy_minus_sign: | The default image type to use as the sources | +| `Repeat` | **bool* | :heavy_minus_sign: | Allow repetion of images if there are not enough source images to fill grid | +| `Rows` | **int64* | :heavy_minus_sign: | Number of rows to construct in the composite image | +| `Width` | **int64* | :heavy_minus_sign: | The width of the image | \ No newline at end of file diff --git a/docs/models/components/compositemedia.md b/docs/models/components/compositemedia.md new file mode 100644 index 0000000..9848a68 --- /dev/null +++ b/docs/models/components/compositemedia.md @@ -0,0 +1,12 @@ +# CompositeMedia + +The default image type to use as the sources + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `CompositeMediaThumb` | thumb | +| `CompositeMediaArt` | art | +| `CompositeMediaBanner` | banner | \ No newline at end of file diff --git a/docs/models/components/crop.md b/docs/models/components/crop.md new file mode 100644 index 0000000..d3e2599 --- /dev/null +++ b/docs/models/components/crop.md @@ -0,0 +1,11 @@ +# Crop + +Where to crop source images to fit into composite image proportions + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `CropCenter` | center | +| `CropTop` | top | \ No newline at end of file diff --git a/docs/models/components/decision.md b/docs/models/components/decision.md new file mode 100644 index 0000000..2111710 --- /dev/null +++ b/docs/models/components/decision.md @@ -0,0 +1,10 @@ +# Decision + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `DecisionDirectplay` | directplay | +| `DecisionTranscode` | transcode | +| `DecisionNone` | none | \ No newline at end of file diff --git a/docs/models/components/default.md b/docs/models/components/default.md new file mode 100644 index 0000000..5487746 --- /dev/null +++ b/docs/models/components/default.md @@ -0,0 +1,25 @@ +# Default + +The default value of this setting + + +## Supported Types + +### + +```go +default := components.CreateDefaultStr(string{/* values here */}) +``` + +### + +```go +default := components.CreateDefaultNumber(float64{/* values here */}) +``` + +### + +```go +default := components.CreateDefaultBoolean(bool{/* values here */}) +``` + diff --git a/docs/models/components/defaultdirection.md b/docs/models/components/defaultdirection.md new file mode 100644 index 0000000..d994c49 --- /dev/null +++ b/docs/models/components/defaultdirection.md @@ -0,0 +1,11 @@ +# DefaultDirection + +This default diction of this sort + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `DefaultDirectionAsc` | asc | +| `DefaultDirectionDesc` | desc | \ No newline at end of file diff --git a/docs/models/components/device.md b/docs/models/components/device.md new file mode 100644 index 0000000..8abc14e --- /dev/null +++ b/docs/models/components/device.md @@ -0,0 +1,20 @@ +# Device + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ChannelMapping` | [][components.ChannelMapping](../../models/components/channelmapping.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `LastSeenAt` | **int64* | :heavy_minus_sign: | N/A | +| `Make` | **string* | :heavy_minus_sign: | N/A | +| `Model` | **string* | :heavy_minus_sign: | N/A | +| `ModelNumber` | **string* | :heavy_minus_sign: | N/A | +| `Protocol` | **string* | :heavy_minus_sign: | N/A | +| `Sources` | **string* | :heavy_minus_sign: | N/A | +| `State` | **string* | :heavy_minus_sign: | N/A | +| `Status` | **string* | :heavy_minus_sign: | N/A | +| `Tuners` | **string* | :heavy_minus_sign: | N/A | +| `URI` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/directory.md b/docs/models/components/directory.md new file mode 100644 index 0000000..2523c6a --- /dev/null +++ b/docs/models/components/directory.md @@ -0,0 +1,23 @@ +# Directory + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Art` | **string* | :heavy_minus_sign: | N/A | +| `Content` | **bool* | :heavy_minus_sign: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | N/A | +| `HasPrefs` | **bool* | :heavy_minus_sign: | N/A | +| `HasStoreServices` | **bool* | :heavy_minus_sign: | N/A | +| `HubKey` | **string* | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `LastAccessedAt` | **int64* | :heavy_minus_sign: | N/A | +| `Pivot` | [][components.Pivot](../../models/components/pivot.md) | :heavy_minus_sign: | N/A | +| `Share` | **int64* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `TitleBar` | **string* | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/dvr.md b/docs/models/components/dvr.md new file mode 100644 index 0000000..425ec25 --- /dev/null +++ b/docs/models/components/dvr.md @@ -0,0 +1,12 @@ +# Dvr + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/dvrrequesthandlerslashgetresponses200.md b/docs/models/components/dvrrequesthandlerslashgetresponses200.md new file mode 100644 index 0000000..d42ac5e --- /dev/null +++ b/docs/models/components/dvrrequesthandlerslashgetresponses200.md @@ -0,0 +1,10 @@ +# DvrRequestHandlerSlashGetResponses200 + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.DvrRequestHandlerSlashGetResponses200MediaContainer](../../models/components/dvrrequesthandlerslashgetresponses200mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainer.md b/docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainer.md new file mode 100644 index 0000000..9191c8a --- /dev/null +++ b/docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainer.md @@ -0,0 +1,9 @@ +# DvrRequestHandlerSlashGetResponses200MediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer](../../models/components/dvrrequesthandlerslashgetresponses200mediacontainermediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][components.Dvr](../../models/components/dvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainermediacontainer.md b/docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainermediacontainer.md new file mode 100644 index 0000000..b1d97d9 --- /dev/null +++ b/docs/models/components/dvrrequesthandlerslashgetresponses200mediacontainermediacontainer.md @@ -0,0 +1,17 @@ +# DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/components/filter.md b/docs/models/components/filter.md new file mode 100644 index 0000000..b080433 --- /dev/null +++ b/docs/models/components/filter.md @@ -0,0 +1,27 @@ +# Filter + +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 important subset useful for top-level API. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | The title for the filter. | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Art` | **string* | :heavy_minus_sign: | N/A | +| `Content` | **bool* | :heavy_minus_sign: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | This represents the filter name used for the filter, which can be used to construct complex media queries with. | +| `HasPrefs` | **bool* | :heavy_minus_sign: | N/A | +| `HasStoreServices` | **bool* | :heavy_minus_sign: | N/A | +| `HubKey` | **string* | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | 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. | +| `LastAccessedAt` | **int64* | :heavy_minus_sign: | N/A | +| `Pivot` | [][components.FilterPivot](../../models/components/filterpivot.md) | :heavy_minus_sign: | N/A | +| `Share` | **int64* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `TitleBar` | **string* | :heavy_minus_sign: | N/A | +| `FilterType` | **string* | :heavy_minus_sign: | This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter. | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/filterpivot.md b/docs/models/components/filterpivot.md new file mode 100644 index 0000000..14ac76d --- /dev/null +++ b/docs/models/components/filterpivot.md @@ -0,0 +1,13 @@ +# FilterPivot + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Context` | **string* | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Symbol` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/format.md b/docs/models/components/format.md new file mode 100644 index 0000000..91f1be7 --- /dev/null +++ b/docs/models/components/format.md @@ -0,0 +1,11 @@ +# Format + +The image type + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `FormatJpg` | jpg | +| `FormatPng` | png | \ No newline at end of file diff --git a/docs/models/components/getresponses200.md b/docs/models/components/getresponses200.md new file mode 100644 index 0000000..80ca79b --- /dev/null +++ b/docs/models/components/getresponses200.md @@ -0,0 +1,10 @@ +# GetResponses200 + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.GetResponses200MediaContainer](../../models/components/getresponses200mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/getresponses200hub.md b/docs/models/components/getresponses200hub.md new file mode 100644 index 0000000..68f2347 --- /dev/null +++ b/docs/models/components/getresponses200hub.md @@ -0,0 +1,14 @@ +# GetResponses200Hub + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `HomeVisibility` | [*components.HomeVisibility](../../models/components/homevisibility.md) | :heavy_minus_sign: | Whether this hub is visible on the home screen
- all: Visible to all users
- none: Visible to no users
- admin: Visible to only admin users
- shared: Visible to shared users
| +| `Identifier` | **string* | :heavy_minus_sign: | The identifier for this hub | +| `PromotedToOwnHome` | **bool* | :heavy_minus_sign: | Whether this hub is visible to admin user home | +| `PromotedToRecommended` | **bool* | :heavy_minus_sign: | Whether this hub is promoted to all for recommendations | +| `PromotedToSharedHome` | **bool* | :heavy_minus_sign: | Whether this hub is visible to shared user's home | +| `RecommendationsVisibility` | [*components.RecommendationsVisibility](../../models/components/recommendationsvisibility.md) | :heavy_minus_sign: | The visibility of this hub in recommendations:
- all: Visible to all users
- none: Visible to no users
- admin: Visible to only admin users
- shared: Visible to shared users
| +| `Title` | **string* | :heavy_minus_sign: | The title of this hub | \ No newline at end of file diff --git a/docs/models/components/getresponses200mediacontainer.md b/docs/models/components/getresponses200mediacontainer.md new file mode 100644 index 0000000..6fd5428 --- /dev/null +++ b/docs/models/components/getresponses200mediacontainer.md @@ -0,0 +1,17 @@ +# GetResponses200MediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.GetResponses200Hub](../../models/components/getresponses200hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/historyallgetresponses200.md b/docs/models/components/historyallgetresponses200.md new file mode 100644 index 0000000..354129b --- /dev/null +++ b/docs/models/components/historyallgetresponses200.md @@ -0,0 +1,10 @@ +# HistoryAllGetResponses200 + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.HistoryAllGetResponses200MediaContainer](../../models/components/historyallgetresponses200mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/historyallgetresponses200mediacontainer.md b/docs/models/components/historyallgetresponses200mediacontainer.md new file mode 100644 index 0000000..19f91a0 --- /dev/null +++ b/docs/models/components/historyallgetresponses200mediacontainer.md @@ -0,0 +1,17 @@ +# HistoryAllGetResponses200MediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [][components.HistoryAllGetResponses200Metadata](../../models/components/historyallgetresponses200metadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/historyallgetresponses200metadata.md b/docs/models/components/historyallgetresponses200metadata.md new file mode 100644 index 0000000..d735e3d --- /dev/null +++ b/docs/models/components/historyallgetresponses200metadata.md @@ -0,0 +1,18 @@ +# HistoryAllGetResponses200Metadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `AccountID` | **int64* | :heavy_minus_sign: | The account id of this playback | +| `DeviceID` | **int64* | :heavy_minus_sign: | The device id which played the item | +| `HistoryKey` | **string* | :heavy_minus_sign: | The key for this individual history item | +| `Key` | **string* | :heavy_minus_sign: | The metadata key for the item played | +| `LibrarySectionID` | **string* | :heavy_minus_sign: | The library section id containing the item played | +| `OriginallyAvailableAt` | **string* | :heavy_minus_sign: | The originally available at of the item played | +| `RatingKey` | **string* | :heavy_minus_sign: | The rating key for the item played | +| `Thumb` | **string* | :heavy_minus_sign: | The thumb of the item played | +| `Title` | **string* | :heavy_minus_sign: | The title of the item played | +| `Type` | **string* | :heavy_minus_sign: | The metadata type of the item played | +| `ViewedAt` | **int64* | :heavy_minus_sign: | The time when the item was played | \ No newline at end of file diff --git a/docs/models/components/homevisibility.md b/docs/models/components/homevisibility.md new file mode 100644 index 0000000..f276624 --- /dev/null +++ b/docs/models/components/homevisibility.md @@ -0,0 +1,18 @@ +# HomeVisibility + +Whether this hub is visible on the home screen + - all: Visible to all users + - none: Visible to no users + - admin: Visible to only admin users + - shared: Visible to shared users + + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `HomeVisibilityAll` | all | +| `HomeVisibilityNone` | none | +| `HomeVisibilityAdmin` | admin | +| `HomeVisibilityShared` | shared | \ No newline at end of file diff --git a/docs/models/components/hub.md b/docs/models/components/hub.md new file mode 100644 index 0000000..dd8cd2c --- /dev/null +++ b/docs/models/components/hub.md @@ -0,0 +1,22 @@ +# Hub + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | A title for this grouping of content | | +| `Type` | **string* | :heavy_minus_sign: | The type of the items contained in this hub, or possibly `mixed` if there are multiple types | track | +| `Context` | **string* | :heavy_minus_sign: | N/A | hub.home.onDeck | +| `HubIdentifier` | **string* | :heavy_minus_sign: | A unique identifier for the hub | home.onDeck | +| `HubKey` | **string* | :heavy_minus_sign: | A key at which the exact content currently displayed can be fetched again. This is particularly important when a hub is marked as random and requesting the `key` may get different results. It's otherwise optional.
| | +| `Key` | **string* | :heavy_minus_sign: | The key at which all of the content for this hub can be retrieved | /hubs/sections/home/onDeck | +| `Metadata` | [][components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | N/A | | +| `More` | **bool* | :heavy_minus_sign: | "A boolean indicating that the hub contains more than what's included in the current response."
| | +| `Promoted` | **bool* | :heavy_minus_sign: | Indicating if the hub should be promoted to the user's homescreen | | +| `Random` | **bool* | :heavy_minus_sign: | Indicating that the contents of the hub may change on each request | | +| `Size` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `Style` | **string* | :heavy_minus_sign: | A suggestion on how this hub's contents might be displayed by a client. Some examples include `hero`, `list`, `spotlight`, and `upsell` | | +| `Subtype` | **string* | :heavy_minus_sign: | The subtype of the items contained in this hub, or possibly `mixed` if there are multiple types | podcast | +| `TotalSize` | **int64* | :heavy_minus_sign: | N/A | 8 | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/image.md b/docs/models/components/image.md new file mode 100644 index 0000000..dbf131b --- /dev/null +++ b/docs/models/components/image.md @@ -0,0 +1,13 @@ +# Image + +Images such as movie posters and background artwork are represented by Image elements. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Type` | [*components.ImageType](../../models/components/imagetype.md) | :heavy_minus_sign: | Describes both the purpose and intended presentation of the image. | +| `Alt` | **string* | :heavy_minus_sign: | Title to use for accessibility. | +| `URL` | **string* | :heavy_minus_sign: | The relative path or absolute url for the image. | \ No newline at end of file diff --git a/docs/models/components/imagetype.md b/docs/models/components/imagetype.md new file mode 100644 index 0000000..b1630b0 --- /dev/null +++ b/docs/models/components/imagetype.md @@ -0,0 +1,14 @@ +# ImageType + +Describes both the purpose and intended presentation of the image. + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `ImageTypeBackground` | background | +| `ImageTypeBanner` | banner | +| `ImageTypeClearLogo` | clearLogo | +| `ImageTypeCoverPoster` | coverPoster | +| `ImageTypeSnapshot` | snapshot | \ No newline at end of file diff --git a/docs/models/components/items.md b/docs/models/components/items.md new file mode 100644 index 0000000..2071f08 --- /dev/null +++ b/docs/models/components/items.md @@ -0,0 +1,83 @@ +# Items + +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `Media` | [][components.Media](../../models/components/media.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `MetadataItem` | [][components.Items](../../models/components/items.md) | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/librarysection.md b/docs/models/components/librarysection.md new file mode 100644 index 0000000..d5c2950 --- /dev/null +++ b/docs/models/components/librarysection.md @@ -0,0 +1,27 @@ +# LibrarySection + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Agent` | **string* | :heavy_minus_sign: | N/A | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | +| `Art` | **string* | :heavy_minus_sign: | N/A | +| `Composite` | **string* | :heavy_minus_sign: | N/A | +| `Content` | **bool* | :heavy_minus_sign: | N/A | +| `ContentChangedAt` | **int64* | :heavy_minus_sign: | N/A | +| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | +| `Directory` | **bool* | :heavy_minus_sign: | N/A | +| `Filters` | **bool* | :heavy_minus_sign: | Indicates whether this section has filtering capabilities | +| `Hidden` | **bool* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Location` | [][components.LibrarySectionLocation](../../models/components/librarysectionlocation.md) | :heavy_minus_sign: | N/A | +| `Refreshing` | **bool* | :heavy_minus_sign: | Indicates whether this library section is currently scanning | +| `ScannedAt` | **int64* | :heavy_minus_sign: | N/A | +| `Scanner` | **string* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/librarysectionlocation.md b/docs/models/components/librarysectionlocation.md new file mode 100644 index 0000000..f011997 --- /dev/null +++ b/docs/models/components/librarysectionlocation.md @@ -0,0 +1,11 @@ +# LibrarySectionLocation + +Represents a top-level location on disk where media in this library section is stored + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `Path` | *any* | :heavy_minus_sign: | The path of where this directory exists on disk | \ No newline at end of file diff --git a/docs/models/components/lineup.md b/docs/models/components/lineup.md new file mode 100644 index 0000000..522efca --- /dev/null +++ b/docs/models/components/lineup.md @@ -0,0 +1,12 @@ +# Lineup + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | The type of this object (`lineup` in this case) | +| `LineupType` | [*components.LineupType](../../models/components/lineuptype.md) | :heavy_minus_sign: | - `-1`: N/A
- `0`: Over the air
- `1`: Cable
- `2`: Satellite
- `3`: IPTV
- `4`: Virtual
| +| `Location` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | The uuid of this lineup | \ No newline at end of file diff --git a/docs/models/components/lineuptype.md b/docs/models/components/lineuptype.md new file mode 100644 index 0000000..aeb9daa --- /dev/null +++ b/docs/models/components/lineuptype.md @@ -0,0 +1,21 @@ +# LineupType + +- `-1`: N/A +- `0`: Over the air +- `1`: Cable +- `2`: Satellite +- `3`: IPTV +- `4`: Virtual + + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `LineupTypeMinus1` | -1 | +| `LineupTypeZero` | 0 | +| `LineupTypeOne` | 1 | +| `LineupTypeTwo` | 2 | +| `LineupTypeThree` | 3 | +| `LineupTypeFour` | 4 | \ No newline at end of file diff --git a/docs/models/components/location.md b/docs/models/components/location.md new file mode 100644 index 0000000..e1bddb5 --- /dev/null +++ b/docs/models/components/location.md @@ -0,0 +1,10 @@ +# Location + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `LocationLan` | lan | +| `LocationWan` | wan | +| `LocationCellular` | cellular | \ No newline at end of file diff --git a/docs/models/components/media.md b/docs/models/components/media.md new file mode 100644 index 0000000..aea8bca --- /dev/null +++ b/docs/models/components/media.md @@ -0,0 +1,29 @@ +# Media + +`Media` represents an one or more media files (parts) and is a child of a metadata item. There aren't necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 2.35 | +| `AudioChannels` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `AudioCodec` | *any* | :heavy_minus_sign: | N/A | aac | +| `AudioProfile` | *any* | :heavy_minus_sign: | N/A | lc | +| `Bitrate` | **int64* | :heavy_minus_sign: | N/A | 5612 | +| `Container` | *any* | :heavy_minus_sign: | N/A | mov | +| `Duration` | **int64* | :heavy_minus_sign: | N/A | 150192 | +| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | +| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | N/A | true | +| `Height` | **int64* | :heavy_minus_sign: | N/A | 544 | +| `ID` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | false | +| `Part` | [][components.Part](../../models/components/part.md) | :heavy_minus_sign: | N/A | | +| `VideoCodec` | *any* | :heavy_minus_sign: | N/A | h264 | +| `VideoFrameRate` | *any* | :heavy_minus_sign: | N/A | 24p | +| `VideoProfile` | *any* | :heavy_minus_sign: | N/A | main | +| `VideoResolution` | *any* | :heavy_minus_sign: | N/A | 720 | +| `Width` | **int64* | :heavy_minus_sign: | N/A | 1280 | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/mediacontainer.md b/docs/models/components/mediacontainer.md new file mode 100644 index 0000000..69c7eb3 --- /dev/null +++ b/docs/models/components/mediacontainer.md @@ -0,0 +1,16 @@ +# MediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithartwork.md b/docs/models/components/mediacontainerwithartwork.md new file mode 100644 index 0000000..5085d2b --- /dev/null +++ b/docs/models/components/mediacontainerwithartwork.md @@ -0,0 +1,8 @@ +# MediaContainerWithArtwork + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithArtworkMediaContainer](../../models/components/mediacontainerwithartworkmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithartworkmediacontainer.md b/docs/models/components/mediacontainerwithartworkmediacontainer.md new file mode 100644 index 0000000..8a090be --- /dev/null +++ b/docs/models/components/mediacontainerwithartworkmediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithArtworkMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [][components.MediaContainerWithArtworkMetadata](../../models/components/mediacontainerwithartworkmetadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithartworkmetadata.md b/docs/models/components/mediacontainerwithartworkmetadata.md new file mode 100644 index 0000000..ad30485 --- /dev/null +++ b/docs/models/components/mediacontainerwithartworkmetadata.md @@ -0,0 +1,11 @@ +# MediaContainerWithArtworkMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | The title of the item | +| `Type` | [*components.MediaContainerWithArtworkType](../../models/components/mediacontainerwithartworktype.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | The path to the artwork | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithartworktype.md b/docs/models/components/mediacontainerwithartworktype.md new file mode 100644 index 0000000..6eb4a20 --- /dev/null +++ b/docs/models/components/mediacontainerwithartworktype.md @@ -0,0 +1,8 @@ +# MediaContainerWithArtworkType + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `MediaContainerWithArtworkTypeImage` | image | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecision.md b/docs/models/components/mediacontainerwithdecision.md new file mode 100644 index 0000000..9e4f0bd --- /dev/null +++ b/docs/models/components/mediacontainerwithdecision.md @@ -0,0 +1,13 @@ +# MediaContainerWithDecision + +`MediaContainer` is commonly found as the root of a response and is a pretty generic container. Common attributes include `identifier` and things related to paging (`offset`, `size`, `totalSize`). + +It is also common for a `MediaContainer` to contain attributes "hoisted" from its children. If every element in the container would have had the same attribute, then that attribute can be present on the container instead of being repeated on every element. For example, an album's list of tracks might include `parentTitle` on the container since all of the tracks have the same album title. A container may have a `source` attribute when all of the items came from the same source. Generally speaking, when looking for an attribute on an item, if the attribute wasn't found then the container should be checked for that attribute as well. + + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithDecisionMediaContainer](../../models/components/mediacontainerwithdecisionmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisiondecision.md b/docs/models/components/mediacontainerwithdecisiondecision.md new file mode 100644 index 0000000..04f1c28 --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisiondecision.md @@ -0,0 +1,13 @@ +# MediaContainerWithDecisionDecision + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `MediaContainerWithDecisionDecisionCopy` | copy | +| `MediaContainerWithDecisionDecisionTranscode` | transcode | +| `MediaContainerWithDecisionDecisionBurn` | burn | +| `MediaContainerWithDecisionDecisionUnavailable` | unavailable | +| `MediaContainerWithDecisionDecisionIgnore` | ignore | +| `MediaContainerWithDecisionDecisionNone` | none | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisionlocation.md b/docs/models/components/mediacontainerwithdecisionlocation.md new file mode 100644 index 0000000..9efe244 --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisionlocation.md @@ -0,0 +1,15 @@ +# MediaContainerWithDecisionLocation + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `MediaContainerWithDecisionLocationDirect` | direct | +| `MediaContainerWithDecisionLocationSidecarSubs` | sidecar-subs | +| `MediaContainerWithDecisionLocationSegmentsVideo` | segments-video | +| `MediaContainerWithDecisionLocationSegmentsAudio` | segments-audio | +| `MediaContainerWithDecisionLocationSegmentsAv` | segments-av | +| `MediaContainerWithDecisionLocationSegmentsSubs` | segments-subs | +| `MediaContainerWithDecisionLocationEmbedded` | embedded | +| `MediaContainerWithDecisionLocationSidecar` | sidecar | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisionmedia.md b/docs/models/components/mediacontainerwithdecisionmedia.md new file mode 100644 index 0000000..7aaa78a --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisionmedia.md @@ -0,0 +1,32 @@ +# MediaContainerWithDecisionMedia + +`Media` represents an one or more media files (parts) and is a child of a metadata item. There aren't necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element. + + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 2.35 | +| `AudioChannels` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `AudioCodec` | *any* | :heavy_minus_sign: | N/A | aac | +| `AudioProfile` | *any* | :heavy_minus_sign: | N/A | lc | +| `Bitrate` | **int64* | :heavy_minus_sign: | N/A | 5612 | +| `Container` | *any* | :heavy_minus_sign: | N/A | mov | +| `Duration` | **int64* | :heavy_minus_sign: | N/A | 150192 | +| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | +| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | N/A | true | +| `Height` | **int64* | :heavy_minus_sign: | N/A | 544 | +| `ID` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | false | +| `Part` | [][components.MediaContainerWithDecisionPart](../../models/components/mediacontainerwithdecisionpart.md) | :heavy_minus_sign: | N/A | | +| `VideoCodec` | *any* | :heavy_minus_sign: | N/A | h264 | +| `VideoFrameRate` | *any* | :heavy_minus_sign: | N/A | 24p | +| `VideoProfile` | *any* | :heavy_minus_sign: | N/A | main | +| `VideoResolution` | *any* | :heavy_minus_sign: | N/A | 720 | +| `Width` | **int64* | :heavy_minus_sign: | N/A | 1280 | +| `Abr` | **bool* | :heavy_minus_sign: | N/A | | +| `ResourceSession` | **string* | :heavy_minus_sign: | N/A | | +| `Selected` | **bool* | :heavy_minus_sign: | N/A | | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisionmediacontainer.md b/docs/models/components/mediacontainerwithdecisionmediacontainer.md new file mode 100644 index 0000000..c7a6df4 --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisionmediacontainer.md @@ -0,0 +1,26 @@ +# MediaContainerWithDecisionMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `AvailableBandwidth` | **int64* | :heavy_minus_sign: | The maximum available bitrate when the decision was rendered. | +| `DirectPlayDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `DirectPlayDecisionText` | **string* | :heavy_minus_sign: | N/A | +| `GeneralDecisionCode` | **int64* | :heavy_minus_sign: | The overall decision. 1xxx are playback can succeed, 2xxx are a general error (such as insufficient bandwidth), 3xxx are errors in direct play, and 4xxx are errors in transcodes. Same codes are used in all. | +| `GeneralDecisionText` | **string* | :heavy_minus_sign: | N/A | +| `MdeDecisionCode` | **int64* | :heavy_minus_sign: | The code indicating the status of evaluation of playback when client indicates `hasMDE=1` | +| `MdeDecisionText` | **string* | :heavy_minus_sign: | Descriptive text for the above code | +| `Metadata` | [][components.MediaContainerWithDecisionMetadata](../../models/components/mediacontainerwithdecisionmetadata.md) | :heavy_minus_sign: | N/A | +| `TranscodeDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `TranscodeDecisionText` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisionmetadata.md b/docs/models/components/mediacontainerwithdecisionmetadata.md new file mode 100644 index 0000000..c2d81fb --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisionmetadata.md @@ -0,0 +1,82 @@ +# MediaContainerWithDecisionMetadata + +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `Media` | [][components.MediaContainerWithDecisionMedia](../../models/components/mediacontainerwithdecisionmedia.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisionpart.md b/docs/models/components/mediacontainerwithdecisionpart.md new file mode 100644 index 0000000..f33ff5e --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisionpart.md @@ -0,0 +1,24 @@ +# MediaContainerWithDecisionPart + +`Part` represents a particular file or "part" of a media item. The part is the playable unit of the media hierarchy. Suppose that a movie library contains a movie that is broken up into files, reminiscent of a movie split across two BDs. The metadata item represents information about the movie, the media item represents this instance of the movie at this resolution and quality, and the part items represent the two playable files. If another media were added which contained the joining of these two parts transcoded down to a lower resolution, then this metadata would contain 2 medias, one with 2 parts and one with 1 part. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `AudioProfile` | *any* | :heavy_minus_sign: | N/A | lc | +| `Container` | *any* | :heavy_minus_sign: | The container of the media file, such as `mp4` or `mkv` | mov | +| `Duration` | **int64* | :heavy_minus_sign: | The duration of the media item, in milliseconds | 150192 | +| `File` | *any* | :heavy_minus_sign: | The local file path at which the part is stored on the server | /home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov | +| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | +| `ID` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `Key` | *any* | :heavy_minus_sign: | The key from which the media can be streamed | /library/parts/1/1531779263/file.mov | +| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | false | +| `Size` | **int64* | :heavy_minus_sign: | The size of the media, in bytes | 105355654 | +| `Stream` | [][components.MediaContainerWithDecisionStream](../../models/components/mediacontainerwithdecisionstream.md) | :heavy_minus_sign: | N/A | | +| `VideoProfile` | *any* | :heavy_minus_sign: | N/A | main | +| `Decision` | [*components.Decision](../../models/components/decision.md) | :heavy_minus_sign: | N/A | | +| `Selected` | **bool* | :heavy_minus_sign: | N/A | | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdecisionstream.md b/docs/models/components/mediacontainerwithdecisionstream.md new file mode 100644 index 0000000..9e61e28 --- /dev/null +++ b/docs/models/components/mediacontainerwithdecisionstream.md @@ -0,0 +1,42 @@ +# MediaContainerWithDecisionStream + +`Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream. Note that photos do not have streams (mostly as an optimization). + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `Default` | **bool* | :heavy_minus_sign: | N/A | true | +| `AudioChannelLayout` | *any* | :heavy_minus_sign: | N/A | stereo | +| `BitDepth` | **int64* | :heavy_minus_sign: | N/A | 8 | +| `Bitrate` | **int64* | :heavy_minus_sign: | N/A | 5466 | +| `CanAutoSync` | **bool* | :heavy_minus_sign: | For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video. | true | +| `ChromaLocation` | *any* | :heavy_minus_sign: | N/A | topleft | +| `ChromaSubsampling` | *any* | :heavy_minus_sign: | N/A | 4:2:0 | +| `Codec` | *any* | :heavy_minus_sign: | The codec of the stream, such as `h264` or `aac` | h264 | +| `ColorPrimaries` | *any* | :heavy_minus_sign: | N/A | bt709 | +| `ColorRange` | *any* | :heavy_minus_sign: | N/A | tv | +| `ColorSpace` | *any* | :heavy_minus_sign: | N/A | bt709 | +| `ColorTrc` | *any* | :heavy_minus_sign: | N/A | bt709 | +| `DisplayTitle` | *any* | :heavy_minus_sign: | A friendly name for the stream, often comprised of the language and codec information | English (H.264 Main) | +| `FrameRate` | **float64* | :heavy_minus_sign: | N/A | 23.976 | +| `HasScalingMatrix` | *any* | :heavy_minus_sign: | N/A | false | +| `Height` | **int64* | :heavy_minus_sign: | N/A | 544 | +| `ID` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `Index` | **int64* | :heavy_minus_sign: | If the stream is part of the `Part` and not an external resource, the index of the stream within that part | 0 | +| `Key` | *any* | :heavy_minus_sign: | If the stream is independently streamable, the key from which it can be streamed | /library/streams/1 | +| `Language` | *any* | :heavy_minus_sign: | N/A | English | +| `LanguageCode` | *any* | :heavy_minus_sign: | The three character language code for the stream contents | eng | +| `Level` | **int64* | :heavy_minus_sign: | N/A | 31 | +| `Profile` | *any* | :heavy_minus_sign: | N/A | main | +| `RefFrames` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `SamplingRate` | **int64* | :heavy_minus_sign: | N/A | 48000 | +| `Selected` | **bool* | :heavy_minus_sign: | N/A | | +| `StreamIdentifier` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `StreamType` | **int64* | :heavy_minus_sign: | A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics | 1 | +| `Width` | **int64* | :heavy_minus_sign: | N/A | 1280 | +| `Decision` | [*components.MediaContainerWithDecisionDecision](../../models/components/mediacontainerwithdecisiondecision.md) | :heavy_minus_sign: | N/A | | +| `Location` | [*components.MediaContainerWithDecisionLocation](../../models/components/mediacontainerwithdecisionlocation.md) | :heavy_minus_sign: | N/A | | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdevice.md b/docs/models/components/mediacontainerwithdevice.md new file mode 100644 index 0000000..bb5e09b --- /dev/null +++ b/docs/models/components/mediacontainerwithdevice.md @@ -0,0 +1,8 @@ +# MediaContainerWithDevice + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithDeviceMediaContainer](../../models/components/mediacontainerwithdevicemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdevicedevice.md b/docs/models/components/mediacontainerwithdevicedevice.md new file mode 100644 index 0000000..48d06aa --- /dev/null +++ b/docs/models/components/mediacontainerwithdevicedevice.md @@ -0,0 +1,20 @@ +# MediaContainerWithDeviceDevice + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ChannelMapping` | [][components.ChannelMapping](../../models/components/channelmapping.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `LastSeenAt` | **int64* | :heavy_minus_sign: | N/A | +| `Make` | **string* | :heavy_minus_sign: | N/A | +| `Model` | **string* | :heavy_minus_sign: | N/A | +| `ModelNumber` | **string* | :heavy_minus_sign: | N/A | +| `Protocol` | **string* | :heavy_minus_sign: | N/A | +| `Sources` | **string* | :heavy_minus_sign: | N/A | +| `State` | **string* | :heavy_minus_sign: | N/A | +| `Status` | **string* | :heavy_minus_sign: | N/A | +| `Tuners` | **string* | :heavy_minus_sign: | N/A | +| `URI` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdevicemediacontainer.md b/docs/models/components/mediacontainerwithdevicemediacontainer.md new file mode 100644 index 0000000..3b409d3 --- /dev/null +++ b/docs/models/components/mediacontainerwithdevicemediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithDeviceMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Device` | [][components.MediaContainerWithDeviceDevice](../../models/components/mediacontainerwithdevicedevice.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdirectory.md b/docs/models/components/mediacontainerwithdirectory.md new file mode 100644 index 0000000..d754c7a --- /dev/null +++ b/docs/models/components/mediacontainerwithdirectory.md @@ -0,0 +1,8 @@ +# MediaContainerWithDirectory + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithDirectoryMediaContainer](../../models/components/mediacontainerwithdirectorymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithdirectorymediacontainer.md b/docs/models/components/mediacontainerwithdirectorymediacontainer.md new file mode 100644 index 0000000..f3f4cc2 --- /dev/null +++ b/docs/models/components/mediacontainerwithdirectorymediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithDirectoryMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][components.Directory](../../models/components/directory.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithhubs.md b/docs/models/components/mediacontainerwithhubs.md new file mode 100644 index 0000000..9df0b05 --- /dev/null +++ b/docs/models/components/mediacontainerwithhubs.md @@ -0,0 +1,10 @@ +# MediaContainerWithHubs + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithHubsMediaContainer](../../models/components/mediacontainerwithhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithhubsmediacontainer.md b/docs/models/components/mediacontainerwithhubsmediacontainer.md new file mode 100644 index 0000000..6129f22 --- /dev/null +++ b/docs/models/components/mediacontainerwithhubsmediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithlineup.md b/docs/models/components/mediacontainerwithlineup.md new file mode 100644 index 0000000..5823f25 --- /dev/null +++ b/docs/models/components/mediacontainerwithlineup.md @@ -0,0 +1,8 @@ +# MediaContainerWithLineup + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithLineupMediaContainer](../../models/components/mediacontainerwithlineupmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithlineupmediacontainer.md b/docs/models/components/mediacontainerwithlineupmediacontainer.md new file mode 100644 index 0000000..3886e3d --- /dev/null +++ b/docs/models/components/mediacontainerwithlineupmediacontainer.md @@ -0,0 +1,18 @@ +# MediaContainerWithLineupMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Lineup` | [][components.Lineup](../../models/components/lineup.md) | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | The UUID of this set lineups | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithmetadata.md b/docs/models/components/mediacontainerwithmetadata.md new file mode 100644 index 0000000..0f9bd4d --- /dev/null +++ b/docs/models/components/mediacontainerwithmetadata.md @@ -0,0 +1,8 @@ +# MediaContainerWithMetadata + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithMetadataMediaContainer](../../models/components/mediacontainerwithmetadatamediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithmetadatamediacontainer.md b/docs/models/components/mediacontainerwithmetadatamediacontainer.md new file mode 100644 index 0000000..101092e --- /dev/null +++ b/docs/models/components/mediacontainerwithmetadatamediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithMetadataMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [][components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithnestedmetadata.md b/docs/models/components/mediacontainerwithnestedmetadata.md new file mode 100644 index 0000000..f83c59b --- /dev/null +++ b/docs/models/components/mediacontainerwithnestedmetadata.md @@ -0,0 +1,8 @@ +# MediaContainerWithNestedMetadata + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithNestedMetadataMediaContainer](../../models/components/mediacontainerwithnestedmetadatamediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithnestedmetadatamediacontainer.md b/docs/models/components/mediacontainerwithnestedmetadatamediacontainer.md new file mode 100644 index 0000000..d714c32 --- /dev/null +++ b/docs/models/components/mediacontainerwithnestedmetadatamediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithNestedMetadataMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `MetadataItem` | [][components.MetadataItem](../../models/components/metadataitem.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithplaylistmetadata.md b/docs/models/components/mediacontainerwithplaylistmetadata.md new file mode 100644 index 0000000..a6e286f --- /dev/null +++ b/docs/models/components/mediacontainerwithplaylistmetadata.md @@ -0,0 +1,8 @@ +# MediaContainerWithPlaylistMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithPlaylistMetadataMediaContainer](../../models/components/mediacontainerwithplaylistmetadatamediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithplaylistmetadatamediacontainer.md b/docs/models/components/mediacontainerwithplaylistmetadatamediacontainer.md new file mode 100644 index 0000000..f58ef50 --- /dev/null +++ b/docs/models/components/mediacontainerwithplaylistmetadatamediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithPlaylistMetadataMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [][components.MediaContainerWithPlaylistMetadataMetadata](../../models/components/mediacontainerwithplaylistmetadatametadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithplaylistmetadatametadata.md b/docs/models/components/mediacontainerwithplaylistmetadatametadata.md new file mode 100644 index 0000000..02bf15f --- /dev/null +++ b/docs/models/components/mediacontainerwithplaylistmetadatametadata.md @@ -0,0 +1,86 @@ +# MediaContainerWithPlaylistMetadataMetadata + +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ReadOnly` | **bool* | :heavy_minus_sign: | If we return this as true then this playlist cannot be altered or deleted directly by the client. | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `PlaylistType` | [*components.PlaylistType](../../models/components/playlisttype.md) | :heavy_minus_sign: | The type of the playlist. | +| `Smart` | **bool* | :heavy_minus_sign: | Whether or not the playlist is smart. | +| `SpecialPlaylistType` | **string* | :heavy_minus_sign: | If this is a special playlist, this returns its type (e.g. favorites). | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `Media` | [][components.Media](../../models/components/media.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithsettings.md b/docs/models/components/mediacontainerwithsettings.md new file mode 100644 index 0000000..4ef4c30 --- /dev/null +++ b/docs/models/components/mediacontainerwithsettings.md @@ -0,0 +1,8 @@ +# MediaContainerWithSettings + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithSettingsMediaContainer](../../models/components/mediacontainerwithsettingsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithsettingsmediacontainer.md b/docs/models/components/mediacontainerwithsettingsmediacontainer.md new file mode 100644 index 0000000..5eeaf38 --- /dev/null +++ b/docs/models/components/mediacontainerwithsettingsmediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithSettingsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Setting` | [][components.Setting](../../models/components/setting.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithsubscription.md b/docs/models/components/mediacontainerwithsubscription.md new file mode 100644 index 0000000..d513daf --- /dev/null +++ b/docs/models/components/mediacontainerwithsubscription.md @@ -0,0 +1,8 @@ +# MediaContainerWithSubscription + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.MediaContainerWithSubscriptionMediaContainer](../../models/components/mediacontainerwithsubscriptionmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediacontainerwithsubscriptionmediacontainer.md b/docs/models/components/mediacontainerwithsubscriptionmediacontainer.md new file mode 100644 index 0000000..94ffef8 --- /dev/null +++ b/docs/models/components/mediacontainerwithsubscriptionmediacontainer.md @@ -0,0 +1,17 @@ +# MediaContainerWithSubscriptionMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `MediaSubscription` | [][components.MediaSubscription](../../models/components/mediasubscription.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediagraboperation.md b/docs/models/components/mediagraboperation.md new file mode 100644 index 0000000..0d3309e --- /dev/null +++ b/docs/models/components/mediagraboperation.md @@ -0,0 +1,21 @@ +# MediaGrabOperation + +A media grab opration represents a scheduled or active recording of media + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CurrentSize` | **int64* | :heavy_minus_sign: | N/A | +| `GrabberIdentifier` | **string* | :heavy_minus_sign: | N/A | +| `GrabberProtocol` | **string* | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `MediaIndex` | **int64* | :heavy_minus_sign: | N/A | +| `MediaSubscriptionID` | **int64* | :heavy_minus_sign: | N/A | +| `Metadata` | [*components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie.

Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items.

Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show.
| +| `Percent` | **float64* | :heavy_minus_sign: | N/A | +| `Provider` | **string* | :heavy_minus_sign: | N/A | +| `Status` | [*components.Status](../../models/components/status.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mediaquery.md b/docs/models/components/mediaquery.md new file mode 100644 index 0000000..72cbb9c --- /dev/null +++ b/docs/models/components/mediaquery.md @@ -0,0 +1,7 @@ +# MediaQuery + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/mediasubscription.md b/docs/models/components/mediasubscription.md new file mode 100644 index 0000000..f554c84 --- /dev/null +++ b/docs/models/components/mediasubscription.md @@ -0,0 +1,26 @@ +# MediaSubscription + +A media subscription contains a representation of metadata desired to be recorded + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type of the root item of the subscription | +| `AiringsType` | [*components.AiringsType](../../models/components/airingstype.md) | :heavy_minus_sign: | N/A | +| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | +| `Directory` | map[string]*any* | :heavy_minus_sign: | Media Matching Hints | +| `DurationTotal` | **int64* | :heavy_minus_sign: | Only included if `includeStorage` is specified | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | +| `LocationPath` | **string* | :heavy_minus_sign: | N/A | +| `MediaGrabOperation` | [][components.MediaGrabOperation](../../models/components/mediagraboperation.md) | :heavy_minus_sign: | N/A | +| `Playlist` | map[string]*any* | :heavy_minus_sign: | Media Matching Hints | +| `Setting` | [][components.Setting](../../models/components/setting.md) | :heavy_minus_sign: | N/A | +| `StorageTotal` | **int64* | :heavy_minus_sign: | Only included if `includeStorage` is specified | +| `TargetLibrarySectionID` | **int64* | :heavy_minus_sign: | The library section id for where the item is to be recorded | +| `TargetSectionLocationID` | **int64* | :heavy_minus_sign: | The library section location id for where the item is to be recorded | +| `Video` | map[string]*any* | :heavy_minus_sign: | Media Matching Hints | \ No newline at end of file diff --git a/docs/models/components/metadata.md b/docs/models/components/metadata.md new file mode 100644 index 0000000..a175d74 --- /dev/null +++ b/docs/models/components/metadata.md @@ -0,0 +1,82 @@ +# Metadata + +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `Media` | [][components.Media](../../models/components/media.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/metadataitem.md b/docs/models/components/metadataitem.md new file mode 100644 index 0000000..0d5d0fc --- /dev/null +++ b/docs/models/components/metadataitem.md @@ -0,0 +1,83 @@ +# MetadataItem + +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `Media` | [][components.Media](../../models/components/media.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `MetadataItem` | [][components.Items](../../models/components/items.md) | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/part.md b/docs/models/components/part.md new file mode 100644 index 0000000..0e12cda --- /dev/null +++ b/docs/models/components/part.md @@ -0,0 +1,22 @@ +# Part + +`Part` represents a particular file or "part" of a media item. The part is the playable unit of the media hierarchy. Suppose that a movie library contains a movie that is broken up into files, reminiscent of a movie split across two BDs. The metadata item represents information about the movie, the media item represents this instance of the movie at this resolution and quality, and the part items represent the two playable files. If another media were added which contained the joining of these two parts transcoded down to a lower resolution, then this metadata would contain 2 medias, one with 2 parts and one with 1 part. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `AudioProfile` | *any* | :heavy_minus_sign: | N/A | lc | +| `Container` | *any* | :heavy_minus_sign: | The container of the media file, such as `mp4` or `mkv` | mov | +| `Duration` | **int64* | :heavy_minus_sign: | The duration of the media item, in milliseconds | 150192 | +| `File` | *any* | :heavy_minus_sign: | The local file path at which the part is stored on the server | /home/schuyler/Videos/Trailers/Cloud Atlas (2012).mov | +| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | +| `ID` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `Key` | *any* | :heavy_minus_sign: | The key from which the media can be streamed | /library/parts/1/1531779263/file.mov | +| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | false | +| `Size` | **int64* | :heavy_minus_sign: | The size of the media, in bytes | 105355654 | +| `Stream` | [][components.Stream](../../models/components/stream.md) | :heavy_minus_sign: | N/A | | +| `VideoProfile` | *any* | :heavy_minus_sign: | N/A | main | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/pivot.md b/docs/models/components/pivot.md similarity index 100% rename from docs/models/operations/pivot.md rename to docs/models/components/pivot.md index d3e3949..c9065bf 100644 --- a/docs/models/operations/pivot.md +++ b/docs/models/components/pivot.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Context` | **string* | :heavy_minus_sign: | N/A | | `ID` | **string* | :heavy_minus_sign: | N/A | | `Key` | **string* | :heavy_minus_sign: | N/A | -| `Type` | **string* | :heavy_minus_sign: | N/A | -| `Title` | **string* | :heavy_minus_sign: | N/A | -| `Context` | **string* | :heavy_minus_sign: | N/A | | `Symbol` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/player.md b/docs/models/components/player.md new file mode 100644 index 0000000..ec44305 --- /dev/null +++ b/docs/models/components/player.md @@ -0,0 +1,24 @@ +# Player + +Information about the player being used for playback + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | The title of the client | +| `Address` | **string* | :heavy_minus_sign: | The remote address | +| `Local` | **bool* | :heavy_minus_sign: | Indicating if the client is playing from the local LAN | +| `MachineIdentifier` | **string* | :heavy_minus_sign: | The identifier of the client | +| `Model` | **string* | :heavy_minus_sign: | The model of the client | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The platformVersion of the client | +| `Product` | **string* | :heavy_minus_sign: | The product name of the client | +| `Relayed` | **bool* | :heavy_minus_sign: | Indicating if the client is playing over a relay connection | +| `RemotePublicAddress` | **string* | :heavy_minus_sign: | The client's public address | +| `Secure` | **bool* | :heavy_minus_sign: | Indicating if the client is playing over HTTPS | +| `State` | **string* | :heavy_minus_sign: | The client's last reported state | +| `UserID` | **int64* | :heavy_minus_sign: | The id of the user | +| `Vendor` | **string* | :heavy_minus_sign: | The vendor of the client | +| `Version` | **string* | :heavy_minus_sign: | The version of the client | \ No newline at end of file diff --git a/docs/models/components/playlisttype.md b/docs/models/components/playlisttype.md new file mode 100644 index 0000000..f3dd4c2 --- /dev/null +++ b/docs/models/components/playlisttype.md @@ -0,0 +1,12 @@ +# PlaylistType + +The type of the playlist. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `PlaylistTypeAudio` | audio | +| `PlaylistTypeVideo` | video | +| `PlaylistTypePhoto` | photo | \ No newline at end of file diff --git a/docs/models/components/postresponses200.md b/docs/models/components/postresponses200.md new file mode 100644 index 0000000..4475f79 --- /dev/null +++ b/docs/models/components/postresponses200.md @@ -0,0 +1,10 @@ +# PostResponses200 + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.PostResponses200MediaContainer](../../models/components/postresponses200mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/postresponses200mediacontainer.md b/docs/models/components/postresponses200mediacontainer.md new file mode 100644 index 0000000..04c6550 --- /dev/null +++ b/docs/models/components/postresponses200mediacontainer.md @@ -0,0 +1,23 @@ +# PostResponses200MediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Color` | **string* | :heavy_minus_sign: | N/A | +| `EndTimeOffset` | **int64* | :heavy_minus_sign: | N/A | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `StartTimeOffset` | **int64* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | [*components.PostResponses200Type](../../models/components/postresponses200type.md) | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/postresponses200type.md b/docs/models/components/postresponses200type.md new file mode 100644 index 0000000..a15b458 --- /dev/null +++ b/docs/models/components/postresponses200type.md @@ -0,0 +1,12 @@ +# PostResponses200Type + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `PostResponses200TypeIntro` | intro | +| `PostResponses200TypeCommercial` | commercial | +| `PostResponses200TypeBookmark` | bookmark | +| `PostResponses200TypeResume` | resume | +| `PostResponses200TypeCredit` | credit | \ No newline at end of file diff --git a/docs/models/components/protocol.md b/docs/models/components/protocol.md new file mode 100644 index 0000000..a40b060 --- /dev/null +++ b/docs/models/components/protocol.md @@ -0,0 +1,10 @@ +# Protocol + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `ProtocolHTTP` | http | +| `ProtocolHls` | hls | +| `ProtocolDash` | dash | \ No newline at end of file diff --git a/docs/models/components/recommendationsvisibility.md b/docs/models/components/recommendationsvisibility.md new file mode 100644 index 0000000..3b9f26a --- /dev/null +++ b/docs/models/components/recommendationsvisibility.md @@ -0,0 +1,18 @@ +# RecommendationsVisibility + +The visibility of this hub in recommendations: + - all: Visible to all users + - none: Visible to no users + - admin: Visible to only admin users + - shared: Visible to shared users + + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `RecommendationsVisibilityAll` | all | +| `RecommendationsVisibilityNone` | none | +| `RecommendationsVisibilityAdmin` | admin | +| `RecommendationsVisibilityShared` | shared | \ No newline at end of file diff --git a/docs/models/components/requesthandlerslashgetresponses200.md b/docs/models/components/requesthandlerslashgetresponses200.md new file mode 100644 index 0000000..c79379b --- /dev/null +++ b/docs/models/components/requesthandlerslashgetresponses200.md @@ -0,0 +1,10 @@ +# RequestHandlerSlashGetResponses200 + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.RequestHandlerSlashGetResponses200MediaContainer](../../models/components/requesthandlerslashgetresponses200mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/requesthandlerslashgetresponses200directory.md b/docs/models/components/requesthandlerslashgetresponses200directory.md new file mode 100644 index 0000000..3e95484 --- /dev/null +++ b/docs/models/components/requesthandlerslashgetresponses200directory.md @@ -0,0 +1,10 @@ +# RequestHandlerSlashGetResponses200Directory + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `Count` | **int64* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | The key where this directory is found | +| `Title` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/requesthandlerslashgetresponses200mediacontainer.md b/docs/models/components/requesthandlerslashgetresponses200mediacontainer.md new file mode 100644 index 0000000..be01f22 --- /dev/null +++ b/docs/models/components/requesthandlerslashgetresponses200mediacontainer.md @@ -0,0 +1,65 @@ +# RequestHandlerSlashGetResponses200MediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| | +| `Size` | **int64* | :heavy_minus_sign: | N/A | | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| | +| `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` | **int64* | :heavy_minus_sign: | N/A | 7 | +| `MachineIdentifier` | *any* | :heavy_minus_sign: | N/A | 0123456789abcdef0123456789abcdef012345678 | +| `MediaProviders` | **bool* | :heavy_minus_sign: | N/A | | +| `Multiuser` | **bool* | :heavy_minus_sign: | N/A | | +| `MusicAnalysis` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `MyPlex` | **bool* | :heavy_minus_sign: | N/A | | +| `MyPlexMappingState` | *any* | :heavy_minus_sign: | N/A | mapped | +| `MyPlexSigninState` | *any* | :heavy_minus_sign: | N/A | ok | +| `MyPlexSubscription` | **bool* | :heavy_minus_sign: | N/A | | +| `MyPlexUsername` | **string* | :heavy_minus_sign: | N/A | | +| `OfflineTranscode` | *any* | :heavy_minus_sign: | N/A | 1 | +| `OwnerFeatures` | **string* | :heavy_minus_sign: | A comma-separated list of features which are enabled for the server owner | | +| `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` | **int64* | :heavy_minus_sign: | N/A | | +| `StreamingBrainVersion` | **int64* | :heavy_minus_sign: | N/A | | +| `Sync` | **bool* | :heavy_minus_sign: | N/A | | +| `TranscoderActiveVideoSessions` | **int64* | :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` | *any* | :heavy_minus_sign: | The suggested video quality bitrates to present to the user | | +| `TranscoderVideoQualities` | **string* | :heavy_minus_sign: | N/A | | +| `TranscoderVideoResolutions` | *any* | :heavy_minus_sign: | The suggested video resolutions to the above quality bitrates | | +| `UpdatedAt` | **int64* | :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` | [][components.RequestHandlerSlashGetResponses200Directory](../../models/components/requesthandlerslashgetresponses200directory.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/security.md b/docs/models/components/security.md index 1ac74be..ab74f27 100644 --- a/docs/models/components/security.md +++ b/docs/models/components/security.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `AccessToken` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Token` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/session.md b/docs/models/components/session.md new file mode 100644 index 0000000..00556e3 --- /dev/null +++ b/docs/models/components/session.md @@ -0,0 +1,12 @@ +# Session + +Information about the playback session + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Bandwidth` | **int64* | :heavy_minus_sign: | The bandwidth used by this client's playback in kbps | +| `ID` | **string* | :heavy_minus_sign: | The id of the playback session | +| `Location` | [*components.SessionLocation](../../models/components/sessionlocation.md) | :heavy_minus_sign: | The location of the client | \ No newline at end of file diff --git a/docs/models/components/sessionlocation.md b/docs/models/components/sessionlocation.md new file mode 100644 index 0000000..c68128b --- /dev/null +++ b/docs/models/components/sessionlocation.md @@ -0,0 +1,11 @@ +# SessionLocation + +The location of the client + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `SessionLocationLan` | lan | +| `SessionLocationWan` | wan | \ No newline at end of file diff --git a/docs/models/components/setting.md b/docs/models/components/setting.md new file mode 100644 index 0000000..304aee8 --- /dev/null +++ b/docs/models/components/setting.md @@ -0,0 +1,19 @@ +# Setting + +A configuration setting or preference + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `Type` | [*components.Type](../../models/components/type.md) | :heavy_minus_sign: | The type of the value of this setting | +| `Default` | [*components.Default](../../models/components/default.md) | :heavy_minus_sign: | The default value of this setting | +| `Advanced` | **bool* | :heavy_minus_sign: | Whether the setting is considered advanced and normally hidden from the user | +| `EnumValues` | **string* | :heavy_minus_sign: | The possible values for this setting if restricted. The list is `\|` separated with `value:name` entries. | +| `Group` | **string* | :heavy_minus_sign: | The group name of this setting to aid in display of a hierarchy | +| `Hidden` | **bool* | :heavy_minus_sign: | Whether the setting is hidden or not | +| `ID` | **string* | :heavy_minus_sign: | The query parameter name for this setting | +| `Label` | **string* | :heavy_minus_sign: | A user-friendly name for the setting | +| `Summary` | **string* | :heavy_minus_sign: | A description of the setting | +| `Value` | [*components.Value](../../models/components/value.md) | :heavy_minus_sign: | The current value of this setting | \ No newline at end of file diff --git a/docs/models/components/slashgetresponses200.md b/docs/models/components/slashgetresponses200.md new file mode 100644 index 0000000..20d3c04 --- /dev/null +++ b/docs/models/components/slashgetresponses200.md @@ -0,0 +1,10 @@ +# SlashGetResponses200 + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*components.SlashGetResponses200MediaContainer](../../models/components/slashgetresponses200mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/slashgetresponses200mediacontainer.md b/docs/models/components/slashgetresponses200mediacontainer.md new file mode 100644 index 0000000..696640e --- /dev/null +++ b/docs/models/components/slashgetresponses200mediacontainer.md @@ -0,0 +1,21 @@ +# SlashGetResponses200MediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Content` | **string* | :heavy_minus_sign: | The 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": true` 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": true` which used to be used to allow clients to build search dialogs on the fly. | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | +| `Art` | **string* | :heavy_minus_sign: | N/A | +| `Directory` | [][components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `LibrarySectionID` | **int64* | :heavy_minus_sign: | N/A | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | +| `MediaTagVersion` | **int64* | :heavy_minus_sign: | N/A | +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `SortAsc` | **bool* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `Title1` | **string* | :heavy_minus_sign: | N/A | +| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | +| `ViewMode` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/sort.md b/docs/models/components/sort.md new file mode 100644 index 0000000..6f18e7a --- /dev/null +++ b/docs/models/components/sort.md @@ -0,0 +1,30 @@ +# Sort + +Each `Sort` object contains a description of the sort field. + + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | The title of the field. | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Art` | **string* | :heavy_minus_sign: | N/A | +| `Content` | **bool* | :heavy_minus_sign: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | N/A | +| `HasPrefs` | **bool* | :heavy_minus_sign: | N/A | +| `HasStoreServices` | **bool* | :heavy_minus_sign: | N/A | +| `HubKey` | **string* | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | The key to use in the sort field to make items sort by this item | +| `LastAccessedAt` | **int64* | :heavy_minus_sign: | N/A | +| `Pivot` | [][components.SortPivot](../../models/components/sortpivot.md) | :heavy_minus_sign: | N/A | +| `Share` | **int64* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `TitleBar` | **string* | :heavy_minus_sign: | N/A | +| `Default` | [*components.SortDefault](../../models/components/sortdefault.md) | :heavy_minus_sign: | If present, this sort is the default and in this direction | +| `DefaultDirection` | [*components.DefaultDirection](../../models/components/defaultdirection.md) | :heavy_minus_sign: | This default diction of this sort | +| `DescKey` | **string* | :heavy_minus_sign: | The key for sorting this field in reverse order | +| `FirstCharacterKey` | **string* | :heavy_minus_sign: | The key to use to get items sorted by this field and indexed by the first character | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/sortdefault.md b/docs/models/components/sortdefault.md new file mode 100644 index 0000000..43effa5 --- /dev/null +++ b/docs/models/components/sortdefault.md @@ -0,0 +1,11 @@ +# SortDefault + +If present, this sort is the default and in this direction + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `SortDefaultAsc` | asc | +| `SortDefaultDesc` | desc | \ No newline at end of file diff --git a/docs/models/components/sortpivot.md b/docs/models/components/sortpivot.md new file mode 100644 index 0000000..6fa026f --- /dev/null +++ b/docs/models/components/sortpivot.md @@ -0,0 +1,13 @@ +# SortPivot + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Context` | **string* | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Symbol` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/status.md b/docs/models/components/status.md new file mode 100644 index 0000000..0bcfc02 --- /dev/null +++ b/docs/models/components/status.md @@ -0,0 +1,15 @@ +# Status + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `StatusInactive` | inactive | +| `StatusScheduled` | scheduled | +| `StatusInprogress` | inprogress | +| `StatusComplete` | complete | +| `StatusCancelled` | cancelled | +| `StatusError` | error | +| `StatusPostprocessing` | postprocessing | +| `StatusPaused` | paused | \ No newline at end of file diff --git a/docs/models/components/stream.md b/docs/models/components/stream.md new file mode 100644 index 0000000..8c42634 --- /dev/null +++ b/docs/models/components/stream.md @@ -0,0 +1,40 @@ +# Stream + +`Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream. Note that photos do not have streams (mostly as an optimization). + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `Default` | **bool* | :heavy_minus_sign: | N/A | true | +| `AudioChannelLayout` | *any* | :heavy_minus_sign: | N/A | stereo | +| `BitDepth` | **int64* | :heavy_minus_sign: | N/A | 8 | +| `Bitrate` | **int64* | :heavy_minus_sign: | N/A | 5466 | +| `CanAutoSync` | **bool* | :heavy_minus_sign: | For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video. | true | +| `ChromaLocation` | *any* | :heavy_minus_sign: | N/A | topleft | +| `ChromaSubsampling` | *any* | :heavy_minus_sign: | N/A | 4:2:0 | +| `Codec` | *any* | :heavy_minus_sign: | The codec of the stream, such as `h264` or `aac` | h264 | +| `ColorPrimaries` | *any* | :heavy_minus_sign: | N/A | bt709 | +| `ColorRange` | *any* | :heavy_minus_sign: | N/A | tv | +| `ColorSpace` | *any* | :heavy_minus_sign: | N/A | bt709 | +| `ColorTrc` | *any* | :heavy_minus_sign: | N/A | bt709 | +| `DisplayTitle` | *any* | :heavy_minus_sign: | A friendly name for the stream, often comprised of the language and codec information | English (H.264 Main) | +| `FrameRate` | **float64* | :heavy_minus_sign: | N/A | 23.976 | +| `HasScalingMatrix` | *any* | :heavy_minus_sign: | N/A | false | +| `Height` | **int64* | :heavy_minus_sign: | N/A | 544 | +| `ID` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `Index` | **int64* | :heavy_minus_sign: | If the stream is part of the `Part` and not an external resource, the index of the stream within that part | 0 | +| `Key` | *any* | :heavy_minus_sign: | If the stream is independently streamable, the key from which it can be streamed | /library/streams/1 | +| `Language` | *any* | :heavy_minus_sign: | N/A | English | +| `LanguageCode` | *any* | :heavy_minus_sign: | The three character language code for the stream contents | eng | +| `Level` | **int64* | :heavy_minus_sign: | N/A | 31 | +| `Profile` | *any* | :heavy_minus_sign: | N/A | main | +| `RefFrames` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `SamplingRate` | **int64* | :heavy_minus_sign: | N/A | 48000 | +| `Selected` | **bool* | :heavy_minus_sign: | N/A | | +| `StreamIdentifier` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `StreamType` | **int64* | :heavy_minus_sign: | A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics | 1 | +| `Width` | **int64* | :heavy_minus_sign: | N/A | 1280 | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/subtitles.md b/docs/models/components/subtitles.md new file mode 100644 index 0000000..85e43b0 --- /dev/null +++ b/docs/models/components/subtitles.md @@ -0,0 +1,14 @@ +# Subtitles + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `SubtitlesAuto` | auto | +| `SubtitlesBurn` | burn | +| `SubtitlesNone` | none | +| `SubtitlesSidecar` | sidecar | +| `SubtitlesEmbedded` | embedded | +| `SubtitlesSegmented` | segmented | +| `SubtitlesUnknown` | unknown | \ No newline at end of file diff --git a/docs/models/components/tag.md b/docs/models/components/tag.md new file mode 100644 index 0000000..2e3671b --- /dev/null +++ b/docs/models/components/tag.md @@ -0,0 +1,20 @@ +# Tag + +A variety of extra information about a metadata item is included as tags. These tags use their own element names such as `Genre`, `Writer`, `Directory`, and `Role`. Individual tag types may introduce their own extra attributes. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `Confidence` | **float64* | :heavy_minus_sign: | Measure of the confidence of an automatic tag | | +| `Context` | **string* | :heavy_minus_sign: | N/A | | +| `Filter` | *any* | :heavy_minus_sign: | A filter parameter that can be used to query for more content that matches this tag value. | actor=49 | +| `ID` | **int64* | :heavy_minus_sign: | N/A | | +| `RatingKey` | **string* | :heavy_minus_sign: | N/A | | +| `Role` | *any* | :heavy_minus_sign: | The role this actor played | Secretary | +| `Tag` | *any* | :heavy_minus_sign: | The value of the tag (the name) | Shaun Lawton | +| `TagKey` | *any* | :heavy_minus_sign: | Plex identifier for this tag which can be used to fetch additional information from plex.tv | 5d3ee12c4cde6a001c3e0b27 | +| `TagType` | **int64* | :heavy_minus_sign: | N/A | | +| `Thumb` | *any* | :heavy_minus_sign: | N/A | http://image.tmdb.org/t/p/original/lcJ8qM51ClAR2UzXU1mkZGfnn3o.jpg | \ No newline at end of file diff --git a/docs/models/components/transcodesession.md b/docs/models/components/transcodesession.md new file mode 100644 index 0000000..48108cb --- /dev/null +++ b/docs/models/components/transcodesession.md @@ -0,0 +1,23 @@ +# TranscodeSession + +The transcode session if item is currently being transcoded + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `Complete` | **bool* | :heavy_minus_sign: | N/A | +| `Context` | **string* | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | N/A | +| `Error` | **bool* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Progress` | **float64* | :heavy_minus_sign: | N/A | +| `Protocol` | **string* | :heavy_minus_sign: | N/A | +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `SourceAudioCodec` | **string* | :heavy_minus_sign: | N/A | +| `SourceVideoCodec` | **string* | :heavy_minus_sign: | N/A | +| `Speed` | **float64* | :heavy_minus_sign: | N/A | +| `Throttled` | **bool* | :heavy_minus_sign: | N/A | +| `TranscodeHwFullPipeline` | **bool* | :heavy_minus_sign: | N/A | +| `TranscodeHwRequested` | **bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/transcodetype.md b/docs/models/components/transcodetype.md new file mode 100644 index 0000000..83f0639 --- /dev/null +++ b/docs/models/components/transcodetype.md @@ -0,0 +1,11 @@ +# TranscodeType + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `TranscodeTypeVideo` | video | +| `TranscodeTypeMusic` | music | +| `TranscodeTypeAudio` | audio | +| `TranscodeTypeSubtitles` | subtitles | \ No newline at end of file diff --git a/docs/models/components/type.md b/docs/models/components/type.md new file mode 100644 index 0000000..ad6330d --- /dev/null +++ b/docs/models/components/type.md @@ -0,0 +1,13 @@ +# Type + +The type of the value of this setting + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `TypeBool` | bool | +| `TypeInt` | int | +| `TypeText` | text | +| `TypeDouble` | double | \ No newline at end of file diff --git a/docs/models/components/user.md b/docs/models/components/user.md new file mode 100644 index 0000000..0cfd6a3 --- /dev/null +++ b/docs/models/components/user.md @@ -0,0 +1,12 @@ +# User + +The user playing the content + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | The username | +| `ID` | **string* | :heavy_minus_sign: | The id of the user | +| `Thumb` | **string* | :heavy_minus_sign: | Thumb image to display for the user | \ No newline at end of file diff --git a/docs/models/components/value.md b/docs/models/components/value.md new file mode 100644 index 0000000..7bd6c01 --- /dev/null +++ b/docs/models/components/value.md @@ -0,0 +1,25 @@ +# Value + +The current value of this setting + + +## Supported Types + +### + +```go +value := components.CreateValueStr(string{/* values here */}) +``` + +### + +```go +value := components.CreateValueNumber(float64{/* values here */}) +``` + +### + +```go +value := components.CreateValueBoolean(bool{/* values here */}) +``` + diff --git a/docs/models/operations/account.md b/docs/models/operations/account.md index 5adf9db..45b5085 100644 --- a/docs/models/operations/account.md +++ b/docs/models/operations/account.md @@ -3,13 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 238960586 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /accounts/238960586 | -| `Name` | **string* | :heavy_minus_sign: | N/A | Diane | -| `DefaultAudioLanguage` | **string* | :heavy_minus_sign: | N/A | en | -| `AutoSelectAudio` | **bool* | :heavy_minus_sign: | N/A | true | -| `DefaultSubtitleLanguage` | **string* | :heavy_minus_sign: | N/A | en | -| `SubtitleMode` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `GlobalViewCount` | **int64* | :heavy_minus_sign: | N/A | +| `ID` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/action.md b/docs/models/operations/action.md index e6066f7..de49632 100644 --- a/docs/models/operations/action.md +++ b/docs/models/operations/action.md @@ -1,9 +1,12 @@ # Action +The action to perform for this item on this optimizer queue -## Fields -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `ID` | *string* | :heavy_check_mark: | N/A | addToContinueWatching | -| `Key` | *string* | :heavy_check_mark: | N/A | /actions/addToContinueWatching | \ No newline at end of file +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `ActionReprocess` | reprocess | +| `ActionDisable` | disable | +| `ActionEnable` | enable | \ No newline at end of file diff --git a/docs/models/operations/activedirection.md b/docs/models/operations/activedirection.md deleted file mode 100644 index abbf30b..0000000 --- a/docs/models/operations/activedirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActiveDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| --------------------------- | --------------------------- | -| `ActiveDirectionAscending` | asc | -| `ActiveDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/activity.md b/docs/models/operations/activity.md index 844341d..a4acc0f 100644 --- a/docs/models/operations/activity.md +++ b/docs/models/operations/activity.md @@ -3,13 +3,14 @@ ## 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 +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Cancellable` | **bool* | :heavy_minus_sign: | Indicates whether this activity can be cancelled | +| `Context` | map[string]*any* | :heavy_minus_sign: | An object with additional values | +| `Progress` | **float64* | :heavy_minus_sign: | A progress percentage. A value of -1 means the progress is indeterminate | +| `Response` | map[string]*any* | :heavy_minus_sign: | An object with the response to the async opperation | +| `Subtitle` | **string* | :heavy_minus_sign: | A user-friendly sub-title for this activity | +| `Title` | **string* | :heavy_minus_sign: | A user-friendly title for this activity | +| `Type` | **string* | :heavy_minus_sign: | The type of activity | +| `UserID` | **int64* | :heavy_minus_sign: | The user this activity belongs to | +| `UUID` | **string* | :heavy_minus_sign: | The ID of the activity | \ No newline at end of file diff --git a/docs/models/operations/addcollectionitemsglobals.md b/docs/models/operations/addcollectionitemsglobals.md new file mode 100644 index 0000000..b84947b --- /dev/null +++ b/docs/models/operations/addcollectionitemsglobals.md @@ -0,0 +1,18 @@ +# AddCollectionItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addcollectionitemsrequest.md b/docs/models/operations/addcollectionitemsrequest.md new file mode 100644 index 0000000..334d3e2 --- /dev/null +++ b/docs/models/operations/addcollectionitemsrequest.md @@ -0,0 +1,20 @@ +# AddCollectionItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `CollectionID` | *int64* | :heavy_check_mark: | The collection id | | +| `URI` | *string* | :heavy_check_mark: | The URI describing the items to add to this collection | | \ No newline at end of file diff --git a/docs/models/operations/addcollectionitemsresponse.md b/docs/models/operations/addcollectionitemsresponse.md new file mode 100644 index 0000000..93a90f8 --- /dev/null +++ b/docs/models/operations/addcollectionitemsresponse.md @@ -0,0 +1,11 @@ +# AddCollectionItemsResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/adddeviceglobals.md b/docs/models/operations/adddeviceglobals.md new file mode 100644 index 0000000..90e3106 --- /dev/null +++ b/docs/models/operations/adddeviceglobals.md @@ -0,0 +1,18 @@ +# AddDeviceGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/adddevicerequest.md b/docs/models/operations/adddevicerequest.md new file mode 100644 index 0000000..5ccf177 --- /dev/null +++ b/docs/models/operations/adddevicerequest.md @@ -0,0 +1,19 @@ +# AddDeviceRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URI` | **string* | :heavy_minus_sign: | The URI of the device. | http://10.0.0.5 | \ No newline at end of file diff --git a/docs/models/operations/adddeviceresponse.md b/docs/models/operations/adddeviceresponse.md new file mode 100644 index 0000000..2f9554c --- /dev/null +++ b/docs/models/operations/adddeviceresponse.md @@ -0,0 +1,11 @@ +# AddDeviceResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrdvr.md b/docs/models/operations/adddevicetodvrdvr.md new file mode 100644 index 0000000..c08e839 --- /dev/null +++ b/docs/models/operations/adddevicetodvrdvr.md @@ -0,0 +1,12 @@ +# AddDeviceToDVRDVR + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrdvrsmediacontainer.md b/docs/models/operations/adddevicetodvrdvrsmediacontainer.md new file mode 100644 index 0000000..6849d6e --- /dev/null +++ b/docs/models/operations/adddevicetodvrdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# AddDeviceToDVRDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrglobals.md b/docs/models/operations/adddevicetodvrglobals.md new file mode 100644 index 0000000..2f40b3f --- /dev/null +++ b/docs/models/operations/adddevicetodvrglobals.md @@ -0,0 +1,18 @@ +# AddDeviceToDVRGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrmediacontainer.md b/docs/models/operations/adddevicetodvrmediacontainer.md new file mode 100644 index 0000000..8475c50 --- /dev/null +++ b/docs/models/operations/adddevicetodvrmediacontainer.md @@ -0,0 +1,9 @@ +# AddDeviceToDVRMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.AddDeviceToDVRDVRsMediaContainer](../../models/operations/adddevicetodvrdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.AddDeviceToDVRDVR](../../models/operations/adddevicetodvrdvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrrequest.md b/docs/models/operations/adddevicetodvrrequest.md new file mode 100644 index 0000000..de67281 --- /dev/null +++ b/docs/models/operations/adddevicetodvrrequest.md @@ -0,0 +1,20 @@ +# AddDeviceToDVRRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device to add. | | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrresponse.md b/docs/models/operations/adddevicetodvrresponse.md new file mode 100644 index 0000000..9eae9b2 --- /dev/null +++ b/docs/models/operations/adddevicetodvrresponse.md @@ -0,0 +1,12 @@ +# AddDeviceToDVRResponse + + +## 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.AddDeviceToDVRResponseBody](../../models/operations/adddevicetodvrresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/adddevicetodvrresponsebody.md b/docs/models/operations/adddevicetodvrresponsebody.md new file mode 100644 index 0000000..fc0c683 --- /dev/null +++ b/docs/models/operations/adddevicetodvrresponsebody.md @@ -0,0 +1,10 @@ +# AddDeviceToDVRResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.AddDeviceToDVRMediaContainer](../../models/operations/adddevicetodvrmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/adddownloadqueueitemsglobals.md b/docs/models/operations/adddownloadqueueitemsglobals.md new file mode 100644 index 0000000..48b04a5 --- /dev/null +++ b/docs/models/operations/adddownloadqueueitemsglobals.md @@ -0,0 +1,18 @@ +# AddDownloadQueueItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/adddownloadqueueitemsmediacontainer.md b/docs/models/operations/adddownloadqueueitemsmediacontainer.md new file mode 100644 index 0000000..297557c --- /dev/null +++ b/docs/models/operations/adddownloadqueueitemsmediacontainer.md @@ -0,0 +1,17 @@ +# AddDownloadQueueItemsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `AddedQueueItems` | [][operations.AddedQueueItems](../../models/operations/addedqueueitems.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/adddownloadqueueitemsrequest.md b/docs/models/operations/adddownloadqueueitemsrequest.md new file mode 100644 index 0000000..a041954 --- /dev/null +++ b/docs/models/operations/adddownloadqueueitemsrequest.md @@ -0,0 +1,46 @@ +# AddDownloadQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | +| `Keys` | []*string* | :heavy_check_mark: | Keys to add | [
"/library/metadata/3",
"/library/metadata/6"
] | +| `AdvancedSubtitles` | [*components.AdvancedSubtitles](../../models/components/advancedsubtitles.md) | :heavy_minus_sign: | Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost
| burn | +| `AudioBoost` | **int64* | :heavy_minus_sign: | Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) | 50 | +| `AudioChannelCount` | **int64* | :heavy_minus_sign: | Target video number of audio channels. | 5 | +| `AutoAdjustQuality` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports ABR. | 1 | +| `AutoAdjustSubtitle` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if the server should adjust subtitles based on Voice Activity Data. | 1 | +| `DirectPlay` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct playing the indicated content. | 1 | +| `DirectStream` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the video of the indicated content. | 1 | +| `DirectStreamAudio` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the audio of the indicated content. | 1 | +| `DisableResolutionRotation` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if resolution should be adjusted for orientation. | 1 | +| `HasMDE` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 | 1 | +| `Location` | [*components.Location](../../models/components/location.md) | :heavy_minus_sign: | Network type of the client, can be used to help determine target bitrate. | wan | +| `MediaBufferSize` | **int64* | :heavy_minus_sign: | Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. | 102400 | +| `MediaIndex` | **int64* | :heavy_minus_sign: | Index of the media to transcode. -1 or not specified indicates let the server choose. | 0 | +| `MusicBitrate` | **int64* | :heavy_minus_sign: | Target bitrate for audio only files (in kbps, used to transcode). | 5000 | +| `Offset` | **float64* | :heavy_minus_sign: | Offset from the start of the media (in seconds). | 90.5 | +| `PartIndex` | **int64* | :heavy_minus_sign: | Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode | 0 | +| `Path` | **string* | :heavy_minus_sign: | Internal PMS path of the media to transcode. | /library/metadata/151671 | +| `PeakBitrate` | **int64* | :heavy_minus_sign: | Maximum bitrate (in kbps) to use in ABR. | 12000 | +| `PhotoResolution` | **string* | :heavy_minus_sign: | Target photo resolution. | 1080x1080 | +| `Protocol` | [*components.Protocol](../../models/components/protocol.md) | :heavy_minus_sign: | Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022)
| dash | +| `SecondsPerSegment` | **int64* | :heavy_minus_sign: | Number of seconds to include in each transcoded segment | 5 | +| `SubtitleSize` | **int64* | :heavy_minus_sign: | Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) | 50 | +| `Subtitles` | [*components.Subtitles](../../models/components/subtitles.md) | :heavy_minus_sign: | Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream
| Burn | +| `VideoBitrate` | **int64* | :heavy_minus_sign: | Target video bitrate (in kbps). | 12000 | +| `VideoQuality` | **int64* | :heavy_minus_sign: | Target photo quality. | 50 | +| `VideoResolution` | **string* | :heavy_minus_sign: | Target maximum video resolution. | 1080x1080 | \ No newline at end of file diff --git a/docs/models/operations/adddownloadqueueitemsresponse.md b/docs/models/operations/adddownloadqueueitemsresponse.md new file mode 100644 index 0000000..2bf2d89 --- /dev/null +++ b/docs/models/operations/adddownloadqueueitemsresponse.md @@ -0,0 +1,11 @@ +# AddDownloadQueueItemsResponse + + +## 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.AddDownloadQueueItemsResponseBody](../../models/operations/adddownloadqueueitemsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/adddownloadqueueitemsresponsebody.md b/docs/models/operations/adddownloadqueueitemsresponsebody.md new file mode 100644 index 0000000..de792e4 --- /dev/null +++ b/docs/models/operations/adddownloadqueueitemsresponsebody.md @@ -0,0 +1,10 @@ +# AddDownloadQueueItemsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.AddDownloadQueueItemsMediaContainer](../../models/operations/adddownloadqueueitemsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addedqueueitems.md b/docs/models/operations/addedqueueitems.md new file mode 100644 index 0000000..c84c7fb --- /dev/null +++ b/docs/models/operations/addedqueueitems.md @@ -0,0 +1,9 @@ +# AddedQueueItems + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `ID` | **int64* | :heavy_minus_sign: | The queue item id that was added or the existing one if an item already exists in this queue with the same parameters | +| `Key` | **string* | :heavy_minus_sign: | The key added to the queue | \ No newline at end of file diff --git a/docs/models/operations/addextrasglobals.md b/docs/models/operations/addextrasglobals.md new file mode 100644 index 0000000..cbf9295 --- /dev/null +++ b/docs/models/operations/addextrasglobals.md @@ -0,0 +1,18 @@ +# AddExtrasGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addextrasrequest.md b/docs/models/operations/addextrasrequest.md new file mode 100644 index 0000000..af1bad4 --- /dev/null +++ b/docs/models/operations/addextrasrequest.md @@ -0,0 +1,22 @@ +# AddExtrasRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `ExtraType` | **int64* | :heavy_minus_sign: | The metadata type of the extra | | +| `URL` | *string* | :heavy_check_mark: | The URL of the extra | | +| `Title` | **string* | :heavy_minus_sign: | The title to filter by or assign | | \ No newline at end of file diff --git a/docs/models/operations/addextrasresponse.md b/docs/models/operations/addextrasresponse.md new file mode 100644 index 0000000..acf371d --- /dev/null +++ b/docs/models/operations/addextrasresponse.md @@ -0,0 +1,10 @@ +# AddExtrasResponse + + +## 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/addlineupdvr.md b/docs/models/operations/addlineupdvr.md new file mode 100644 index 0000000..409a331 --- /dev/null +++ b/docs/models/operations/addlineupdvr.md @@ -0,0 +1,12 @@ +# AddLineupDVR + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addlineupdvrsmediacontainer.md b/docs/models/operations/addlineupdvrsmediacontainer.md new file mode 100644 index 0000000..ddf02da --- /dev/null +++ b/docs/models/operations/addlineupdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# AddLineupDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/addlineupglobals.md b/docs/models/operations/addlineupglobals.md new file mode 100644 index 0000000..32acef3 --- /dev/null +++ b/docs/models/operations/addlineupglobals.md @@ -0,0 +1,18 @@ +# AddLineupGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addlineupmediacontainer.md b/docs/models/operations/addlineupmediacontainer.md new file mode 100644 index 0000000..0714d03 --- /dev/null +++ b/docs/models/operations/addlineupmediacontainer.md @@ -0,0 +1,9 @@ +# AddLineupMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.AddLineupDVRsMediaContainer](../../models/operations/addlineupdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.AddLineupDVR](../../models/operations/addlineupdvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addlineuprequest.md b/docs/models/operations/addlineuprequest.md new file mode 100644 index 0000000..7f022a2 --- /dev/null +++ b/docs/models/operations/addlineuprequest.md @@ -0,0 +1,20 @@ +# AddLineupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | +| `Lineup` | *string* | :heavy_check_mark: | The lineup to delete | | \ No newline at end of file diff --git a/docs/models/operations/addlineupresponse.md b/docs/models/operations/addlineupresponse.md new file mode 100644 index 0000000..8e7ce3d --- /dev/null +++ b/docs/models/operations/addlineupresponse.md @@ -0,0 +1,12 @@ +# AddLineupResponse + + +## 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.AddLineupResponseBody](../../models/operations/addlineupresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addlineupresponsebody.md b/docs/models/operations/addlineupresponsebody.md new file mode 100644 index 0000000..0fd022f --- /dev/null +++ b/docs/models/operations/addlineupresponsebody.md @@ -0,0 +1,10 @@ +# AddLineupResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.AddLineupMediaContainer](../../models/operations/addlineupmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addplaylistcontentsmediacontainer.md b/docs/models/operations/addplaylistcontentsmediacontainer.md deleted file mode 100644 index 30c2a00..0000000 --- a/docs/models/operations/addplaylistcontentsmediacontainer.md +++ /dev/null @@ -1,11 +0,0 @@ -# AddPlaylistContentsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LeafCountAdded` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LeafCountRequested` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Metadata` | [][operations.AddPlaylistContentsMetadata](../../models/operations/addplaylistcontentsmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/addplaylistcontentsmetadata.md b/docs/models/operations/addplaylistcontentsmetadata.md deleted file mode 100644 index 5bbc8ba..0000000 --- a/docs/models/operations/addplaylistcontentsmetadata.md +++ /dev/null @@ -1,20 +0,0 @@ -# AddPlaylistContentsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 94 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/94/items | -| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://972e3047-83d6-4848-a000-261f0af26ba2 | -| `Type` | **string* | :heavy_minus_sign: | N/A | playlist | -| `Title` | **string* | :heavy_minus_sign: | N/A | A great playlist | -| `Summary` | **string* | :heavy_minus_sign: | N/A | One of my great playlists | -| `Smart` | **bool* | :heavy_minus_sign: | N/A | false | -| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video | -| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/94/composite/1705800070 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 423000 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 3 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705716458 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705800070 | \ No newline at end of file diff --git a/docs/models/operations/addplaylistcontentsrequest.md b/docs/models/operations/addplaylistcontentsrequest.md deleted file mode 100644 index 36ac0b1..0000000 --- a/docs/models/operations/addplaylistcontentsrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 | server://12345/com.plexapp.plugins.library/library/metadata/1 | -| `PlayQueueID` | **float64* | :heavy_minus_sign: | 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 deleted file mode 100644 index 3c73fba..0000000 --- a/docs/models/operations/addplaylistcontentsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.AddPlaylistContentsResponseBody](../../models/operations/addplaylistcontentsresponsebody.md) | :heavy_minus_sign: | Playlist Updated | \ No newline at end of file diff --git a/docs/models/operations/addplaylistcontentsresponsebody.md b/docs/models/operations/addplaylistcontentsresponsebody.md deleted file mode 100644 index 361f4dc..0000000 --- a/docs/models/operations/addplaylistcontentsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# AddPlaylistContentsResponseBody - -Playlist Updated - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.AddPlaylistContentsMediaContainer](../../models/operations/addplaylistcontentsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addplaylistitemsglobals.md b/docs/models/operations/addplaylistitemsglobals.md new file mode 100644 index 0000000..18769fe --- /dev/null +++ b/docs/models/operations/addplaylistitemsglobals.md @@ -0,0 +1,18 @@ +# AddPlaylistItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addplaylistitemsrequest.md b/docs/models/operations/addplaylistitemsrequest.md new file mode 100644 index 0000000..6ac1f78 --- /dev/null +++ b/docs/models/operations/addplaylistitemsrequest.md @@ -0,0 +1,21 @@ +# AddPlaylistItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `URI` | **string* | :heavy_minus_sign: | The content URI for the playlist. | | +| `PlayQueueID` | **int64* | :heavy_minus_sign: | The play queue to add to a playlist. | | \ No newline at end of file diff --git a/docs/models/operations/addplaylistitemsresponse.md b/docs/models/operations/addplaylistitemsresponse.md new file mode 100644 index 0000000..7ea1863 --- /dev/null +++ b/docs/models/operations/addplaylistitemsresponse.md @@ -0,0 +1,11 @@ +# AddPlaylistItemsResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/addproviderglobals.md b/docs/models/operations/addproviderglobals.md new file mode 100644 index 0000000..ce07af8 --- /dev/null +++ b/docs/models/operations/addproviderglobals.md @@ -0,0 +1,18 @@ +# AddProviderGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addproviderrequest.md b/docs/models/operations/addproviderrequest.md new file mode 100644 index 0000000..0b901c3 --- /dev/null +++ b/docs/models/operations/addproviderrequest.md @@ -0,0 +1,19 @@ +# AddProviderRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URL` | *string* | :heavy_check_mark: | The URL of the media provider to add. | | \ No newline at end of file diff --git a/docs/models/operations/addproviderresponse.md b/docs/models/operations/addproviderresponse.md new file mode 100644 index 0000000..78a8903 --- /dev/null +++ b/docs/models/operations/addproviderresponse.md @@ -0,0 +1,10 @@ +# AddProviderResponse + + +## 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/addsectionglobals.md b/docs/models/operations/addsectionglobals.md new file mode 100644 index 0000000..0e72980 --- /dev/null +++ b/docs/models/operations/addsectionglobals.md @@ -0,0 +1,18 @@ +# AddSectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addsectionrequest.md b/docs/models/operations/addsectionrequest.md new file mode 100644 index 0000000..07e6fda --- /dev/null +++ b/docs/models/operations/addsectionrequest.md @@ -0,0 +1,28 @@ +# AddSectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Name` | *string* | :heavy_check_mark: | The name of the new section | | +| `Type` | *int64* | :heavy_check_mark: | The type of library section | | +| `Scanner` | **string* | :heavy_minus_sign: | The scanner this section should use | | +| `Agent` | *string* | :heavy_check_mark: | The agent this section should use for metadata | | +| `MetadataAgentProviderGroupID` | **string* | :heavy_minus_sign: | The agent group id for this section | | +| `Language` | *string* | :heavy_check_mark: | The language of this section | | +| `Locations` | []*string* | :heavy_minus_sign: | The locations on disk to add to this section | [
"O:\\fatboy\\Media\\Ripped\\Music",
"O:\\fatboy\\Media\\My Music"
] | +| `Prefs` | [*operations.QueryParamPrefs](../../models/operations/queryparamprefs.md) | :heavy_minus_sign: | The preferences for this section | {
"collectionMode": 2,
"hidden": 0
} | +| `Relative` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | If set, paths are relative to `Media Upload` path | 1 | +| `ImportFromiTunes` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | If set, import media from iTunes. | 1 | \ No newline at end of file diff --git a/docs/models/operations/addsectionresponse.md b/docs/models/operations/addsectionresponse.md new file mode 100644 index 0000000..6f05fa7 --- /dev/null +++ b/docs/models/operations/addsectionresponse.md @@ -0,0 +1,11 @@ +# AddSectionResponse + + +## 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 | +| `SlashGetResponses200` | [*components.SlashGetResponses200](../../models/components/slashgetresponses200.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/addsubtitlesglobals.md b/docs/models/operations/addsubtitlesglobals.md new file mode 100644 index 0000000..ed261b8 --- /dev/null +++ b/docs/models/operations/addsubtitlesglobals.md @@ -0,0 +1,18 @@ +# AddSubtitlesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addsubtitlesrequest.md b/docs/models/operations/addsubtitlesrequest.md new file mode 100644 index 0000000..3975849 --- /dev/null +++ b/docs/models/operations/addsubtitlesrequest.md @@ -0,0 +1,26 @@ +# AddSubtitlesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Title` | **string* | :heavy_minus_sign: | N/A | | +| `Language` | **string* | :heavy_minus_sign: | N/A | | +| `MediaItemID` | **int64* | :heavy_minus_sign: | N/A | | +| `URL` | **string* | :heavy_minus_sign: | The URL of the subtitle. If not provided, the contents of the subtitle must be in the post body | | +| `Format` | **string* | :heavy_minus_sign: | N/A | | +| `Forced` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | +| `HearingImpaired` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/addsubtitlesresponse.md b/docs/models/operations/addsubtitlesresponse.md new file mode 100644 index 0000000..d4324a1 --- /dev/null +++ b/docs/models/operations/addsubtitlesresponse.md @@ -0,0 +1,10 @@ +# AddSubtitlesResponse + + +## 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/addtoplayqueueglobals.md b/docs/models/operations/addtoplayqueueglobals.md new file mode 100644 index 0000000..f3c1230 --- /dev/null +++ b/docs/models/operations/addtoplayqueueglobals.md @@ -0,0 +1,18 @@ +# AddToPlayQueueGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/addtoplayqueuerequest.md b/docs/models/operations/addtoplayqueuerequest.md new file mode 100644 index 0000000..fba740d --- /dev/null +++ b/docs/models/operations/addtoplayqueuerequest.md @@ -0,0 +1,22 @@ +# AddToPlayQueueRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | +| `URI` | **string* | :heavy_minus_sign: | The content URI for what we're adding to the queue. | | +| `PlaylistID` | **string* | :heavy_minus_sign: | The ID of the playlist to add to the playQueue. | | +| `Next` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Play this item next (defaults to 0 - queueing at the end of manually queued items). | 1 | \ No newline at end of file diff --git a/docs/models/operations/addtoplayqueueresponse.md b/docs/models/operations/addtoplayqueueresponse.md new file mode 100644 index 0000000..be31c4d --- /dev/null +++ b/docs/models/operations/addtoplayqueueresponse.md @@ -0,0 +1,11 @@ +# AddToPlayQueueResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/advancedsubtitles.md b/docs/models/operations/advancedsubtitles.md new file mode 100644 index 0000000..9ae4f48 --- /dev/null +++ b/docs/models/operations/advancedsubtitles.md @@ -0,0 +1,13 @@ +# AdvancedSubtitles + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `AdvancedSubtitlesAuto` | auto | +| `AdvancedSubtitlesBurn` | burn | +| `AdvancedSubtitlesNone` | none | +| `AdvancedSubtitlesSidecar` | sidecar | +| `AdvancedSubtitlesEmbedded` | embedded | +| `AdvancedSubtitlesSegmented` | segmented | \ No newline at end of file diff --git a/docs/models/operations/alllibraries.md b/docs/models/operations/alllibraries.md deleted file mode 100644 index 642aca4..0000000 --- a/docs/models/operations/alllibraries.md +++ /dev/null @@ -1,11 +0,0 @@ -# AllLibraries - -Indicates if the user has access to all libraries. - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `AllLibrariesDisable` | 0 | -| `AllLibrariesEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/allowcameraupload.md b/docs/models/operations/allowcameraupload.md deleted file mode 100644 index ca0bb2a..0000000 --- a/docs/models/operations/allowcameraupload.md +++ /dev/null @@ -1,11 +0,0 @@ -# AllowCameraUpload - -Indicates if the user is allowed to upload from a camera. - - -## Values - -| Name | Value | -| -------------------------- | -------------------------- | -| `AllowCameraUploadDisable` | 0 | -| `AllowCameraUploadEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/allowchannels.md b/docs/models/operations/allowchannels.md deleted file mode 100644 index 11d6c75..0000000 --- a/docs/models/operations/allowchannels.md +++ /dev/null @@ -1,11 +0,0 @@ -# AllowChannels - -Indicates if the user has access to channels. - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `AllowChannelsDisable` | 0 | -| `AllowChannelsEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/allowsubtitleadmin.md b/docs/models/operations/allowsubtitleadmin.md deleted file mode 100644 index d794ec0..0000000 --- a/docs/models/operations/allowsubtitleadmin.md +++ /dev/null @@ -1,11 +0,0 @@ -# AllowSubtitleAdmin - -Indicates if the user can manage subtitles. - - -## Values - -| Name | Value | -| --------------------------- | --------------------------- | -| `AllowSubtitleAdminDisable` | 0 | -| `AllowSubtitleAdminEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/allowsync.md b/docs/models/operations/allowsync.md deleted file mode 100644 index 30e7fad..0000000 --- a/docs/models/operations/allowsync.md +++ /dev/null @@ -1,11 +0,0 @@ -# AllowSync - -Indicates if the user is allowed to sync media. - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `AllowSyncDisable` | 0 | -| `AllowSyncEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/allowtuners.md b/docs/models/operations/allowtuners.md deleted file mode 100644 index 2df5873..0000000 --- a/docs/models/operations/allowtuners.md +++ /dev/null @@ -1,11 +0,0 @@ -# AllowTuners - -Indicates if the user is allowed to use tuners. - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `AllowTunersDisable` | 0 | -| `AllowTunersEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/analyzemetadataglobals.md b/docs/models/operations/analyzemetadataglobals.md new file mode 100644 index 0000000..8d424a1 --- /dev/null +++ b/docs/models/operations/analyzemetadataglobals.md @@ -0,0 +1,18 @@ +# AnalyzeMetadataGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/analyzemetadatarequest.md b/docs/models/operations/analyzemetadatarequest.md new file mode 100644 index 0000000..2e6163a --- /dev/null +++ b/docs/models/operations/analyzemetadatarequest.md @@ -0,0 +1,21 @@ +# AnalyzeMetadataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `ThumbOffset` | **float64* | :heavy_minus_sign: | Set the offset to be used for thumbnails | | +| `ArtOffset` | **float64* | :heavy_minus_sign: | Set the offset to be used for artwork | | \ No newline at end of file diff --git a/docs/models/operations/analyzemetadataresponse.md b/docs/models/operations/analyzemetadataresponse.md new file mode 100644 index 0000000..8881fb5 --- /dev/null +++ b/docs/models/operations/analyzemetadataresponse.md @@ -0,0 +1,10 @@ +# AnalyzeMetadataResponse + + +## 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/applyupdatesglobals.md b/docs/models/operations/applyupdatesglobals.md new file mode 100644 index 0000000..e21ec07 --- /dev/null +++ b/docs/models/operations/applyupdatesglobals.md @@ -0,0 +1,18 @@ +# ApplyUpdatesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/applyupdatesrequest.md b/docs/models/operations/applyupdatesrequest.md index cd95c0e..9742570 100644 --- a/docs/models/operations/applyupdatesrequest.md +++ b/docs/models/operations/applyupdatesrequest.md @@ -3,7 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 | 1 | -| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | 1 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Tonight` | [*components.BoolInt](../../models/components/boolint.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 immediately. | 1 | +| `Skip` | [*components.BoolInt](../../models/components/boolint.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`. | 1 | \ No newline at end of file diff --git a/docs/models/operations/args.md b/docs/models/operations/args.md new file mode 100644 index 0000000..40841ae --- /dev/null +++ b/docs/models/operations/args.md @@ -0,0 +1,9 @@ +# Args + +The new values for the metadata item + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/attributes.md b/docs/models/operations/attributes.md index 91c0254..8fe3689 100644 --- a/docs/models/operations/attributes.md +++ b/docs/models/operations/attributes.md @@ -1,11 +1,9 @@ # Attributes -Attributes associated with the marker. +The attributes to assign to this marker ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | The identifier for the attributes. | 306970 | -| `Version` | **int64* | :heavy_minus_sign: | The version number of the marker attributes. | 4 | \ No newline at end of file +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/autocompleteglobals.md b/docs/models/operations/autocompleteglobals.md new file mode 100644 index 0000000..ff41eb5 --- /dev/null +++ b/docs/models/operations/autocompleteglobals.md @@ -0,0 +1,18 @@ +# AutocompleteGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/autocompleterequest.md b/docs/models/operations/autocompleterequest.md new file mode 100644 index 0000000..24657d4 --- /dev/null +++ b/docs/models/operations/autocompleterequest.md @@ -0,0 +1,22 @@ +# AutocompleteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Type` | **int64* | :heavy_minus_sign: | Item type | | +| `FieldQuery` | **string* | :heavy_minus_sign: | The "field" stands in for any field, the value is a partial string for matching | | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | \ No newline at end of file diff --git a/docs/models/operations/autocompleteresponse.md b/docs/models/operations/autocompleteresponse.md new file mode 100644 index 0000000..087af18 --- /dev/null +++ b/docs/models/operations/autocompleteresponse.md @@ -0,0 +1,12 @@ +# AutocompleteResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/autoselectsubtitle.md b/docs/models/operations/autoselectsubtitle.md deleted file mode 100644 index 4069275..0000000 --- a/docs/models/operations/autoselectsubtitle.md +++ /dev/null @@ -1,11 +0,0 @@ -# AutoSelectSubtitle - -The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - - -## Values - -| Name | Value | -| --------------------------- | --------------------------- | -| `AutoSelectSubtitleDisable` | 0 | -| `AutoSelectSubtitleEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/bandwidth.md b/docs/models/operations/bandwidth.md new file mode 100644 index 0000000..7b6969d --- /dev/null +++ b/docs/models/operations/bandwidth.md @@ -0,0 +1,10 @@ +# Bandwidth + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `Bandwidth` | **int64* | :heavy_minus_sign: | The bandwidth at this time in kbps | +| `Resolution` | **string* | :heavy_minus_sign: | The user-friendly resolution at this time | +| `Time` | **int64* | :heavy_minus_sign: | Media playback time where this bandwidth started | \ No newline at end of file diff --git a/docs/models/operations/bandwidths.md b/docs/models/operations/bandwidths.md new file mode 100644 index 0000000..01aa20b --- /dev/null +++ b/docs/models/operations/bandwidths.md @@ -0,0 +1,10 @@ +# Bandwidths + +A list of media times and bandwidths when trascoding is using with auto adjustment of bandwidth + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Bandwidth` | [][operations.Bandwidth](../../models/operations/bandwidth.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/billing.md b/docs/models/operations/billing.md deleted file mode 100644 index 0375e9d..0000000 --- a/docs/models/operations/billing.md +++ /dev/null @@ -1,9 +0,0 @@ -# Billing - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `InternalPaymentMethod` | [operations.InternalPaymentMethod](../../models/operations/internalpaymentmethod.md) | :heavy_check_mark: | N/A | -| `PaymentMethodID` | *int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/butlertask.md b/docs/models/operations/butlertask.md index 6719ed9..0a2d52f 100644 --- a/docs/models/operations/butlertask.md +++ b/docs/models/operations/butlertask.md @@ -3,11 +3,11 @@ ## 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 +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Description` | **string* | :heavy_minus_sign: | A user-friendly description of the task | +| `Enabled` | **bool* | :heavy_minus_sign: | Whether this task is enabled or not | +| `Interval` | **int64* | :heavy_minus_sign: | The interval (in days) of when this task is run. A value of 1 is run every day, 7 is every week, etc. | +| `Name` | **string* | :heavy_minus_sign: | The name of the task | +| `ScheduleRandomized` | **bool* | :heavy_minus_sign: | Indicates whether the timing of the task is randomized within the butler interval | +| `Title` | **string* | :heavy_minus_sign: | A user-friendly title of the task | \ No newline at end of file diff --git a/docs/models/operations/cancelactivityglobals.md b/docs/models/operations/cancelactivityglobals.md new file mode 100644 index 0000000..48c6ed3 --- /dev/null +++ b/docs/models/operations/cancelactivityglobals.md @@ -0,0 +1,18 @@ +# CancelActivityGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/cancelactivityrequest.md b/docs/models/operations/cancelactivityrequest.md new file mode 100644 index 0000000..725fad2 --- /dev/null +++ b/docs/models/operations/cancelactivityrequest.md @@ -0,0 +1,19 @@ +# CancelActivityRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `ActivityID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | d6199ba1-fb5e-4cae-bf17-1a5369c1cf1e | \ No newline at end of file diff --git a/docs/models/operations/cancelactivityresponse.md b/docs/models/operations/cancelactivityresponse.md new file mode 100644 index 0000000..4520d1a --- /dev/null +++ b/docs/models/operations/cancelactivityresponse.md @@ -0,0 +1,10 @@ +# CancelActivityResponse + + +## 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/cancelgrabglobals.md b/docs/models/operations/cancelgrabglobals.md new file mode 100644 index 0000000..8155508 --- /dev/null +++ b/docs/models/operations/cancelgrabglobals.md @@ -0,0 +1,18 @@ +# CancelGrabGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/cancelgrabrequest.md b/docs/models/operations/cancelgrabrequest.md new file mode 100644 index 0000000..984441e --- /dev/null +++ b/docs/models/operations/cancelgrabrequest.md @@ -0,0 +1,19 @@ +# CancelGrabRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `OperationID` | *string* | :heavy_check_mark: | The ID of the operation. | | \ No newline at end of file diff --git a/docs/models/operations/cancelgrabresponse.md b/docs/models/operations/cancelgrabresponse.md new file mode 100644 index 0000000..2e2d5ad --- /dev/null +++ b/docs/models/operations/cancelgrabresponse.md @@ -0,0 +1,10 @@ +# CancelGrabResponse + + +## 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/cancelrefreshglobals.md b/docs/models/operations/cancelrefreshglobals.md new file mode 100644 index 0000000..253956f --- /dev/null +++ b/docs/models/operations/cancelrefreshglobals.md @@ -0,0 +1,18 @@ +# CancelRefreshGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/cancelrefreshrequest.md b/docs/models/operations/cancelrefreshrequest.md new file mode 100644 index 0000000..908a4fa --- /dev/null +++ b/docs/models/operations/cancelrefreshrequest.md @@ -0,0 +1,19 @@ +# CancelRefreshRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/cancelrefreshresponse.md b/docs/models/operations/cancelrefreshresponse.md new file mode 100644 index 0000000..b1ea4e3 --- /dev/null +++ b/docs/models/operations/cancelrefreshresponse.md @@ -0,0 +1,10 @@ +# CancelRefreshResponse + + +## 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/cancelserveractivitiesrequest.md b/docs/models/operations/cancelserveractivitiesrequest.md deleted file mode 100644 index e306341..0000000 --- a/docs/models/operations/cancelserveractivitiesrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# CancelServerActivitiesRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e | \ No newline at end of file diff --git a/docs/models/operations/cancelserveractivitiesresponse.md b/docs/models/operations/cancelserveractivitiesresponse.md deleted file mode 100644 index e5c0f9f..0000000 --- a/docs/models/operations/cancelserveractivitiesresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/channelmapping.md b/docs/models/operations/channelmapping.md new file mode 100644 index 0000000..9673f87 --- /dev/null +++ b/docs/models/operations/channelmapping.md @@ -0,0 +1,9 @@ +# ChannelMapping + +The mapping of changes, passed as a map of device channel to lineup VCN. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/channelmappingbykey.md b/docs/models/operations/channelmappingbykey.md new file mode 100644 index 0000000..0d81ecb --- /dev/null +++ b/docs/models/operations/channelmappingbykey.md @@ -0,0 +1,9 @@ +# ChannelMappingByKey + +The mapping of changes, passed as a map of device channel to lineup key. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/chapter.md b/docs/models/operations/chapter.md deleted file mode 100644 index 2ae424d..0000000 --- a/docs/models/operations/chapter.md +++ /dev/null @@ -1,15 +0,0 @@ -# Chapter - -The thumbnail for the chapter - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `ID` | *int64* | :heavy_check_mark: | N/A | 4 | -| `Filter` | *string* | :heavy_check_mark: | N/A | thumb=4 | -| `Index` | *int64* | :heavy_check_mark: | N/A | 1 | -| `StartTimeOffset` | *int64* | :heavy_check_mark: | N/A | 0 | -| `EndTimeOffset` | *int64* | :heavy_check_mark: | N/A | 100100 | -| `Thumb` | *string* | :heavy_check_mark: | N/A | /library/media/46883/chapterImages/1 | \ No newline at end of file diff --git a/docs/models/operations/checkforupdatesrequest.md b/docs/models/operations/checkforupdatesrequest.md deleted file mode 100644 index 9ef613c..0000000 --- a/docs/models/operations/checkforupdatesrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# CheckForUpdatesRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | \ No newline at end of file diff --git a/docs/models/operations/checkforupdatesresponse.md b/docs/models/operations/checkforupdatesresponse.md deleted file mode 100644 index fd64d66..0000000 --- a/docs/models/operations/checkforupdatesresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/checkupdatesglobals.md b/docs/models/operations/checkupdatesglobals.md new file mode 100644 index 0000000..1cefc99 --- /dev/null +++ b/docs/models/operations/checkupdatesglobals.md @@ -0,0 +1,18 @@ +# CheckUpdatesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/checkupdatesrequest.md b/docs/models/operations/checkupdatesrequest.md new file mode 100644 index 0000000..623168a --- /dev/null +++ b/docs/models/operations/checkupdatesrequest.md @@ -0,0 +1,19 @@ +# CheckUpdatesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Download` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | \ No newline at end of file diff --git a/docs/models/operations/checkupdatesresponse.md b/docs/models/operations/checkupdatesresponse.md new file mode 100644 index 0000000..c3fadeb --- /dev/null +++ b/docs/models/operations/checkupdatesresponse.md @@ -0,0 +1,10 @@ +# CheckUpdatesResponse + + +## 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/chromasubsampling.md b/docs/models/operations/chromasubsampling.md new file mode 100644 index 0000000..9038a99 --- /dev/null +++ b/docs/models/operations/chromasubsampling.md @@ -0,0 +1,18 @@ +# ChromaSubsampling + +Use the specified chroma subsambling. + - 0: 411 + - 1: 420 + - 2: 422 + - 3: 444 +Defaults to 3 (444) + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `ChromaSubsamplingZero` | 0 | +| `ChromaSubsamplingOne` | 1 | +| `ChromaSubsamplingTwo` | 2 | +| `ChromaSubsamplingThree` | 3 | \ No newline at end of file diff --git a/docs/models/operations/cleanbundlesresponse.md b/docs/models/operations/cleanbundlesresponse.md new file mode 100644 index 0000000..286215d --- /dev/null +++ b/docs/models/operations/cleanbundlesresponse.md @@ -0,0 +1,10 @@ +# CleanBundlesResponse + + +## 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 deleted file mode 100644 index d3aec97..0000000 --- a/docs/models/operations/clearplaylistcontentsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index bee2ea1..0000000 --- a/docs/models/operations/clearplaylistcontentsresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/clearplaylistitemsglobals.md b/docs/models/operations/clearplaylistitemsglobals.md new file mode 100644 index 0000000..c131fa1 --- /dev/null +++ b/docs/models/operations/clearplaylistitemsglobals.md @@ -0,0 +1,18 @@ +# ClearPlaylistItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/clearplaylistitemsrequest.md b/docs/models/operations/clearplaylistitemsrequest.md new file mode 100644 index 0000000..6c88d9b --- /dev/null +++ b/docs/models/operations/clearplaylistitemsrequest.md @@ -0,0 +1,19 @@ +# ClearPlaylistItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | \ No newline at end of file diff --git a/docs/models/operations/clearplaylistitemsresponse.md b/docs/models/operations/clearplaylistitemsresponse.md new file mode 100644 index 0000000..5182009 --- /dev/null +++ b/docs/models/operations/clearplaylistitemsresponse.md @@ -0,0 +1,11 @@ +# ClearPlaylistItemsResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/clearplayqueueglobals.md b/docs/models/operations/clearplayqueueglobals.md new file mode 100644 index 0000000..31b7138 --- /dev/null +++ b/docs/models/operations/clearplayqueueglobals.md @@ -0,0 +1,18 @@ +# ClearPlayQueueGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/clearplayqueuerequest.md b/docs/models/operations/clearplayqueuerequest.md new file mode 100644 index 0000000..7dd4a3c --- /dev/null +++ b/docs/models/operations/clearplayqueuerequest.md @@ -0,0 +1,19 @@ +# ClearPlayQueueRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | \ No newline at end of file diff --git a/docs/models/operations/clearplayqueueresponse.md b/docs/models/operations/clearplayqueueresponse.md new file mode 100644 index 0000000..a54bf82 --- /dev/null +++ b/docs/models/operations/clearplayqueueresponse.md @@ -0,0 +1,11 @@ +# ClearPlayQueueResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/collection.md b/docs/models/operations/collection.md deleted file mode 100644 index b58e7d3..0000000 --- a/docs/models/operations/collection.md +++ /dev/null @@ -1,8 +0,0 @@ -# Collection - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection | \ No newline at end of file diff --git a/docs/models/operations/computechannelmapchannelmapping.md b/docs/models/operations/computechannelmapchannelmapping.md new file mode 100644 index 0000000..0bb24cb --- /dev/null +++ b/docs/models/operations/computechannelmapchannelmapping.md @@ -0,0 +1,11 @@ +# ComputeChannelMapChannelMapping + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `ChannelKey` | **string* | :heavy_minus_sign: | N/A | +| `DeviceIdentifier` | **string* | :heavy_minus_sign: | The channel description on the device | +| `Favorite` | **bool* | :heavy_minus_sign: | N/A | +| `LineupIdentifier` | **string* | :heavy_minus_sign: | The channel identifier in the lineup | \ No newline at end of file diff --git a/docs/models/operations/computechannelmapglobals.md b/docs/models/operations/computechannelmapglobals.md new file mode 100644 index 0000000..7023a47 --- /dev/null +++ b/docs/models/operations/computechannelmapglobals.md @@ -0,0 +1,18 @@ +# ComputeChannelMapGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/computechannelmapmediacontainer.md b/docs/models/operations/computechannelmapmediacontainer.md new file mode 100644 index 0000000..002cab6 --- /dev/null +++ b/docs/models/operations/computechannelmapmediacontainer.md @@ -0,0 +1,17 @@ +# ComputeChannelMapMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `ChannelMapping` | [][operations.ComputeChannelMapChannelMapping](../../models/operations/computechannelmapchannelmapping.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/computechannelmaprequest.md b/docs/models/operations/computechannelmaprequest.md new file mode 100644 index 0000000..5768957 --- /dev/null +++ b/docs/models/operations/computechannelmaprequest.md @@ -0,0 +1,20 @@ +# ComputeChannelMapRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceQueryParameter` | *string* | :heavy_check_mark: | The URI describing the device | | +| `Lineup` | *string* | :heavy_check_mark: | The URI describing the lineup | | \ No newline at end of file diff --git a/docs/models/operations/computechannelmapresponse.md b/docs/models/operations/computechannelmapresponse.md new file mode 100644 index 0000000..06a01b0 --- /dev/null +++ b/docs/models/operations/computechannelmapresponse.md @@ -0,0 +1,12 @@ +# ComputeChannelMapResponse + + +## 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.ComputeChannelMapResponseBody](../../models/operations/computechannelmapresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/computechannelmapresponsebody.md b/docs/models/operations/computechannelmapresponsebody.md new file mode 100644 index 0000000..0ebf1e9 --- /dev/null +++ b/docs/models/operations/computechannelmapresponsebody.md @@ -0,0 +1,10 @@ +# ComputeChannelMapResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ComputeChannelMapMediaContainer](../../models/operations/computechannelmapmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/connection.md b/docs/models/operations/connection.md new file mode 100644 index 0000000..1e9f363 --- /dev/null +++ b/docs/models/operations/connection.md @@ -0,0 +1,13 @@ +# Connection + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Address` | **string* | :heavy_minus_sign: | N/A | +| `Local` | **bool* | :heavy_minus_sign: | Indicates if the connection is the server's LAN address | +| `Port` | **int64* | :heavy_minus_sign: | N/A | +| `Protocol` | **string* | :heavy_minus_sign: | N/A | +| `Relay` | **bool* | :heavy_minus_sign: | Indicates the connection is over a relayed connection | +| `URI` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/connections.md b/docs/models/operations/connections.md deleted file mode 100644 index 2798b78..0000000 --- a/docs/models/operations/connections.md +++ /dev/null @@ -1,14 +0,0 @@ -# Connections - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `Protocol` | [operations.Protocol](../../models/operations/protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http | -| `Address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | | -| `Port` | *int* | :heavy_check_mark: | The port used for the connection | | -| `URI` | *string* | :heavy_check_mark: | The full URI of the connection | | -| `Local` | *bool* | :heavy_check_mark: | If the connection is local address | | -| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | | -| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | | \ No newline at end of file diff --git a/docs/models/operations/connectwebsocketglobals.md b/docs/models/operations/connectwebsocketglobals.md new file mode 100644 index 0000000..15647d0 --- /dev/null +++ b/docs/models/operations/connectwebsocketglobals.md @@ -0,0 +1,18 @@ +# ConnectWebSocketGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/connectwebsocketrequest.md b/docs/models/operations/connectwebsocketrequest.md new file mode 100644 index 0000000..128d009 --- /dev/null +++ b/docs/models/operations/connectwebsocketrequest.md @@ -0,0 +1,19 @@ +# ConnectWebSocketRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Filter` | []*string* | :heavy_minus_sign: | By default, all events except logs are sent. A rich filtering mechanism is provided to allow clients to opt into or out of each event type using the `filters` parameter. For example:

- `filters=-log`: All event types except logs (the default).
- `filters=foo,bar`: Only the foo and bar event types.
- `filters=`: All events types.
- `filters=-foo,bar`: All event types except foo and bar.
| | \ No newline at end of file diff --git a/docs/models/operations/connectwebsocketresponse.md b/docs/models/operations/connectwebsocketresponse.md new file mode 100644 index 0000000..e08cf18 --- /dev/null +++ b/docs/models/operations/connectwebsocketresponse.md @@ -0,0 +1,11 @@ +# ConnectWebSocketResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/context.md b/docs/models/operations/context.md deleted file mode 100644 index 93475f0..0000000 --- a/docs/models/operations/context.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 index 90aee71..c9e5e13 100644 --- a/docs/models/operations/country.md +++ b/docs/models/operations/country.md @@ -1,12 +1,15 @@ # Country -The filter query string for country media items. - ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the country.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America | -| `Filter` | *string* | :heavy_check_mark: | N/A | country=19 | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Code` | **string* | :heavy_minus_sign: | Three letter code | +| `Example` | **string* | :heavy_minus_sign: | N/A | +| `Flavor` | [*operations.Flavor](../../models/operations/flavor.md) | :heavy_minus_sign: | - `0`: The country is divided into regions, and following the key will lead to a list of regions.
- `1`: The county is divided by postal codes, and an example code is returned in `example`.
- `2`: The country has a single postal code, returned in `example`.
| +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | Three letter language code | +| `LanguageTitle` | **string* | :heavy_minus_sign: | The title of the language | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createcollectionglobals.md b/docs/models/operations/createcollectionglobals.md new file mode 100644 index 0000000..e37b15e --- /dev/null +++ b/docs/models/operations/createcollectionglobals.md @@ -0,0 +1,18 @@ +# CreateCollectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createcollectionrequest.md b/docs/models/operations/createcollectionrequest.md new file mode 100644 index 0000000..72a98e1 --- /dev/null +++ b/docs/models/operations/createcollectionrequest.md @@ -0,0 +1,23 @@ +# CreateCollectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *string* | :heavy_check_mark: | The section where this collection will be created | | +| `Title` | **string* | :heavy_minus_sign: | The title to filter by or assign | | +| `Smart` | **bool* | :heavy_minus_sign: | Whether this is a smart collection/playlist | | +| `URI` | **string* | :heavy_minus_sign: | The URI for processing the smart collection. Required for a smart collection | | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type to filter by | | \ No newline at end of file diff --git a/docs/models/operations/createcollectionresponse.md b/docs/models/operations/createcollectionresponse.md new file mode 100644 index 0000000..423c54a --- /dev/null +++ b/docs/models/operations/createcollectionresponse.md @@ -0,0 +1,11 @@ +# CreateCollectionResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createcustomhubglobals.md b/docs/models/operations/createcustomhubglobals.md new file mode 100644 index 0000000..1127b8a --- /dev/null +++ b/docs/models/operations/createcustomhubglobals.md @@ -0,0 +1,18 @@ +# CreateCustomHubGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createcustomhubrequest.md b/docs/models/operations/createcustomhubrequest.md new file mode 100644 index 0000000..2530a80 --- /dev/null +++ b/docs/models/operations/createcustomhubrequest.md @@ -0,0 +1,23 @@ +# CreateCustomHubRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to reorder | | +| `MetadataItemID` | *int64* | :heavy_check_mark: | The metadata item on which to base this hub. This must currently be a collection | | +| `PromotedToRecommended` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this hub should be displayed in recommended | 1 | +| `PromotedToOwnHome` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this hub should be displayed in admin's home | 1 | +| `PromotedToSharedHome` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this hub should be displayed in shared user's home | 1 | \ No newline at end of file diff --git a/docs/models/operations/createcustomhubresponse.md b/docs/models/operations/createcustomhubresponse.md new file mode 100644 index 0000000..0350d00 --- /dev/null +++ b/docs/models/operations/createcustomhubresponse.md @@ -0,0 +1,10 @@ +# CreateCustomHubResponse + + +## 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/createdownloadqueuemediacontainer.md b/docs/models/operations/createdownloadqueuemediacontainer.md new file mode 100644 index 0000000..cfc11e9 --- /dev/null +++ b/docs/models/operations/createdownloadqueuemediacontainer.md @@ -0,0 +1,17 @@ +# CreateDownloadQueueMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `DownloadQueue` | [][operations.DownloadQueue](../../models/operations/downloadqueue.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createdownloadqueueresponse.md b/docs/models/operations/createdownloadqueueresponse.md new file mode 100644 index 0000000..13670e1 --- /dev/null +++ b/docs/models/operations/createdownloadqueueresponse.md @@ -0,0 +1,11 @@ +# CreateDownloadQueueResponse + + +## 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.CreateDownloadQueueResponseBody](../../models/operations/createdownloadqueueresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createdownloadqueueresponsebody.md b/docs/models/operations/createdownloadqueueresponsebody.md new file mode 100644 index 0000000..bbfa441 --- /dev/null +++ b/docs/models/operations/createdownloadqueueresponsebody.md @@ -0,0 +1,10 @@ +# CreateDownloadQueueResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.CreateDownloadQueueMediaContainer](../../models/operations/createdownloadqueuemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createdvrglobals.md b/docs/models/operations/createdvrglobals.md new file mode 100644 index 0000000..f4c853c --- /dev/null +++ b/docs/models/operations/createdvrglobals.md @@ -0,0 +1,18 @@ +# CreateDVRGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createdvrrequest.md b/docs/models/operations/createdvrrequest.md new file mode 100644 index 0000000..f6c147a --- /dev/null +++ b/docs/models/operations/createdvrrequest.md @@ -0,0 +1,21 @@ +# CreateDVRRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Lineup` | **string* | :heavy_minus_sign: | The EPG lineup. | lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT | +| `DeviceQueryParameter` | []*string* | :heavy_minus_sign: | The device. | device[]=device://tv.plex.grabbers.hdhomerun/1053C0CA | +| `Language` | **string* | :heavy_minus_sign: | The language. | eng | \ No newline at end of file diff --git a/docs/models/operations/createdvrresponse.md b/docs/models/operations/createdvrresponse.md new file mode 100644 index 0000000..7446971 --- /dev/null +++ b/docs/models/operations/createdvrresponse.md @@ -0,0 +1,12 @@ +# CreateDVRResponse + + +## 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 | +| `DvrRequestHandlerSlashGetResponses200` | [*components.DvrRequestHandlerSlashGetResponses200](../../models/components/dvrrequesthandlerslashgetresponses200.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createmarkerglobals.md b/docs/models/operations/createmarkerglobals.md new file mode 100644 index 0000000..5e30c45 --- /dev/null +++ b/docs/models/operations/createmarkerglobals.md @@ -0,0 +1,18 @@ +# CreateMarkerGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createmarkermediacontainer.md b/docs/models/operations/createmarkermediacontainer.md new file mode 100644 index 0000000..1189da4 --- /dev/null +++ b/docs/models/operations/createmarkermediacontainer.md @@ -0,0 +1,23 @@ +# CreateMarkerMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Color` | **string* | :heavy_minus_sign: | N/A | +| `EndTimeOffset` | **int64* | :heavy_minus_sign: | N/A | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `StartTimeOffset` | **int64* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | [*operations.CreateMarkerType](../../models/operations/createmarkertype.md) | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createmarkerrequest.md b/docs/models/operations/createmarkerrequest.md new file mode 100644 index 0000000..e86a002 --- /dev/null +++ b/docs/models/operations/createmarkerrequest.md @@ -0,0 +1,23 @@ +# CreateMarkerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Type` | *int64* | :heavy_check_mark: | The type of marker to edit/create | | +| `StartTimeOffset` | *int64* | :heavy_check_mark: | The start time of the marker | | +| `EndTimeOffset` | **int64* | :heavy_minus_sign: | The end time of the marker | | +| `Attributes` | [*operations.Attributes](../../models/operations/attributes.md) | :heavy_minus_sign: | The attributes to assign to this marker | {
"title": "My favorite spot"
} | \ No newline at end of file diff --git a/docs/models/operations/createmarkerresponse.md b/docs/models/operations/createmarkerresponse.md new file mode 100644 index 0000000..025a668 --- /dev/null +++ b/docs/models/operations/createmarkerresponse.md @@ -0,0 +1,11 @@ +# CreateMarkerResponse + + +## 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.CreateMarkerResponseBody](../../models/operations/createmarkerresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createmarkerresponsebody.md b/docs/models/operations/createmarkerresponsebody.md new file mode 100644 index 0000000..ba717b5 --- /dev/null +++ b/docs/models/operations/createmarkerresponsebody.md @@ -0,0 +1,10 @@ +# CreateMarkerResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.CreateMarkerMediaContainer](../../models/operations/createmarkermediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createmarkertype.md b/docs/models/operations/createmarkertype.md new file mode 100644 index 0000000..2bdf3c0 --- /dev/null +++ b/docs/models/operations/createmarkertype.md @@ -0,0 +1,12 @@ +# CreateMarkerType + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `CreateMarkerTypeIntro` | intro | +| `CreateMarkerTypeCommercial` | commercial | +| `CreateMarkerTypeBookmark` | bookmark | +| `CreateMarkerTypeResume` | resume | +| `CreateMarkerTypeCredit` | credit | \ No newline at end of file diff --git a/docs/models/operations/createplaylistglobals.md b/docs/models/operations/createplaylistglobals.md new file mode 100644 index 0000000..953cfec --- /dev/null +++ b/docs/models/operations/createplaylistglobals.md @@ -0,0 +1,18 @@ +# CreatePlaylistGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createplaylistmediacontainer.md b/docs/models/operations/createplaylistmediacontainer.md deleted file mode 100644 index 4f020d6..0000000 --- a/docs/models/operations/createplaylistmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# CreatePlaylistMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 7 | -| `Metadata` | [][operations.CreatePlaylistMetadata](../../models/operations/createplaylistmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/createplaylistmetadata.md b/docs/models/operations/createplaylistmetadata.md deleted file mode 100644 index 1231837..0000000 --- a/docs/models/operations/createplaylistmetadata.md +++ /dev/null @@ -1,23 +0,0 @@ -# CreatePlaylistMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 96 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/96/items | -| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://a2f92937-1408-40e2-b022-63a8a9377e55 | -| `Type` | **string* | :heavy_minus_sign: | N/A | playlist | -| `Title` | **string* | :heavy_minus_sign: | N/A | A Great Playlist | -| `Summary` | **string* | :heavy_minus_sign: | N/A | What a great playlist | -| `Smart` | **bool* | :heavy_minus_sign: | N/A | false | -| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video | -| `Icon` | **string* | :heavy_minus_sign: | N/A | playlist://image.smart | -| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1705719589 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 1 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705719589 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705724593 | -| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/96/composite/1705724593 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 141000 | \ No newline at end of file diff --git a/docs/models/operations/createplaylistqueryparamtype.md b/docs/models/operations/createplaylistqueryparamtype.md deleted file mode 100644 index 5f2699f..0000000 --- a/docs/models/operations/createplaylistqueryparamtype.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreatePlaylistQueryParamType - -type of playlist to create - - -## Values - -| Name | Value | -| ----------------------------------- | ----------------------------------- | -| `CreatePlaylistQueryParamTypeAudio` | audio | -| `CreatePlaylistQueryParamTypeVideo` | video | -| `CreatePlaylistQueryParamTypePhoto` | photo | \ No newline at end of file diff --git a/docs/models/operations/createplaylistrequest.md b/docs/models/operations/createplaylistrequest.md index 8afc68d..dcfe0af 100644 --- a/docs/models/operations/createplaylistrequest.md +++ b/docs/models/operations/createplaylistrequest.md @@ -3,10 +3,18 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Title` | *string* | :heavy_check_mark: | name of the playlist | -| `Type` | [operations.CreatePlaylistQueryParamType](../../models/operations/createplaylistqueryparamtype.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_check_mark: | 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 +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URI` | **string* | :heavy_minus_sign: | The content URI for what we're playing (e.g. `library://...`). | | +| `PlayQueueID` | **int64* | :heavy_minus_sign: | To create a playlist from an existing play queue. | | \ No newline at end of file diff --git a/docs/models/operations/createplaylistresponse.md b/docs/models/operations/createplaylistresponse.md index 77036e5..1ebca22 100644 --- a/docs/models/operations/createplaylistresponse.md +++ b/docs/models/operations/createplaylistresponse.md @@ -3,9 +3,9 @@ ## 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.CreatePlaylistResponseBody](../../models/operations/createplaylistresponsebody.md) | :heavy_minus_sign: | returns all playlists | \ No newline at end of file +| 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createplaylistresponsebody.md b/docs/models/operations/createplaylistresponsebody.md deleted file mode 100644 index 345c302..0000000 --- a/docs/models/operations/createplaylistresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreatePlaylistResponseBody - -returns all playlists - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.CreatePlaylistMediaContainer](../../models/operations/createplaylistmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createplayqueueglobals.md b/docs/models/operations/createplayqueueglobals.md new file mode 100644 index 0000000..50c1791 --- /dev/null +++ b/docs/models/operations/createplayqueueglobals.md @@ -0,0 +1,18 @@ +# CreatePlayQueueGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createplayqueuemediacontainer.md b/docs/models/operations/createplayqueuemediacontainer.md new file mode 100644 index 0000000..0e802a2 --- /dev/null +++ b/docs/models/operations/createplayqueuemediacontainer.md @@ -0,0 +1,25 @@ +# CreatePlayQueueMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `PlayQueueID` | **int64* | :heavy_minus_sign: | The ID of the play queue, which is used in subsequent requests. | +| `PlayQueueLastAddedItemID` | **string* | :heavy_minus_sign: | Defines where the "Up Next" region starts | +| `PlayQueueSelectedItemID` | **int64* | :heavy_minus_sign: | The queue item ID of the currently selected item. | +| `PlayQueueSelectedItemOffset` | **int64* | :heavy_minus_sign: | The offset of the selected item in the play queue, from the beginning of the queue. | +| `PlayQueueSelectedMetadataItemID` | **int64* | :heavy_minus_sign: | The metadata item ID of the currently selected item (matches `ratingKey` attribute in metadata item if the media provider is a library). | +| `PlayQueueShuffled` | **bool* | :heavy_minus_sign: | Whether or not the queue is shuffled. | +| `PlayQueueSourceURI` | **string* | :heavy_minus_sign: | The original URI used to create the play queue. | +| `PlayQueueTotalCount` | **int64* | :heavy_minus_sign: | The total number of items in the play queue. | +| `PlayQueueVersion` | **int64* | :heavy_minus_sign: | The version of the play queue. It increments every time a change is made to the play queue to assist clients in knowing when to refresh. | \ No newline at end of file diff --git a/docs/models/operations/createplayqueuerequest.md b/docs/models/operations/createplayqueuerequest.md new file mode 100644 index 0000000..a5fdc8d --- /dev/null +++ b/docs/models/operations/createplayqueuerequest.md @@ -0,0 +1,28 @@ +# CreatePlayQueueRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URI` | **string* | :heavy_minus_sign: | The content URI for what we're playing. | | +| `PlaylistID` | **int64* | :heavy_minus_sign: | the ID of the playlist we're playing. | | +| `Type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | The type of play queue to create | | +| `Key` | **string* | :heavy_minus_sign: | The key of the first item to play, defaults to the first in the play queue. | | +| `Shuffle` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether to shuffle the playlist, defaults to 0. | 1 | +| `Repeat` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | If the PQ is bigger than the window, fill any empty space with wraparound items, defaults to 0. | 1 | +| `Continuous` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether to create a continuous play queue (e.g. from an episode), defaults to 0. | 1 | +| `ExtrasPrefixCount` | **int64* | :heavy_minus_sign: | Number of trailers to prepend a movie with not including the pre-roll. If omitted the pre-roll will not be returned in the play queue. When resuming a movie `extrasPrefixCount` should be omitted as a parameter instead of passing 0. | | +| `Recursive` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Only applies to queues of type photo, whether to retrieve all descendent photos from an album or section, defaults to 1. | 1 | +| `OnDeck` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Only applies to queues of type show or seasons, whether to return a queue that is started on the On Deck episode if one exists. Otherwise begins the play queue on the beginning of the show or season. | 1 | \ No newline at end of file diff --git a/docs/models/operations/createplayqueueresponse.md b/docs/models/operations/createplayqueueresponse.md new file mode 100644 index 0000000..bbc1343 --- /dev/null +++ b/docs/models/operations/createplayqueueresponse.md @@ -0,0 +1,12 @@ +# CreatePlayQueueResponse + + +## 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.CreatePlayQueueResponseBody](../../models/operations/createplayqueueresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createplayqueueresponsebody.md b/docs/models/operations/createplayqueueresponsebody.md new file mode 100644 index 0000000..adabd0c --- /dev/null +++ b/docs/models/operations/createplayqueueresponsebody.md @@ -0,0 +1,10 @@ +# CreatePlayQueueResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.CreatePlayQueueMediaContainer](../../models/operations/createplayqueuemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createsubscriptionglobals.md b/docs/models/operations/createsubscriptionglobals.md new file mode 100644 index 0000000..0c10abe --- /dev/null +++ b/docs/models/operations/createsubscriptionglobals.md @@ -0,0 +1,18 @@ +# CreateSubscriptionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/createsubscriptionmediacontainer.md b/docs/models/operations/createsubscriptionmediacontainer.md new file mode 100644 index 0000000..a8c57e2 --- /dev/null +++ b/docs/models/operations/createsubscriptionmediacontainer.md @@ -0,0 +1,17 @@ +# CreateSubscriptionMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `MediaSubscription` | [][components.MediaSubscription](../../models/components/mediasubscription.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createsubscriptionqueryparamprefs.md b/docs/models/operations/createsubscriptionqueryparamprefs.md new file mode 100644 index 0000000..b1cba5d --- /dev/null +++ b/docs/models/operations/createsubscriptionqueryparamprefs.md @@ -0,0 +1,9 @@ +# CreateSubscriptionQueryParamPrefs + +Subscription preferences. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/createsubscriptionrequest.md b/docs/models/operations/createsubscriptionrequest.md new file mode 100644 index 0000000..1946165 --- /dev/null +++ b/docs/models/operations/createsubscriptionrequest.md @@ -0,0 +1,24 @@ +# CreateSubscriptionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `TargetLibrarySectionID` | **int64* | :heavy_minus_sign: | The library section into which we'll grab the media. Not actually required when the subscription is to a playlist. | 1 | +| `TargetSectionLocationID` | **int64* | :heavy_minus_sign: | The section location into which to grab. | 3 | +| `Type` | **int64* | :heavy_minus_sign: | The type of the thing we're subscribing too (e.g. show, season). | 2 | +| `Hints` | [*operations.Hints](../../models/operations/hints.md) | :heavy_minus_sign: | Hints describing what we're looking for. Note: The hint `ratingKey` is required for downloading from a PMS remote. | {
"title": "Family Guy"
} | +| `Prefs` | [*operations.CreateSubscriptionQueryParamPrefs](../../models/operations/createsubscriptionqueryparamprefs.md) | :heavy_minus_sign: | Subscription preferences. | {
"minVideoQuality": 720
} | +| `Params` | [*operations.Params](../../models/operations/params.md) | :heavy_minus_sign: | Subscription parameters.
- `mediaProviderID`: Required for downloads to indicate which MP the subscription will download into
- `source`: Required for downloads to indicate the source of the downloaded content.
| {
"mediaProviderID": 1
} | \ No newline at end of file diff --git a/docs/models/operations/createsubscriptionresponse.md b/docs/models/operations/createsubscriptionresponse.md new file mode 100644 index 0000000..509d21e --- /dev/null +++ b/docs/models/operations/createsubscriptionresponse.md @@ -0,0 +1,12 @@ +# CreateSubscriptionResponse + + +## 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.CreateSubscriptionResponseBody](../../models/operations/createsubscriptionresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createsubscriptionresponsebody.md b/docs/models/operations/createsubscriptionresponsebody.md new file mode 100644 index 0000000..cb73e42 --- /dev/null +++ b/docs/models/operations/createsubscriptionresponsebody.md @@ -0,0 +1,10 @@ +# CreateSubscriptionResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.CreateSubscriptionMediaContainer](../../models/operations/createsubscriptionmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/decisionresult.md b/docs/models/operations/decisionresult.md new file mode 100644 index 0000000..ef5581c --- /dev/null +++ b/docs/models/operations/decisionresult.md @@ -0,0 +1,16 @@ +# DecisionResult + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `AvailableBandwidth` | **int64* | :heavy_minus_sign: | The maximum bitrate set when item was added | +| `DirectPlayDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `DirectPlayDecisionText` | **string* | :heavy_minus_sign: | N/A | +| `GeneralDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `GeneralDecisionText` | **string* | :heavy_minus_sign: | N/A | +| `MdeDecisionCode` | **int64* | :heavy_minus_sign: | The code indicating the status of evaluation of playback when client indicates `hasMDE=1` | +| `MdeDecisionText` | **string* | :heavy_minus_sign: | Descriptive text for the above code | +| `TranscodeDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `TranscodeDecisionText` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/defaultdirection.md b/docs/models/operations/defaultdirection.md deleted file mode 100644 index 3d7745b..0000000 --- a/docs/models/operations/defaultdirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# DefaultDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| ---------------------------- | ---------------------------- | -| `DefaultDirectionAscending` | asc | -| `DefaultDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/defaultsubtitleaccessibility.md b/docs/models/operations/defaultsubtitleaccessibility.md deleted file mode 100644 index 0def9c3..0000000 --- a/docs/models/operations/defaultsubtitleaccessibility.md +++ /dev/null @@ -1,11 +0,0 @@ -# DefaultSubtitleAccessibility - -The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) - - -## Values - -| Name | Value | -| ------------------------------------- | ------------------------------------- | -| `DefaultSubtitleAccessibilityDisable` | 0 | -| `DefaultSubtitleAccessibilityEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/defaultsubtitleforced.md b/docs/models/operations/defaultsubtitleforced.md deleted file mode 100644 index b27ccf2..0000000 --- a/docs/models/operations/defaultsubtitleforced.md +++ /dev/null @@ -1,11 +0,0 @@ -# DefaultSubtitleForced - -The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) - - -## Values - -| Name | Value | -| ------------------------------ | ------------------------------ | -| `DefaultSubtitleForcedDisable` | 0 | -| `DefaultSubtitleForcedEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/deletecachesresponse.md b/docs/models/operations/deletecachesresponse.md new file mode 100644 index 0000000..ab4dd7e --- /dev/null +++ b/docs/models/operations/deletecachesresponse.md @@ -0,0 +1,10 @@ +# DeleteCachesResponse + + +## 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/deletecollectionglobals.md b/docs/models/operations/deletecollectionglobals.md new file mode 100644 index 0000000..480cc36 --- /dev/null +++ b/docs/models/operations/deletecollectionglobals.md @@ -0,0 +1,18 @@ +# DeleteCollectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletecollectionitemglobals.md b/docs/models/operations/deletecollectionitemglobals.md new file mode 100644 index 0000000..ab5c52d --- /dev/null +++ b/docs/models/operations/deletecollectionitemglobals.md @@ -0,0 +1,18 @@ +# DeleteCollectionItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletecollectionitemrequest.md b/docs/models/operations/deletecollectionitemrequest.md new file mode 100644 index 0000000..97f07bd --- /dev/null +++ b/docs/models/operations/deletecollectionitemrequest.md @@ -0,0 +1,20 @@ +# DeleteCollectionItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `CollectionID` | *int64* | :heavy_check_mark: | The collection id | | +| `ItemID` | *int64* | :heavy_check_mark: | The item to delete | | \ No newline at end of file diff --git a/docs/models/operations/deletecollectionitemresponse.md b/docs/models/operations/deletecollectionitemresponse.md new file mode 100644 index 0000000..3e02a4a --- /dev/null +++ b/docs/models/operations/deletecollectionitemresponse.md @@ -0,0 +1,11 @@ +# DeleteCollectionItemResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/deletecollectionrequest.md b/docs/models/operations/deletecollectionrequest.md new file mode 100644 index 0000000..e8fdcd6 --- /dev/null +++ b/docs/models/operations/deletecollectionrequest.md @@ -0,0 +1,20 @@ +# DeleteCollectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `CollectionID` | *int64* | :heavy_check_mark: | Collection Id | | \ No newline at end of file diff --git a/docs/models/operations/deletecollectionresponse.md b/docs/models/operations/deletecollectionresponse.md new file mode 100644 index 0000000..c2c6693 --- /dev/null +++ b/docs/models/operations/deletecollectionresponse.md @@ -0,0 +1,10 @@ +# DeleteCollectionResponse + + +## 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/deletecustomhubglobals.md b/docs/models/operations/deletecustomhubglobals.md new file mode 100644 index 0000000..fefaad6 --- /dev/null +++ b/docs/models/operations/deletecustomhubglobals.md @@ -0,0 +1,18 @@ +# DeleteCustomHubGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletecustomhubrequest.md b/docs/models/operations/deletecustomhubrequest.md new file mode 100644 index 0000000..a5ffc8f --- /dev/null +++ b/docs/models/operations/deletecustomhubrequest.md @@ -0,0 +1,20 @@ +# DeleteCustomHubRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to change | | +| `Identifier` | *string* | :heavy_check_mark: | The identifier of the hub to change | | \ No newline at end of file diff --git a/docs/models/operations/deletecustomhubresponse.md b/docs/models/operations/deletecustomhubresponse.md new file mode 100644 index 0000000..ca2604a --- /dev/null +++ b/docs/models/operations/deletecustomhubresponse.md @@ -0,0 +1,10 @@ +# DeleteCustomHubResponse + + +## 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/deletedvrglobals.md b/docs/models/operations/deletedvrglobals.md new file mode 100644 index 0000000..06af732 --- /dev/null +++ b/docs/models/operations/deletedvrglobals.md @@ -0,0 +1,18 @@ +# DeleteDVRGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletedvrrequest.md b/docs/models/operations/deletedvrrequest.md new file mode 100644 index 0000000..3d4ed1a --- /dev/null +++ b/docs/models/operations/deletedvrrequest.md @@ -0,0 +1,19 @@ +# DeleteDVRRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | \ No newline at end of file diff --git a/docs/models/operations/deletedvrresponse.md b/docs/models/operations/deletedvrresponse.md new file mode 100644 index 0000000..e4364db --- /dev/null +++ b/docs/models/operations/deletedvrresponse.md @@ -0,0 +1,10 @@ +# DeleteDVRResponse + + +## 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/deletehistoryglobals.md b/docs/models/operations/deletehistoryglobals.md new file mode 100644 index 0000000..6d89d2e --- /dev/null +++ b/docs/models/operations/deletehistoryglobals.md @@ -0,0 +1,18 @@ +# DeleteHistoryGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletehistoryrequest.md b/docs/models/operations/deletehistoryrequest.md new file mode 100644 index 0000000..d1a7e8d --- /dev/null +++ b/docs/models/operations/deletehistoryrequest.md @@ -0,0 +1,19 @@ +# DeleteHistoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `HistoryID` | *int64* | :heavy_check_mark: | The id of the history item (the `historyKey` from above) | | \ No newline at end of file diff --git a/docs/models/operations/deletehistoryresponse.md b/docs/models/operations/deletehistoryresponse.md new file mode 100644 index 0000000..c7e87d2 --- /dev/null +++ b/docs/models/operations/deletehistoryresponse.md @@ -0,0 +1,12 @@ +# DeleteHistoryResponse + + +## 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 | +| `MediaContainer` | [*components.MediaContainer](../../models/components/mediacontainer.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteindexesglobals.md b/docs/models/operations/deleteindexesglobals.md new file mode 100644 index 0000000..a639c8b --- /dev/null +++ b/docs/models/operations/deleteindexesglobals.md @@ -0,0 +1,18 @@ +# DeleteIndexesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deleteindexesrequest.md b/docs/models/operations/deleteindexesrequest.md new file mode 100644 index 0000000..0e6571a --- /dev/null +++ b/docs/models/operations/deleteindexesrequest.md @@ -0,0 +1,19 @@ +# DeleteIndexesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/deleteindexesresponse.md b/docs/models/operations/deleteindexesresponse.md new file mode 100644 index 0000000..e9d22a1 --- /dev/null +++ b/docs/models/operations/deleteindexesresponse.md @@ -0,0 +1,10 @@ +# DeleteIndexesResponse + + +## 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/deleteintrosglobals.md b/docs/models/operations/deleteintrosglobals.md new file mode 100644 index 0000000..95b1003 --- /dev/null +++ b/docs/models/operations/deleteintrosglobals.md @@ -0,0 +1,18 @@ +# DeleteIntrosGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deleteintrosrequest.md b/docs/models/operations/deleteintrosrequest.md new file mode 100644 index 0000000..ff5bf4e --- /dev/null +++ b/docs/models/operations/deleteintrosrequest.md @@ -0,0 +1,19 @@ +# DeleteIntrosRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/deleteintrosresponse.md b/docs/models/operations/deleteintrosresponse.md new file mode 100644 index 0000000..737a6ef --- /dev/null +++ b/docs/models/operations/deleteintrosresponse.md @@ -0,0 +1,10 @@ +# DeleteIntrosResponse + + +## 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 deleted file mode 100644 index c58fde2..0000000 --- a/docs/models/operations/deletelibraryrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# DeleteLibraryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file diff --git a/docs/models/operations/deletelibraryresponse.md b/docs/models/operations/deletelibraryresponse.md deleted file mode 100644 index 7ced67b..0000000 --- a/docs/models/operations/deletelibraryresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/deletelibrarysectionglobals.md b/docs/models/operations/deletelibrarysectionglobals.md new file mode 100644 index 0000000..3cd165a --- /dev/null +++ b/docs/models/operations/deletelibrarysectionglobals.md @@ -0,0 +1,18 @@ +# DeleteLibrarySectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletelibrarysectionrequest.md b/docs/models/operations/deletelibrarysectionrequest.md new file mode 100644 index 0000000..4f581a8 --- /dev/null +++ b/docs/models/operations/deletelibrarysectionrequest.md @@ -0,0 +1,20 @@ +# DeleteLibrarySectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *string* | :heavy_check_mark: | The section identifier | | +| `Async` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | If set, response will return an activity with the actual deletion process. Otherwise request will return when deletion is complete | 1 | \ No newline at end of file diff --git a/docs/models/operations/deletelibrarysectionresponse.md b/docs/models/operations/deletelibrarysectionresponse.md new file mode 100644 index 0000000..876441c --- /dev/null +++ b/docs/models/operations/deletelibrarysectionresponse.md @@ -0,0 +1,10 @@ +# DeleteLibrarySectionResponse + + +## 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/deletelineupdvr.md b/docs/models/operations/deletelineupdvr.md new file mode 100644 index 0000000..add9c2a --- /dev/null +++ b/docs/models/operations/deletelineupdvr.md @@ -0,0 +1,12 @@ +# DeleteLineupDVR + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletelineupdvrsmediacontainer.md b/docs/models/operations/deletelineupdvrsmediacontainer.md new file mode 100644 index 0000000..9c74dbd --- /dev/null +++ b/docs/models/operations/deletelineupdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# DeleteLineupDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/deletelineupglobals.md b/docs/models/operations/deletelineupglobals.md new file mode 100644 index 0000000..b6c9cde --- /dev/null +++ b/docs/models/operations/deletelineupglobals.md @@ -0,0 +1,18 @@ +# DeleteLineupGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletelineupmediacontainer.md b/docs/models/operations/deletelineupmediacontainer.md new file mode 100644 index 0000000..1f095dc --- /dev/null +++ b/docs/models/operations/deletelineupmediacontainer.md @@ -0,0 +1,9 @@ +# DeleteLineupMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.DeleteLineupDVRsMediaContainer](../../models/operations/deletelineupdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.DeleteLineupDVR](../../models/operations/deletelineupdvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletelineuprequest.md b/docs/models/operations/deletelineuprequest.md new file mode 100644 index 0000000..19b2929 --- /dev/null +++ b/docs/models/operations/deletelineuprequest.md @@ -0,0 +1,20 @@ +# DeleteLineupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | +| `Lineup` | *string* | :heavy_check_mark: | The lineup to delete | | \ No newline at end of file diff --git a/docs/models/operations/deletelineupresponse.md b/docs/models/operations/deletelineupresponse.md new file mode 100644 index 0000000..2cdf583 --- /dev/null +++ b/docs/models/operations/deletelineupresponse.md @@ -0,0 +1,12 @@ +# DeleteLineupResponse + + +## 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.DeleteLineupResponseBody](../../models/operations/deletelineupresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletelineupresponsebody.md b/docs/models/operations/deletelineupresponsebody.md new file mode 100644 index 0000000..a569ba6 --- /dev/null +++ b/docs/models/operations/deletelineupresponsebody.md @@ -0,0 +1,10 @@ +# DeleteLineupResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.DeleteLineupMediaContainer](../../models/operations/deletelineupmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletemarkerglobals.md b/docs/models/operations/deletemarkerglobals.md new file mode 100644 index 0000000..d207844 --- /dev/null +++ b/docs/models/operations/deletemarkerglobals.md @@ -0,0 +1,18 @@ +# DeleteMarkerGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletemarkerrequest.md b/docs/models/operations/deletemarkerrequest.md new file mode 100644 index 0000000..8387ec4 --- /dev/null +++ b/docs/models/operations/deletemarkerrequest.md @@ -0,0 +1,20 @@ +# DeleteMarkerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Marker` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/deletemarkerresponse.md b/docs/models/operations/deletemarkerresponse.md new file mode 100644 index 0000000..651bed1 --- /dev/null +++ b/docs/models/operations/deletemarkerresponse.md @@ -0,0 +1,10 @@ +# DeleteMarkerResponse + + +## 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/deletemediaitemglobals.md b/docs/models/operations/deletemediaitemglobals.md new file mode 100644 index 0000000..e707be9 --- /dev/null +++ b/docs/models/operations/deletemediaitemglobals.md @@ -0,0 +1,18 @@ +# DeleteMediaItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletemediaitemrequest.md b/docs/models/operations/deletemediaitemrequest.md new file mode 100644 index 0000000..c51270e --- /dev/null +++ b/docs/models/operations/deletemediaitemrequest.md @@ -0,0 +1,21 @@ +# DeleteMediaItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `MediaItem` | *string* | :heavy_check_mark: | N/A | | +| `Proxy` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether proxy items, such as media optimized versions, should also be deleted. Defaults to false. | 1 | \ No newline at end of file diff --git a/docs/models/operations/deletemediaitemresponse.md b/docs/models/operations/deletemediaitemresponse.md new file mode 100644 index 0000000..dc53286 --- /dev/null +++ b/docs/models/operations/deletemediaitemresponse.md @@ -0,0 +1,10 @@ +# DeleteMediaItemResponse + + +## 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/deletemediaproviderglobals.md b/docs/models/operations/deletemediaproviderglobals.md new file mode 100644 index 0000000..d8cfd66 --- /dev/null +++ b/docs/models/operations/deletemediaproviderglobals.md @@ -0,0 +1,18 @@ +# DeleteMediaProviderGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletemediaproviderrequest.md b/docs/models/operations/deletemediaproviderrequest.md new file mode 100644 index 0000000..ee2f1f3 --- /dev/null +++ b/docs/models/operations/deletemediaproviderrequest.md @@ -0,0 +1,19 @@ +# DeleteMediaProviderRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Provider` | *string* | :heavy_check_mark: | The ID of the media provider to delete | | \ No newline at end of file diff --git a/docs/models/operations/deletemediaproviderresponse.md b/docs/models/operations/deletemediaproviderresponse.md new file mode 100644 index 0000000..1ae1312 --- /dev/null +++ b/docs/models/operations/deletemediaproviderresponse.md @@ -0,0 +1,10 @@ +# DeleteMediaProviderResponse + + +## 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/deletemetadataitemglobals.md b/docs/models/operations/deletemetadataitemglobals.md new file mode 100644 index 0000000..b9ed93f --- /dev/null +++ b/docs/models/operations/deletemetadataitemglobals.md @@ -0,0 +1,18 @@ +# DeleteMetadataItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletemetadataitemrequest.md b/docs/models/operations/deletemetadataitemrequest.md new file mode 100644 index 0000000..deb2319 --- /dev/null +++ b/docs/models/operations/deletemetadataitemrequest.md @@ -0,0 +1,20 @@ +# DeleteMetadataItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Proxy` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether proxy items, such as media optimized versions, should also be deleted. Defaults to false. | 1 | \ No newline at end of file diff --git a/docs/models/operations/deletemetadataitemresponse.md b/docs/models/operations/deletemetadataitemresponse.md new file mode 100644 index 0000000..ca1ad79 --- /dev/null +++ b/docs/models/operations/deletemetadataitemresponse.md @@ -0,0 +1,10 @@ +# DeleteMetadataItemResponse + + +## 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/deleteplaylistglobals.md b/docs/models/operations/deleteplaylistglobals.md new file mode 100644 index 0000000..3e5bb15 --- /dev/null +++ b/docs/models/operations/deleteplaylistglobals.md @@ -0,0 +1,18 @@ +# DeletePlaylistGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deleteplaylistitemglobals.md b/docs/models/operations/deleteplaylistitemglobals.md new file mode 100644 index 0000000..0d9b405 --- /dev/null +++ b/docs/models/operations/deleteplaylistitemglobals.md @@ -0,0 +1,18 @@ +# DeletePlaylistItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deleteplaylistitemrequest.md b/docs/models/operations/deleteplaylistitemrequest.md new file mode 100644 index 0000000..085f975 --- /dev/null +++ b/docs/models/operations/deleteplaylistitemrequest.md @@ -0,0 +1,20 @@ +# DeletePlaylistItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `GeneratorID` | *int64* | :heavy_check_mark: | The generator item ID to delete. | | \ No newline at end of file diff --git a/docs/models/operations/deleteplaylistitemresponse.md b/docs/models/operations/deleteplaylistitemresponse.md new file mode 100644 index 0000000..c15cb5a --- /dev/null +++ b/docs/models/operations/deleteplaylistitemresponse.md @@ -0,0 +1,11 @@ +# DeletePlaylistItemResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/deleteplaylistrequest.md b/docs/models/operations/deleteplaylistrequest.md index dd49a72..7e120ac 100644 --- a/docs/models/operations/deleteplaylistrequest.md +++ b/docs/models/operations/deleteplaylistrequest.md @@ -3,6 +3,17 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | \ No newline at end of file diff --git a/docs/models/operations/deleteplayqueueitemglobals.md b/docs/models/operations/deleteplayqueueitemglobals.md new file mode 100644 index 0000000..d8016af --- /dev/null +++ b/docs/models/operations/deleteplayqueueitemglobals.md @@ -0,0 +1,18 @@ +# DeletePlayQueueItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deleteplayqueueitemrequest.md b/docs/models/operations/deleteplayqueueitemrequest.md new file mode 100644 index 0000000..75c1372 --- /dev/null +++ b/docs/models/operations/deleteplayqueueitemrequest.md @@ -0,0 +1,20 @@ +# DeletePlayQueueItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | +| `PlayQueueItemID` | *int64* | :heavy_check_mark: | The play queue item ID to delete. | | \ No newline at end of file diff --git a/docs/models/operations/deleteplayqueueitemresponse.md b/docs/models/operations/deleteplayqueueitemresponse.md new file mode 100644 index 0000000..6a14c8b --- /dev/null +++ b/docs/models/operations/deleteplayqueueitemresponse.md @@ -0,0 +1,11 @@ +# DeletePlayQueueItemResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/deletestreamglobals.md b/docs/models/operations/deletestreamglobals.md new file mode 100644 index 0000000..6cc3d90 --- /dev/null +++ b/docs/models/operations/deletestreamglobals.md @@ -0,0 +1,18 @@ +# DeleteStreamGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletestreamrequest.md b/docs/models/operations/deletestreamrequest.md new file mode 100644 index 0000000..388302e --- /dev/null +++ b/docs/models/operations/deletestreamrequest.md @@ -0,0 +1,20 @@ +# DeleteStreamRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `StreamID` | *int64* | :heavy_check_mark: | The id of the stream | | +| `Ext` | *string* | :heavy_check_mark: | This is not a part of this endpoint but documented here to satisfy OpenAPI | | \ No newline at end of file diff --git a/docs/models/operations/deletestreamresponse.md b/docs/models/operations/deletestreamresponse.md new file mode 100644 index 0000000..d9df9eb --- /dev/null +++ b/docs/models/operations/deletestreamresponse.md @@ -0,0 +1,10 @@ +# DeleteStreamResponse + + +## 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/deletesubscriptionglobals.md b/docs/models/operations/deletesubscriptionglobals.md new file mode 100644 index 0000000..721fc2d --- /dev/null +++ b/docs/models/operations/deletesubscriptionglobals.md @@ -0,0 +1,18 @@ +# DeleteSubscriptionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/deletesubscriptionrequest.md b/docs/models/operations/deletesubscriptionrequest.md new file mode 100644 index 0000000..a6d9f9a --- /dev/null +++ b/docs/models/operations/deletesubscriptionrequest.md @@ -0,0 +1,19 @@ +# DeleteSubscriptionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SubscriptionID` | *int64* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/deletesubscriptionresponse.md b/docs/models/operations/deletesubscriptionresponse.md new file mode 100644 index 0000000..26e3ebe --- /dev/null +++ b/docs/models/operations/deletesubscriptionresponse.md @@ -0,0 +1,10 @@ +# DeleteSubscriptionResponse + + +## 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/detectadsglobals.md b/docs/models/operations/detectadsglobals.md new file mode 100644 index 0000000..51dc911 --- /dev/null +++ b/docs/models/operations/detectadsglobals.md @@ -0,0 +1,18 @@ +# DetectAdsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/detectadsrequest.md b/docs/models/operations/detectadsrequest.md new file mode 100644 index 0000000..538c277 --- /dev/null +++ b/docs/models/operations/detectadsrequest.md @@ -0,0 +1,19 @@ +# DetectAdsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/detectadsresponse.md b/docs/models/operations/detectadsresponse.md new file mode 100644 index 0000000..b51b4f4 --- /dev/null +++ b/docs/models/operations/detectadsresponse.md @@ -0,0 +1,10 @@ +# DetectAdsResponse + + +## 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/detectcreditsglobals.md b/docs/models/operations/detectcreditsglobals.md new file mode 100644 index 0000000..4630af4 --- /dev/null +++ b/docs/models/operations/detectcreditsglobals.md @@ -0,0 +1,18 @@ +# DetectCreditsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/detectcreditsrequest.md b/docs/models/operations/detectcreditsrequest.md new file mode 100644 index 0000000..d506db7 --- /dev/null +++ b/docs/models/operations/detectcreditsrequest.md @@ -0,0 +1,21 @@ +# DetectCreditsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Force` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | +| `Manual` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/detectcreditsresponse.md b/docs/models/operations/detectcreditsresponse.md new file mode 100644 index 0000000..9b2fe7f --- /dev/null +++ b/docs/models/operations/detectcreditsresponse.md @@ -0,0 +1,10 @@ +# DetectCreditsResponse + + +## 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/detectintrosglobals.md b/docs/models/operations/detectintrosglobals.md new file mode 100644 index 0000000..d087bb4 --- /dev/null +++ b/docs/models/operations/detectintrosglobals.md @@ -0,0 +1,18 @@ +# DetectIntrosGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/detectintrosrequest.md b/docs/models/operations/detectintrosrequest.md new file mode 100644 index 0000000..273fb92 --- /dev/null +++ b/docs/models/operations/detectintrosrequest.md @@ -0,0 +1,21 @@ +# DetectIntrosRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Force` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicate whether detection should be re-run | 1 | +| `Threshold` | **float64* | :heavy_minus_sign: | The threshold for determining if content is an intro or not | | \ No newline at end of file diff --git a/docs/models/operations/detectintrosresponse.md b/docs/models/operations/detectintrosresponse.md new file mode 100644 index 0000000..edabfa7 --- /dev/null +++ b/docs/models/operations/detectintrosresponse.md @@ -0,0 +1,10 @@ +# DetectIntrosResponse + + +## 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/detectvoiceactivityglobals.md b/docs/models/operations/detectvoiceactivityglobals.md new file mode 100644 index 0000000..690c941 --- /dev/null +++ b/docs/models/operations/detectvoiceactivityglobals.md @@ -0,0 +1,18 @@ +# DetectVoiceActivityGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/detectvoiceactivityrequest.md b/docs/models/operations/detectvoiceactivityrequest.md new file mode 100644 index 0000000..1f15a49 --- /dev/null +++ b/docs/models/operations/detectvoiceactivityrequest.md @@ -0,0 +1,21 @@ +# DetectVoiceActivityRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Force` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicate whether detection should be re-run | 1 | +| `Manual` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicate whether detection is manually run | 1 | \ No newline at end of file diff --git a/docs/models/operations/detectvoiceactivityresponse.md b/docs/models/operations/detectvoiceactivityresponse.md new file mode 100644 index 0000000..8e72c38 --- /dev/null +++ b/docs/models/operations/detectvoiceactivityresponse.md @@ -0,0 +1,10 @@ +# DetectVoiceActivityResponse + + +## 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 index a80e5a5..0597e07 100644 --- a/docs/models/operations/device.md +++ b/docs/models/operations/device.md @@ -3,10 +3,9 @@ ## 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 +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `AccessToken` | **string* | :heavy_minus_sign: | N/A | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | N/A | +| `Connection` | [][operations.Connection](../../models/operations/connection.md) | :heavy_minus_sign: | N/A | +| `Name` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/devicechannel.md b/docs/models/operations/devicechannel.md new file mode 100644 index 0000000..a99b67e --- /dev/null +++ b/docs/models/operations/devicechannel.md @@ -0,0 +1,15 @@ +# DeviceChannel + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Drm` | **bool* | :heavy_minus_sign: | Indicates the channel is DRMed and thus may not be playable | +| `Favorite` | **bool* | :heavy_minus_sign: | N/A | +| `Hd` | **bool* | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Name` | **string* | :heavy_minus_sign: | N/A | +| `SignalQuality` | **int64* | :heavy_minus_sign: | N/A | +| `SignalStrength` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/director.md b/docs/models/operations/director.md deleted file mode 100644 index a0b5a82..0000000 --- a/docs/models/operations/director.md +++ /dev/null @@ -1,12 +0,0 @@ -# Director - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the director. | 126522 | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this director. | director=235876 | -| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle | -| `TagKey` | *string* | :heavy_check_mark: | A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. | 5d776831151a60001f24d031 | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the director. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/operations/directory.md b/docs/models/operations/directory.md index c2f7033..568e06c 100644 --- a/docs/models/operations/directory.md +++ b/docs/models/operations/directory.md @@ -3,8 +3,11 @@ ## 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 +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `Filter` | **string* | :heavy_minus_sign: | The filter string to view metadata wit this tag | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `Tag` | **string* | :heavy_minus_sign: | The name of the tag | +| `TagKey` | **string* | :heavy_minus_sign: | The key of this tag. This is a universal key across all PMS instances and plex.tv services | +| `TagType` | **int64* | :heavy_minus_sign: | The type of the tag | +| `Thumb` | **string* | :heavy_minus_sign: | The URL to a thumbnail for this tag | \ No newline at end of file diff --git a/docs/models/operations/discoverdevicesresponse.md b/docs/models/operations/discoverdevicesresponse.md new file mode 100644 index 0000000..557b4b1 --- /dev/null +++ b/docs/models/operations/discoverdevicesresponse.md @@ -0,0 +1,11 @@ +# DiscoverDevicesResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/download.md b/docs/models/operations/download.md deleted file mode 100644 index c5fc1e8..0000000 --- a/docs/models/operations/download.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/downloadqueue.md b/docs/models/operations/downloadqueue.md new file mode 100644 index 0000000..73d228c --- /dev/null +++ b/docs/models/operations/downloadqueue.md @@ -0,0 +1,10 @@ +# DownloadQueue + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `ItemCount` | **int64* | :heavy_minus_sign: | N/A | +| `Status` | [*operations.Status](../../models/operations/status.md) | :heavy_minus_sign: | The state of this queue
- deciding: At least one item is still being decided
- waiting: At least one item is waiting for transcode and none are currently transcoding
- processing: At least one item is being transcoded
- done: All items are available (or potentially expired)
- error: At least one item has encountered an error
| \ No newline at end of file diff --git a/docs/models/operations/downloadqueueitem.md b/docs/models/operations/downloadqueueitem.md new file mode 100644 index 0000000..436d030 --- /dev/null +++ b/docs/models/operations/downloadqueueitem.md @@ -0,0 +1,15 @@ +# DownloadQueueItem + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DecisionResult` | [*operations.DecisionResult](../../models/operations/decisionresult.md) | :heavy_minus_sign: | N/A | +| `Error` | **string* | :heavy_minus_sign: | The error encountered in transcoding or decision | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `QueueID` | **int64* | :heavy_minus_sign: | N/A | +| `Status` | [*operations.ListDownloadQueueItemsStatus](../../models/operations/listdownloadqueueitemsstatus.md) | :heavy_minus_sign: | The state of the item:
- deciding: The item decision is pending
- waiting: The item is waiting for transcode
- processing: The item is being transcoded
- available: The item is available for download
- error: The item encountered an error in the decision or transcode
- expired: The transcoded item has timed out and is no longer available
| +| `Transcode` | [*operations.Transcode](../../models/operations/transcode.md) | :heavy_minus_sign: | The transcode session object which is not yet documented otherwise it'd be a $ref here. | +| `TranscodeSession` | [*components.TranscodeSession](../../models/components/transcodesession.md) | :heavy_minus_sign: | The transcode session if item is currently being transcoded | \ No newline at end of file diff --git a/docs/models/operations/dvr.md b/docs/models/operations/dvr.md new file mode 100644 index 0000000..425ec25 --- /dev/null +++ b/docs/models/operations/dvr.md @@ -0,0 +1,12 @@ +# Dvr + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/editmarkerglobals.md b/docs/models/operations/editmarkerglobals.md new file mode 100644 index 0000000..764f7ce --- /dev/null +++ b/docs/models/operations/editmarkerglobals.md @@ -0,0 +1,18 @@ +# EditMarkerGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/editmarkerrequest.md b/docs/models/operations/editmarkerrequest.md new file mode 100644 index 0000000..84db00b --- /dev/null +++ b/docs/models/operations/editmarkerrequest.md @@ -0,0 +1,24 @@ +# EditMarkerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Marker` | *string* | :heavy_check_mark: | The id of the marker to edit | | +| `Type` | *int64* | :heavy_check_mark: | The type of marker to edit/create | | +| `StartTimeOffset` | *int64* | :heavy_check_mark: | The start time of the marker | | +| `EndTimeOffset` | **int64* | :heavy_minus_sign: | The end time of the marker | | +| `Attributes` | [*operations.QueryParamAttributes](../../models/operations/queryparamattributes.md) | :heavy_minus_sign: | The attributes to assign to this marker | {
"title": "My favorite spot"
} | \ No newline at end of file diff --git a/docs/models/operations/editmarkerresponse.md b/docs/models/operations/editmarkerresponse.md new file mode 100644 index 0000000..7b16a31 --- /dev/null +++ b/docs/models/operations/editmarkerresponse.md @@ -0,0 +1,11 @@ +# EditMarkerResponse + + +## 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 | +| `PostResponses200` | [*components.PostResponses200](../../models/components/postresponses200.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/editmetadataitemglobals.md b/docs/models/operations/editmetadataitemglobals.md new file mode 100644 index 0000000..d8c5b57 --- /dev/null +++ b/docs/models/operations/editmetadataitemglobals.md @@ -0,0 +1,18 @@ +# EditMetadataItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/editmetadataitemrequest.md b/docs/models/operations/editmetadataitemrequest.md new file mode 100644 index 0000000..b72dcef --- /dev/null +++ b/docs/models/operations/editmetadataitemrequest.md @@ -0,0 +1,20 @@ +# EditMetadataItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | []*string* | :heavy_check_mark: | N/A | | +| `Args` | [*operations.Args](../../models/operations/args.md) | :heavy_minus_sign: | The new values for the metadata item | | \ No newline at end of file diff --git a/docs/models/operations/editmetadataitemresponse.md b/docs/models/operations/editmetadataitemresponse.md new file mode 100644 index 0000000..717a084 --- /dev/null +++ b/docs/models/operations/editmetadataitemresponse.md @@ -0,0 +1,10 @@ +# EditMetadataItemResponse + + +## 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/editsectionglobals.md b/docs/models/operations/editsectionglobals.md new file mode 100644 index 0000000..34ba4e3 --- /dev/null +++ b/docs/models/operations/editsectionglobals.md @@ -0,0 +1,18 @@ +# EditSectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/editsectionqueryparamprefs.md b/docs/models/operations/editsectionqueryparamprefs.md new file mode 100644 index 0000000..713e00f --- /dev/null +++ b/docs/models/operations/editsectionqueryparamprefs.md @@ -0,0 +1,9 @@ +# EditSectionQueryParamPrefs + +The preferences for this section + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/editsectionrequest.md b/docs/models/operations/editsectionrequest.md new file mode 100644 index 0000000..983da47 --- /dev/null +++ b/docs/models/operations/editsectionrequest.md @@ -0,0 +1,26 @@ +# EditSectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *string* | :heavy_check_mark: | The section identifier | | +| `Name` | **string* | :heavy_minus_sign: | The name of the new section | | +| `Scanner` | **string* | :heavy_minus_sign: | The scanner this section should use | | +| `Agent` | *string* | :heavy_check_mark: | The agent this section should use for metadata | | +| `MetadataAgentProviderGroupID` | **string* | :heavy_minus_sign: | The agent group id for this section | | +| `Language` | **string* | :heavy_minus_sign: | The language of this section | | +| `Locations` | []*string* | :heavy_minus_sign: | The locations on disk to add to this section | [
"O:\\fatboy\\Media\\Ripped\\Music",
"O:\\fatboy\\Media\\My Music"
] | +| `Prefs` | [*operations.EditSectionQueryParamPrefs](../../models/operations/editsectionqueryparamprefs.md) | :heavy_minus_sign: | The preferences for this section | {
"collectionMode": 2,
"hidden": 0
} | \ No newline at end of file diff --git a/docs/models/operations/editsectionresponse.md b/docs/models/operations/editsectionresponse.md new file mode 100644 index 0000000..573cf22 --- /dev/null +++ b/docs/models/operations/editsectionresponse.md @@ -0,0 +1,10 @@ +# EditSectionResponse + + +## 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/editsubscriptionpreferencesglobals.md b/docs/models/operations/editsubscriptionpreferencesglobals.md new file mode 100644 index 0000000..33db13b --- /dev/null +++ b/docs/models/operations/editsubscriptionpreferencesglobals.md @@ -0,0 +1,18 @@ +# EditSubscriptionPreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/editsubscriptionpreferencesqueryparamprefs.md b/docs/models/operations/editsubscriptionpreferencesqueryparamprefs.md new file mode 100644 index 0000000..1f4aba5 --- /dev/null +++ b/docs/models/operations/editsubscriptionpreferencesqueryparamprefs.md @@ -0,0 +1,7 @@ +# EditSubscriptionPreferencesQueryParamPrefs + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/editsubscriptionpreferencesrequest.md b/docs/models/operations/editsubscriptionpreferencesrequest.md new file mode 100644 index 0000000..1588edb --- /dev/null +++ b/docs/models/operations/editsubscriptionpreferencesrequest.md @@ -0,0 +1,20 @@ +# EditSubscriptionPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SubscriptionID` | *int64* | :heavy_check_mark: | N/A | | +| `Prefs` | [*operations.EditSubscriptionPreferencesQueryParamPrefs](../../models/operations/editsubscriptionpreferencesqueryparamprefs.md) | :heavy_minus_sign: | N/A | {
"minVideoQuality": 720
} | \ No newline at end of file diff --git a/docs/models/operations/editsubscriptionpreferencesresponse.md b/docs/models/operations/editsubscriptionpreferencesresponse.md new file mode 100644 index 0000000..683ea0b --- /dev/null +++ b/docs/models/operations/editsubscriptionpreferencesresponse.md @@ -0,0 +1,11 @@ +# EditSubscriptionPreferencesResponse + + +## 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 | +| `MediaContainerWithSubscription` | [*components.MediaContainerWithSubscription](../../models/components/mediacontainerwithsubscription.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/element.md b/docs/models/operations/element.md new file mode 100644 index 0000000..1193803 --- /dev/null +++ b/docs/models/operations/element.md @@ -0,0 +1,13 @@ +# Element + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `ElementThumb` | thumb | +| `ElementArt` | art | +| `ElementClearLogo` | clearLogo | +| `ElementBanner` | banner | +| `ElementPoster` | poster | +| `ElementTheme` | theme | \ No newline at end of file diff --git a/docs/models/operations/emptytrashglobals.md b/docs/models/operations/emptytrashglobals.md new file mode 100644 index 0000000..bdd4287 --- /dev/null +++ b/docs/models/operations/emptytrashglobals.md @@ -0,0 +1,18 @@ +# EmptyTrashGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/emptytrashrequest.md b/docs/models/operations/emptytrashrequest.md new file mode 100644 index 0000000..e47f5fe --- /dev/null +++ b/docs/models/operations/emptytrashrequest.md @@ -0,0 +1,19 @@ +# EmptyTrashRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/emptytrashresponse.md b/docs/models/operations/emptytrashresponse.md new file mode 100644 index 0000000..38b20ca --- /dev/null +++ b/docs/models/operations/emptytrashresponse.md @@ -0,0 +1,10 @@ +# EmptyTrashResponse + + +## 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/enablepapertrailglobals.md b/docs/models/operations/enablepapertrailglobals.md new file mode 100644 index 0000000..1bf06f3 --- /dev/null +++ b/docs/models/operations/enablepapertrailglobals.md @@ -0,0 +1,18 @@ +# EnablePapertrailGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/enablepapertrailrequest.md b/docs/models/operations/enablepapertrailrequest.md new file mode 100644 index 0000000..4ddc915 --- /dev/null +++ b/docs/models/operations/enablepapertrailrequest.md @@ -0,0 +1,19 @@ +# EnablePapertrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Minutes` | **int64* | :heavy_minus_sign: | The number of minutes logging should be sent to Papertrail | | \ No newline at end of file diff --git a/docs/models/operations/enablepapertrailresponse.md b/docs/models/operations/enablepapertrailresponse.md index 6baff18..4a0115e 100644 --- a/docs/models/operations/enablepapertrailresponse.md +++ b/docs/models/operations/enablepapertrailresponse.md @@ -1,4 +1,4 @@ -# EnablePaperTrailResponse +# EnablePapertrailResponse ## Fields diff --git a/docs/models/operations/extension.md b/docs/models/operations/extension.md new file mode 100644 index 0000000..c018090 --- /dev/null +++ b/docs/models/operations/extension.md @@ -0,0 +1,12 @@ +# Extension + +Extension + + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `ExtensionM3u8` | m3u8 | +| `ExtensionMpd` | mpd | \ No newline at end of file diff --git a/docs/models/operations/extras.md b/docs/models/operations/extras.md deleted file mode 100644 index 3273ab6..0000000 --- a/docs/models/operations/extras.md +++ /dev/null @@ -1,8 +0,0 @@ -# Extras - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `Size` | **int64* | :heavy_minus_sign: | The size of the extras. | 1 | \ No newline at end of file diff --git a/docs/models/operations/feature.md b/docs/models/operations/feature.md index a83a76a..63f3815 100644 --- a/docs/models/operations/feature.md +++ b/docs/models/operations/feature.md @@ -3,12 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Key` | **string* | :heavy_minus_sign: | N/A | | -| `Type` | *string* | :heavy_check_mark: | N/A | | -| `Flavor` | **string* | :heavy_minus_sign: | N/A | global | -| `ScrobbleKey` | **string* | :heavy_minus_sign: | N/A | /:/scrobble/new | -| `UnscrobbleKey` | **string* | :heavy_minus_sign: | N/A | /:/unscrobble/new | -| `Directory` | [][operations.GetMediaProvidersDirectory](../../models/operations/getmediaprovidersdirectory.md) | :heavy_minus_sign: | N/A | | -| `Action` | [][operations.Action](../../models/operations/action.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Directory` | [][components.Directory](../../models/components/directory.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/field.md b/docs/models/operations/field.md deleted file mode 100644 index 8539fd0..0000000 --- a/docs/models/operations/field.md +++ /dev/null @@ -1,11 +0,0 @@ -# Field - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | show.title | -| `Title` | *string* | :heavy_check_mark: | N/A | Show Title | -| `Type` | *string* | :heavy_check_mark: | N/A | string | -| `SubType` | **string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/models/operations/fieldtype.md b/docs/models/operations/fieldtype.md deleted file mode 100644 index da092d3..0000000 --- a/docs/models/operations/fieldtype.md +++ /dev/null @@ -1,9 +0,0 @@ -# FieldType - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `Type` | *string* | :heavy_check_mark: | N/A | tag | -| `Operator` | [][operations.Operator](../../models/operations/operator.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/filter.md b/docs/models/operations/filter.md deleted file mode 100644 index 43a9487..0000000 --- a/docs/models/operations/filter.md +++ /dev/null @@ -1,12 +0,0 @@ -# Filter - -Filter - - -## Values - -| Name | Value | -| ----------------- | ----------------- | -| `FilterAll` | all | -| `FilterAvailable` | available | -| `FilterReleased` | released | \ No newline at end of file diff --git a/docs/models/operations/flattenseasons.md b/docs/models/operations/flattenseasons.md deleted file mode 100644 index 8d58d34..0000000 --- a/docs/models/operations/flattenseasons.md +++ /dev/null @@ -1,13 +0,0 @@ -# FlattenSeasons - -Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). - - - -## Values - -| Name | Value | -| ------------------------------ | ------------------------------ | -| `FlattenSeasonsLibraryDefault` | -1 | -| `FlattenSeasonsHide` | 0 | -| `FlattenSeasonsShow` | 1 | \ No newline at end of file diff --git a/docs/models/operations/flavor.md b/docs/models/operations/flavor.md new file mode 100644 index 0000000..cbaf538 --- /dev/null +++ b/docs/models/operations/flavor.md @@ -0,0 +1,15 @@ +# Flavor + +- `0`: The country is divided into regions, and following the key will lead to a list of regions. +- `1`: The county is divided by postal codes, and an example code is returned in `example`. +- `2`: The country has a single postal code, returned in `example`. + + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `FlavorZero` | 0 | +| `FlavorOne` | 1 | +| `FlavorTwo` | 2 | \ No newline at end of file diff --git a/docs/models/operations/force.md b/docs/models/operations/force.md deleted file mode 100644 index 40cd1cc..0000000 --- a/docs/models/operations/force.md +++ /dev/null @@ -1,11 +0,0 @@ -# Force - -Force the refresh even if the library is already being refreshed. - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ForceZero` | 0 | -| `ForceOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/format.md b/docs/models/operations/format.md new file mode 100644 index 0000000..363b931 --- /dev/null +++ b/docs/models/operations/format.md @@ -0,0 +1,13 @@ +# Format + +The output format for the image; defaults to jpg + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `FormatJpg` | jpg | +| `FormatJpeg` | jpeg | +| `FormatPng` | png | +| `FormatPpm` | ppm | \ No newline at end of file diff --git a/docs/models/operations/friend.md b/docs/models/operations/friend.md deleted file mode 100644 index f163c0c..0000000 --- a/docs/models/operations/friend.md +++ /dev/null @@ -1,19 +0,0 @@ -# Friend - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Email` | *string* | :heavy_check_mark: | The account email address | username@email.com | -| `FriendlyName` | *string* | :heavy_check_mark: | The account full name | exampleUser | -| `Home` | *bool* | :heavy_check_mark: | If the account is a Plex Home user | | -| `ID` | *int* | :heavy_check_mark: | The Plex account ID | | -| `Restricted` | **bool* | :heavy_minus_sign: | If the account is a Plex Home managed user | | -| `SharedServers` | [][operations.SharedServers](../../models/operations/sharedservers.md) | :heavy_check_mark: | N/A | | -| `SharedSources` | [][operations.SharedSources](../../models/operations/sharedsources.md) | :heavy_check_mark: | N/A | | -| `Status` | [operations.Status](../../models/operations/status.md) | :heavy_check_mark: | Current friend request status | accepted | -| `Thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578 | -| `Title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | username123 | -| `Username` | *string* | :heavy_check_mark: | The account username | username123 | -| `UUID` | *string* | :heavy_check_mark: | The account Universally Unique Identifier (UUID) | 7d1916e0d8f6e76b | \ No newline at end of file diff --git a/docs/models/operations/generatethumbsglobals.md b/docs/models/operations/generatethumbsglobals.md new file mode 100644 index 0000000..4d86b70 --- /dev/null +++ b/docs/models/operations/generatethumbsglobals.md @@ -0,0 +1,18 @@ +# GenerateThumbsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/generatethumbsrequest.md b/docs/models/operations/generatethumbsrequest.md new file mode 100644 index 0000000..071d5ee --- /dev/null +++ b/docs/models/operations/generatethumbsrequest.md @@ -0,0 +1,20 @@ +# GenerateThumbsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Force` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/generatethumbsresponse.md b/docs/models/operations/generatethumbsresponse.md new file mode 100644 index 0000000..a12c68e --- /dev/null +++ b/docs/models/operations/generatethumbsresponse.md @@ -0,0 +1,10 @@ +# GenerateThumbsResponse + + +## 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/genre.md b/docs/models/operations/genre.md deleted file mode 100644 index a8d2e5e..0000000 --- a/docs/models/operations/genre.md +++ /dev/null @@ -1,12 +0,0 @@ -# Genre - -The filter query string for similar items. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the genre.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Filter` | *string* | :heavy_check_mark: | N/A | genre=19 | -| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item
| Crime | \ No newline at end of file diff --git a/docs/models/operations/geodata.md b/docs/models/operations/geodata.md deleted file mode 100644 index 2332026..0000000 --- a/docs/models/operations/geodata.md +++ /dev/null @@ -1,20 +0,0 @@ -# GeoData - -Geo location data - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `Code` | *string* | :heavy_check_mark: | The ISO 3166-1 alpha-2 code of the country. | VI | -| `ContinentCode` | *string* | :heavy_check_mark: | The continent code where the country is located. | NA | -| `Country` | *string* | :heavy_check_mark: | The official name of the country. | United States Virgin Islands | -| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam | -| `EuropeanUnionMember` | **bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true | -| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas | -| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 | -| `InPrivacyRestrictedCountry` | **bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true | -| `InPrivacyRestrictedRegion` | **bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true | -| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas | -| `Coordinates` | *string* | :heavy_check_mark: | The geographical coordinates (latitude, longitude) of the location. | 18.3381, -64.8941 | \ No newline at end of file diff --git a/docs/models/operations/getactorslibrarydirectory.md b/docs/models/operations/getactorslibrarydirectory.md deleted file mode 100644 index d99c2be..0000000 --- a/docs/models/operations/getactorslibrarydirectory.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetActorsLibraryDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `FastKey` | *string* | :heavy_check_mark: | A fast lookup key for the actor relative url. | /library/sections/2/all?actor=134671 | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the actor. | https://metadata-static.plex.tv/e/people/e2a915b537ef720252b6d408bc1f91b3.jpg | -| `Key` | *string* | :heavy_check_mark: | A unique key representing the actor. | 134671 | -| `Title` | *string* | :heavy_check_mark: | The name of the actor. | Aaron Paul | \ No newline at end of file diff --git a/docs/models/operations/getactorslibrarymediacontainer.md b/docs/models/operations/getactorslibrarymediacontainer.md deleted file mode 100644 index b632b4a..0000000 --- a/docs/models/operations/getactorslibrarymediacontainer.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetActorsLibraryMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series | -| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor | -| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary | -| `ViewMode` | **string* | :heavy_minus_sign: | Identifier for the view mode. | 131131 | -| `Directory` | [][operations.GetActorsLibraryDirectory](../../models/operations/getactorslibrarydirectory.md) | :heavy_minus_sign: | An array of actor entries for media items. | | \ No newline at end of file diff --git a/docs/models/operations/getactorslibraryqueryparamtype.md b/docs/models/operations/getactorslibraryqueryparamtype.md deleted file mode 100644 index d4adb04..0000000 --- a/docs/models/operations/getactorslibraryqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetActorsLibraryQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| ------------------------------------------ | ------------------------------------------ | -| `GetActorsLibraryQueryParamTypeMovie` | 1 | -| `GetActorsLibraryQueryParamTypeTvShow` | 2 | -| `GetActorsLibraryQueryParamTypeSeason` | 3 | -| `GetActorsLibraryQueryParamTypeEpisode` | 4 | -| `GetActorsLibraryQueryParamTypeArtist` | 5 | -| `GetActorsLibraryQueryParamTypeAlbum` | 6 | -| `GetActorsLibraryQueryParamTypeTrack` | 7 | -| `GetActorsLibraryQueryParamTypePhotoAlbum` | 8 | -| `GetActorsLibraryQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getactorslibraryrequest.md b/docs/models/operations/getactorslibraryrequest.md deleted file mode 100644 index 7139761..0000000 --- a/docs/models/operations/getactorslibraryrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetActorsLibraryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `Type` | [operations.GetActorsLibraryQueryParamType](../../models/operations/getactorslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/models/operations/getactorslibraryresponse.md b/docs/models/operations/getactorslibraryresponse.md deleted file mode 100644 index 4230910..0000000 --- a/docs/models/operations/getactorslibraryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetActorsLibraryResponse - - -## 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.GetActorsLibraryResponseBody](../../models/operations/getactorslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/getactorslibraryresponsebody.md b/docs/models/operations/getactorslibraryresponsebody.md deleted file mode 100644 index ce4528e..0000000 --- a/docs/models/operations/getactorslibraryresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetActorsLibraryResponseBody - -Successful response containing media container data. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetActorsLibraryMediaContainer](../../models/operations/getactorslibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getalbumsglobals.md b/docs/models/operations/getalbumsglobals.md new file mode 100644 index 0000000..9f60d3d --- /dev/null +++ b/docs/models/operations/getalbumsglobals.md @@ -0,0 +1,18 @@ +# GetAlbumsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getalbumsrequest.md b/docs/models/operations/getalbumsrequest.md new file mode 100644 index 0000000..a222e38 --- /dev/null +++ b/docs/models/operations/getalbumsrequest.md @@ -0,0 +1,19 @@ +# GetAlbumsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getalbumsresponse.md b/docs/models/operations/getalbumsresponse.md new file mode 100644 index 0000000..b95d77a --- /dev/null +++ b/docs/models/operations/getalbumsresponse.md @@ -0,0 +1,11 @@ +# GetAlbumsResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getallhubsglobals.md b/docs/models/operations/getallhubsglobals.md new file mode 100644 index 0000000..8152602 --- /dev/null +++ b/docs/models/operations/getallhubsglobals.md @@ -0,0 +1,18 @@ +# GetAllHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getallhubsmediacontainer.md b/docs/models/operations/getallhubsmediacontainer.md new file mode 100644 index 0000000..8710f83 --- /dev/null +++ b/docs/models/operations/getallhubsmediacontainer.md @@ -0,0 +1,17 @@ +# GetAllHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getallhubsrequest.md b/docs/models/operations/getallhubsrequest.md new file mode 100644 index 0000000..15fce33 --- /dev/null +++ b/docs/models/operations/getallhubsrequest.md @@ -0,0 +1,21 @@ +# GetAllHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `OnlyTransient` | [*components.BoolInt](../../models/components/boolint.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) | 1 | +| `Identifier` | []*string* | :heavy_minus_sign: | If provided, limit to only specified hubs | | \ No newline at end of file diff --git a/docs/models/operations/getallhubsresponse.md b/docs/models/operations/getallhubsresponse.md new file mode 100644 index 0000000..eb160b4 --- /dev/null +++ b/docs/models/operations/getallhubsresponse.md @@ -0,0 +1,12 @@ +# GetAllHubsResponse + + +## 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.GetAllHubsResponseBody](../../models/operations/getallhubsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getallhubsresponsebody.md b/docs/models/operations/getallhubsresponsebody.md new file mode 100644 index 0000000..47f6940 --- /dev/null +++ b/docs/models/operations/getallhubsresponsebody.md @@ -0,0 +1,10 @@ +# GetAllHubsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetAllHubsMediaContainer](../../models/operations/getallhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getallitemleavesglobals.md b/docs/models/operations/getallitemleavesglobals.md new file mode 100644 index 0000000..9ab90b2 --- /dev/null +++ b/docs/models/operations/getallitemleavesglobals.md @@ -0,0 +1,18 @@ +# GetAllItemLeavesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getallitemleavesrequest.md b/docs/models/operations/getallitemleavesrequest.md new file mode 100644 index 0000000..c6d3dee --- /dev/null +++ b/docs/models/operations/getallitemleavesrequest.md @@ -0,0 +1,19 @@ +# GetAllItemLeavesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getallitemleavesresponse.md b/docs/models/operations/getallitemleavesresponse.md new file mode 100644 index 0000000..585feb8 --- /dev/null +++ b/docs/models/operations/getallitemleavesresponse.md @@ -0,0 +1,12 @@ +# GetAllItemLeavesResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getalllanguagesmediacontainer.md b/docs/models/operations/getalllanguagesmediacontainer.md new file mode 100644 index 0000000..abb86d9 --- /dev/null +++ b/docs/models/operations/getalllanguagesmediacontainer.md @@ -0,0 +1,17 @@ +# GetAllLanguagesMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Language` | [][operations.Language](../../models/operations/language.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getalllanguagesresponse.md b/docs/models/operations/getalllanguagesresponse.md new file mode 100644 index 0000000..5d25b7a --- /dev/null +++ b/docs/models/operations/getalllanguagesresponse.md @@ -0,0 +1,12 @@ +# GetAllLanguagesResponse + + +## 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.GetAllLanguagesResponseBody](../../models/operations/getalllanguagesresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getalllanguagesresponsebody.md b/docs/models/operations/getalllanguagesresponsebody.md new file mode 100644 index 0000000..b724aa9 --- /dev/null +++ b/docs/models/operations/getalllanguagesresponsebody.md @@ -0,0 +1,10 @@ +# GetAllLanguagesResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetAllLanguagesMediaContainer](../../models/operations/getalllanguagesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getallleavesglobals.md b/docs/models/operations/getallleavesglobals.md new file mode 100644 index 0000000..69b6292 --- /dev/null +++ b/docs/models/operations/getallleavesglobals.md @@ -0,0 +1,18 @@ +# GetAllLeavesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getallleavesrequest.md b/docs/models/operations/getallleavesrequest.md new file mode 100644 index 0000000..ed11f1b --- /dev/null +++ b/docs/models/operations/getallleavesrequest.md @@ -0,0 +1,19 @@ +# GetAllLeavesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getallleavesresponse.md b/docs/models/operations/getallleavesresponse.md new file mode 100644 index 0000000..3e6c143 --- /dev/null +++ b/docs/models/operations/getallleavesresponse.md @@ -0,0 +1,11 @@ +# GetAllLeavesResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getalllibrariesdirectory.md b/docs/models/operations/getalllibrariesdirectory.md deleted file mode 100644 index ca0a582..0000000 --- a/docs/models/operations/getalllibrariesdirectory.md +++ /dev/null @@ -1,28 +0,0 @@ -# GetAllLibrariesDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Composite` | *string* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 | -| `Filters` | *bool* | :heavy_check_mark: | UNKNOWN | true | -| `Refreshing` | *bool* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Key` | *string* | :heavy_check_mark: | The library key representing the unique identifier | 1 | -| `Type` | [operations.GetAllLibrariesType](../../models/operations/getalllibrariestype.md) | :heavy_check_mark: | N/A | movie | -| `Title` | *string* | :heavy_check_mark: | The title of the library | Movies | -| `Agent` | *string* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie | -| `Scanner` | *string* | :heavy_check_mark: | UNKNOWN | Plex Movie | -| `Language` | *string* | :heavy_check_mark: | The Plex library language that has been set | en-US | -| `UUID` | *string* | :heavy_check_mark: | The universally unique identifier for the library. | e69655a2-ef48-4aba-bb19-01e7d3cc34d6 | -| `UpdatedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | 1556281940 | -| `ScannedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `Content` | *bool* | :heavy_check_mark: | UNKNOWN | true | -| `Directory` | *bool* | :heavy_check_mark: | UNKNOWN | true | -| `ContentChangedAt` | *int64* | :heavy_check_mark: | Timestamp (in seconds) representing the last time the content was modified.
NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64
| 9173960 | -| `Hidden` | [*operations.Hidden](../../models/operations/hidden.md) | :heavy_minus_sign: | The Plex library visibility setting | 1 | -| `Location` | [][operations.GetAllLibrariesLocation](../../models/operations/getalllibrarieslocation.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getalllibrarieslocation.md b/docs/models/operations/getalllibrarieslocation.md deleted file mode 100644 index 107eaa9..0000000 --- a/docs/models/operations/getalllibrarieslocation.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetAllLibrariesLocation - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `ID` | *int* | :heavy_check_mark: | The ID of the location. | 1 | -| `Path` | *string* | :heavy_check_mark: | The path to the media item. | /Movies | \ No newline at end of file diff --git a/docs/models/operations/getalllibrariesmediacontainer.md b/docs/models/operations/getalllibrariesmediacontainer.md deleted file mode 100644 index 82b4f59..0000000 --- a/docs/models/operations/getalllibrariesmediacontainer.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetAllLibrariesMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series | -| `Directory` | [][operations.GetAllLibrariesDirectory](../../models/operations/getalllibrariesdirectory.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getalllibrariesresponse.md b/docs/models/operations/getalllibrariesresponse.md deleted file mode 100644 index 9b07ebc..0000000 --- a/docs/models/operations/getalllibrariesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetAllLibrariesResponse - - -## 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.GetAllLibrariesResponseBody](../../models/operations/getalllibrariesresponsebody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/operations/getalllibrariesresponsebody.md b/docs/models/operations/getalllibrariesresponsebody.md deleted file mode 100644 index 13a6f10..0000000 --- a/docs/models/operations/getalllibrariesresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAllLibrariesResponseBody - -The libraries available on the Server - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetAllLibrariesMediaContainer](../../models/operations/getalllibrariesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getalllibrariestype.md b/docs/models/operations/getalllibrariestype.md deleted file mode 100644 index 535be9d..0000000 --- a/docs/models/operations/getalllibrariestype.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetAllLibrariesType - -The library type - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `GetAllLibrariesTypeMovie` | movie | -| `GetAllLibrariesTypeTvShow` | show | -| `GetAllLibrariesTypeSeason` | season | -| `GetAllLibrariesTypeEpisode` | episode | -| `GetAllLibrariesTypeArtist` | artist | -| `GetAllLibrariesTypeAlbum` | album | -| `GetAllLibrariesTypeTrack` | track | -| `GetAllLibrariesTypePhotoAlbum` | photoalbum | -| `GetAllLibrariesTypePhoto` | photo | -| `GetAllLibrariesTypeCollection` | collection | \ No newline at end of file diff --git a/docs/models/operations/getallpreferencesresponse.md b/docs/models/operations/getallpreferencesresponse.md new file mode 100644 index 0000000..58add65 --- /dev/null +++ b/docs/models/operations/getallpreferencesresponse.md @@ -0,0 +1,11 @@ +# GetAllPreferencesResponse + + +## 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 | +| `MediaContainerWithSettings` | [*components.MediaContainerWithSettings](../../models/components/mediacontainerwithsettings.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getallsubscriptionsglobals.md b/docs/models/operations/getallsubscriptionsglobals.md new file mode 100644 index 0000000..9c13ccc --- /dev/null +++ b/docs/models/operations/getallsubscriptionsglobals.md @@ -0,0 +1,18 @@ +# GetAllSubscriptionsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getallsubscriptionsrequest.md b/docs/models/operations/getallsubscriptionsrequest.md new file mode 100644 index 0000000..1245286 --- /dev/null +++ b/docs/models/operations/getallsubscriptionsrequest.md @@ -0,0 +1,20 @@ +# GetAllSubscriptionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `IncludeGrabs` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates whether the active grabs should be included as well | 1 | +| `IncludeStorage` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Compute the storage of recorded items desired by this subscription | 1 | \ No newline at end of file diff --git a/docs/models/operations/getallsubscriptionsresponse.md b/docs/models/operations/getallsubscriptionsresponse.md new file mode 100644 index 0000000..68bd7cc --- /dev/null +++ b/docs/models/operations/getallsubscriptionsresponse.md @@ -0,0 +1,12 @@ +# GetAllSubscriptionsResponse + + +## 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 | +| `MediaContainerWithSubscription` | [*components.MediaContainerWithSubscription](../../models/components/mediacontainerwithsubscription.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getartsglobals.md b/docs/models/operations/getartsglobals.md new file mode 100644 index 0000000..c1d989d --- /dev/null +++ b/docs/models/operations/getartsglobals.md @@ -0,0 +1,18 @@ +# GetArtsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getartsrequest.md b/docs/models/operations/getartsrequest.md new file mode 100644 index 0000000..2a9410f --- /dev/null +++ b/docs/models/operations/getartsrequest.md @@ -0,0 +1,19 @@ +# GetArtsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getartsresponse.md b/docs/models/operations/getartsresponse.md new file mode 100644 index 0000000..324ce7a --- /dev/null +++ b/docs/models/operations/getartsresponse.md @@ -0,0 +1,11 @@ +# GetArtsResponse + + +## 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 | +| `MediaContainerWithArtwork` | [*components.MediaContainerWithArtwork](../../models/components/mediacontainerwithartwork.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getaugmentationstatusglobals.md b/docs/models/operations/getaugmentationstatusglobals.md new file mode 100644 index 0000000..20b70ed --- /dev/null +++ b/docs/models/operations/getaugmentationstatusglobals.md @@ -0,0 +1,18 @@ +# GetAugmentationStatusGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getaugmentationstatusrequest.md b/docs/models/operations/getaugmentationstatusrequest.md new file mode 100644 index 0000000..7a2d123 --- /dev/null +++ b/docs/models/operations/getaugmentationstatusrequest.md @@ -0,0 +1,20 @@ +# GetAugmentationStatusRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `AugmentationID` | *string* | :heavy_check_mark: | The id of the augmentation | | +| `Wait` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Wait for augmentation completion before returning | 1 | \ No newline at end of file diff --git a/docs/models/operations/getaugmentationstatusresponse.md b/docs/models/operations/getaugmentationstatusresponse.md new file mode 100644 index 0000000..ed8ddb3 --- /dev/null +++ b/docs/models/operations/getaugmentationstatusresponse.md @@ -0,0 +1,10 @@ +# GetAugmentationStatusResponse + + +## 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/getavailableclientsmediacontainer.md b/docs/models/operations/getavailableclientsmediacontainer.md deleted file mode 100644 index 7165205..0000000 --- a/docs/models/operations/getavailableclientsmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index 4e89bec..0000000 --- a/docs/models/operations/getavailableclientsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetAvailableClientsResponseBody](../../models/operations/getavailableclientsresponsebody.md) | :heavy_minus_sign: | Available Clients | \ No newline at end of file diff --git a/docs/models/operations/getavailableclientsresponsebody.md b/docs/models/operations/getavailableclientsresponsebody.md deleted file mode 100644 index 4816d76..0000000 --- a/docs/models/operations/getavailableclientsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAvailableClientsResponseBody - -Available Clients - - -## 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/getavailablegrabbersglobals.md b/docs/models/operations/getavailablegrabbersglobals.md new file mode 100644 index 0000000..000ef2c --- /dev/null +++ b/docs/models/operations/getavailablegrabbersglobals.md @@ -0,0 +1,18 @@ +# GetAvailableGrabbersGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getavailablegrabbersmediacontainer.md b/docs/models/operations/getavailablegrabbersmediacontainer.md new file mode 100644 index 0000000..368a3ae --- /dev/null +++ b/docs/models/operations/getavailablegrabbersmediacontainer.md @@ -0,0 +1,17 @@ +# GetAvailableGrabbersMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `MediaGrabber` | [][operations.MediaGrabber](../../models/operations/mediagrabber.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getavailablegrabbersrequest.md b/docs/models/operations/getavailablegrabbersrequest.md new file mode 100644 index 0000000..bd51540 --- /dev/null +++ b/docs/models/operations/getavailablegrabbersrequest.md @@ -0,0 +1,19 @@ +# GetAvailableGrabbersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Protocol` | **string* | :heavy_minus_sign: | Only return grabbers providing this protocol. | livetv | \ No newline at end of file diff --git a/docs/models/operations/getavailablegrabbersresponse.md b/docs/models/operations/getavailablegrabbersresponse.md new file mode 100644 index 0000000..22ddf78 --- /dev/null +++ b/docs/models/operations/getavailablegrabbersresponse.md @@ -0,0 +1,12 @@ +# GetAvailableGrabbersResponse + + +## 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.GetAvailableGrabbersResponseBody](../../models/operations/getavailablegrabbersresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getavailablegrabbersresponsebody.md b/docs/models/operations/getavailablegrabbersresponsebody.md new file mode 100644 index 0000000..6a8dab2 --- /dev/null +++ b/docs/models/operations/getavailablegrabbersresponsebody.md @@ -0,0 +1,10 @@ +# GetAvailableGrabbersResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetAvailableGrabbersMediaContainer](../../models/operations/getavailablegrabbersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getavailablesortsglobals.md b/docs/models/operations/getavailablesortsglobals.md new file mode 100644 index 0000000..03a57a4 --- /dev/null +++ b/docs/models/operations/getavailablesortsglobals.md @@ -0,0 +1,18 @@ +# GetAvailableSortsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getavailablesortsmediacontainer.md b/docs/models/operations/getavailablesortsmediacontainer.md new file mode 100644 index 0000000..6a4cee5 --- /dev/null +++ b/docs/models/operations/getavailablesortsmediacontainer.md @@ -0,0 +1,17 @@ +# GetAvailableSortsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getavailablesortsrequest.md b/docs/models/operations/getavailablesortsrequest.md new file mode 100644 index 0000000..83d0aed --- /dev/null +++ b/docs/models/operations/getavailablesortsrequest.md @@ -0,0 +1,19 @@ +# GetAvailableSortsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getavailablesortsresponse.md b/docs/models/operations/getavailablesortsresponse.md new file mode 100644 index 0000000..47b8605 --- /dev/null +++ b/docs/models/operations/getavailablesortsresponse.md @@ -0,0 +1,11 @@ +# GetAvailableSortsResponse + + +## 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.GetAvailableSortsResponseBody](../../models/operations/getavailablesortsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getavailablesortsresponsebody.md b/docs/models/operations/getavailablesortsresponsebody.md new file mode 100644 index 0000000..b41ea6c --- /dev/null +++ b/docs/models/operations/getavailablesortsresponsebody.md @@ -0,0 +1,10 @@ +# GetAvailableSortsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetAvailableSortsMediaContainer](../../models/operations/getavailablesortsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbackgroundtasksmediacontainer.md b/docs/models/operations/getbackgroundtasksmediacontainer.md new file mode 100644 index 0000000..62504cf --- /dev/null +++ b/docs/models/operations/getbackgroundtasksmediacontainer.md @@ -0,0 +1,17 @@ +# GetBackgroundTasksMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `TranscodeJob` | [][operations.TranscodeJob](../../models/operations/transcodejob.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbackgroundtasksresponse.md b/docs/models/operations/getbackgroundtasksresponse.md new file mode 100644 index 0000000..8036326 --- /dev/null +++ b/docs/models/operations/getbackgroundtasksresponse.md @@ -0,0 +1,11 @@ +# GetBackgroundTasksResponse + + +## 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.GetBackgroundTasksResponseBody](../../models/operations/getbackgroundtasksresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getbackgroundtasksresponsebody.md b/docs/models/operations/getbackgroundtasksresponsebody.md new file mode 100644 index 0000000..5c18eef --- /dev/null +++ b/docs/models/operations/getbackgroundtasksresponsebody.md @@ -0,0 +1,10 @@ +# GetBackgroundTasksResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetBackgroundTasksMediaContainer](../../models/operations/getbackgroundtasksmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbackgroundtaskstype.md b/docs/models/operations/getbackgroundtaskstype.md new file mode 100644 index 0000000..5bcd3c0 --- /dev/null +++ b/docs/models/operations/getbackgroundtaskstype.md @@ -0,0 +1,8 @@ +# GetBackgroundTasksType + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `GetBackgroundTasksTypeTranscode` | transcode | \ No newline at end of file diff --git a/docs/models/operations/getbandwidthstatisticsaccount.md b/docs/models/operations/getbandwidthstatisticsaccount.md deleted file mode 100644 index f827ff6..0000000 --- a/docs/models/operations/getbandwidthstatisticsaccount.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetBandwidthStatisticsAccount - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 238960586 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /accounts/238960586 | -| `Name` | **string* | :heavy_minus_sign: | N/A | Diane | -| `DefaultAudioLanguage` | **string* | :heavy_minus_sign: | N/A | en | -| `AutoSelectAudio` | **bool* | :heavy_minus_sign: | N/A | true | -| `DefaultSubtitleLanguage` | **string* | :heavy_minus_sign: | N/A | en | -| `SubtitleMode` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 | \ No newline at end of file diff --git a/docs/models/operations/getbandwidthstatisticsdevice.md b/docs/models/operations/getbandwidthstatisticsdevice.md deleted file mode 100644 index 1492e22..0000000 --- a/docs/models/operations/getbandwidthstatisticsdevice.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetBandwidthStatisticsDevice - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 208 | -| `Name` | **string* | :heavy_minus_sign: | N/A | Roku Express | -| `Platform` | **string* | :heavy_minus_sign: | N/A | Roku | -| `ClientIdentifier` | **string* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 | -| `CreatedAt` | **int* | :heavy_minus_sign: | N/A | 1706470556 | \ No newline at end of file diff --git a/docs/models/operations/getbandwidthstatisticsmediacontainer.md b/docs/models/operations/getbandwidthstatisticsmediacontainer.md deleted file mode 100644 index 3122b8b..0000000 --- a/docs/models/operations/getbandwidthstatisticsmediacontainer.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBandwidthStatisticsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `Size` | **int* | :heavy_minus_sign: | N/A | 5497 | -| `Device` | [][operations.GetBandwidthStatisticsDevice](../../models/operations/getbandwidthstatisticsdevice.md) | :heavy_minus_sign: | N/A | | -| `Account` | [][operations.GetBandwidthStatisticsAccount](../../models/operations/getbandwidthstatisticsaccount.md) | :heavy_minus_sign: | N/A | | -| `StatisticsBandwidth` | [][operations.StatisticsBandwidth](../../models/operations/statisticsbandwidth.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getbandwidthstatisticsrequest.md b/docs/models/operations/getbandwidthstatisticsrequest.md deleted file mode 100644 index 10fc29e..0000000 --- a/docs/models/operations/getbandwidthstatisticsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetBandwidthStatisticsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/getbandwidthstatisticsresponse.md b/docs/models/operations/getbandwidthstatisticsresponse.md deleted file mode 100644 index 4da7b74..0000000 --- a/docs/models/operations/getbandwidthstatisticsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBandwidthStatisticsResponse - - -## 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.GetBandwidthStatisticsResponseBody](../../models/operations/getbandwidthstatisticsresponsebody.md) | :heavy_minus_sign: | Bandwidth Statistics | \ No newline at end of file diff --git a/docs/models/operations/getbandwidthstatisticsresponsebody.md b/docs/models/operations/getbandwidthstatisticsresponsebody.md deleted file mode 100644 index ba31283..0000000 --- a/docs/models/operations/getbandwidthstatisticsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetBandwidthStatisticsResponseBody - -Bandwidth Statistics - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetBandwidthStatisticsMediaContainer](../../models/operations/getbandwidthstatisticsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbannerimagerequest.md b/docs/models/operations/getbannerimagerequest.md deleted file mode 100644 index 9986cc2..0000000 --- a/docs/models/operations/getbannerimagerequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetBannerImageRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the children of. | 9518 | -| `Width` | *int64* | :heavy_check_mark: | N/A | 396 | -| `Height` | *int64* | :heavy_check_mark: | N/A | 396 | -| `MinSize` | *int64* | :heavy_check_mark: | N/A | 1 | -| `Upscale` | *int64* | :heavy_check_mark: | N/A | 1 | -| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/getbannerimageresponse.md b/docs/models/operations/getbannerimageresponse.md deleted file mode 100644 index 4b3ccc6..0000000 --- a/docs/models/operations/getbannerimageresponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetBannerImageResponse - - -## 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 | -| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | Successful response returning an image | -| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbutlertasksresponse.md b/docs/models/operations/getbutlertasksresponse.md deleted file mode 100644 index 67ecfa6..0000000 --- a/docs/models/operations/getbutlertasksresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 71b5e2c..0000000 --- a/docs/models/operations/getbutlertasksresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/getcategoriesglobals.md b/docs/models/operations/getcategoriesglobals.md new file mode 100644 index 0000000..114282a --- /dev/null +++ b/docs/models/operations/getcategoriesglobals.md @@ -0,0 +1,18 @@ +# GetCategoriesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcategoriesrequest.md b/docs/models/operations/getcategoriesrequest.md new file mode 100644 index 0000000..b437d85 --- /dev/null +++ b/docs/models/operations/getcategoriesrequest.md @@ -0,0 +1,19 @@ +# GetCategoriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getcategoriesresponse.md b/docs/models/operations/getcategoriesresponse.md new file mode 100644 index 0000000..1f58bc0 --- /dev/null +++ b/docs/models/operations/getcategoriesresponse.md @@ -0,0 +1,11 @@ +# GetCategoriesResponse + + +## 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 | +| `MediaContainerWithArtwork` | [*components.MediaContainerWithArtwork](../../models/components/mediacontainerwithartwork.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getchannelsglobals.md b/docs/models/operations/getchannelsglobals.md new file mode 100644 index 0000000..8246f2a --- /dev/null +++ b/docs/models/operations/getchannelsglobals.md @@ -0,0 +1,18 @@ +# GetChannelsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getchannelsmediacontainer.md b/docs/models/operations/getchannelsmediacontainer.md new file mode 100644 index 0000000..78fd3fc --- /dev/null +++ b/docs/models/operations/getchannelsmediacontainer.md @@ -0,0 +1,17 @@ +# GetChannelsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Channel` | [][components.Channel](../../models/components/channel.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getchannelsrequest.md b/docs/models/operations/getchannelsrequest.md new file mode 100644 index 0000000..8d03dc4 --- /dev/null +++ b/docs/models/operations/getchannelsrequest.md @@ -0,0 +1,19 @@ +# GetChannelsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Lineup` | *string* | :heavy_check_mark: | The URI describing the lineup | | \ No newline at end of file diff --git a/docs/models/operations/getchannelsresponse.md b/docs/models/operations/getchannelsresponse.md new file mode 100644 index 0000000..f21c8f7 --- /dev/null +++ b/docs/models/operations/getchannelsresponse.md @@ -0,0 +1,12 @@ +# GetChannelsResponse + + +## 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.GetChannelsResponseBody](../../models/operations/getchannelsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getchannelsresponsebody.md b/docs/models/operations/getchannelsresponsebody.md new file mode 100644 index 0000000..e96af4f --- /dev/null +++ b/docs/models/operations/getchannelsresponsebody.md @@ -0,0 +1,10 @@ +# GetChannelsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetChannelsMediaContainer](../../models/operations/getchannelsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getchapterimageglobals.md b/docs/models/operations/getchapterimageglobals.md new file mode 100644 index 0000000..04bf4c7 --- /dev/null +++ b/docs/models/operations/getchapterimageglobals.md @@ -0,0 +1,18 @@ +# GetChapterImageGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getchapterimagerequest.md b/docs/models/operations/getchapterimagerequest.md new file mode 100644 index 0000000..9fdf610 --- /dev/null +++ b/docs/models/operations/getchapterimagerequest.md @@ -0,0 +1,20 @@ +# GetChapterImageRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `MediaID` | *int64* | :heavy_check_mark: | The id of the media item | | +| `Chapter` | *int64* | :heavy_check_mark: | The index of the chapter | | \ No newline at end of file diff --git a/docs/models/operations/getchapterimageresponse.md b/docs/models/operations/getchapterimageresponse.md new file mode 100644 index 0000000..285f219 --- /dev/null +++ b/docs/models/operations/getchapterimageresponse.md @@ -0,0 +1,11 @@ +# GetChapterImageResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getclusterglobals.md b/docs/models/operations/getclusterglobals.md new file mode 100644 index 0000000..834606b --- /dev/null +++ b/docs/models/operations/getclusterglobals.md @@ -0,0 +1,18 @@ +# GetClusterGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getclusterrequest.md b/docs/models/operations/getclusterrequest.md new file mode 100644 index 0000000..1792c79 --- /dev/null +++ b/docs/models/operations/getclusterrequest.md @@ -0,0 +1,19 @@ +# GetClusterRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getclusterresponse.md b/docs/models/operations/getclusterresponse.md new file mode 100644 index 0000000..48b8911 --- /dev/null +++ b/docs/models/operations/getclusterresponse.md @@ -0,0 +1,11 @@ +# GetClusterResponse + + +## 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 | +| `MediaContainerWithArtwork` | [*components.MediaContainerWithArtwork](../../models/components/mediacontainerwithartwork.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getcollectionimageglobals.md b/docs/models/operations/getcollectionimageglobals.md new file mode 100644 index 0000000..322c038 --- /dev/null +++ b/docs/models/operations/getcollectionimageglobals.md @@ -0,0 +1,18 @@ +# GetCollectionImageGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcollectionimagerequest.md b/docs/models/operations/getcollectionimagerequest.md new file mode 100644 index 0000000..722f5e3 --- /dev/null +++ b/docs/models/operations/getcollectionimagerequest.md @@ -0,0 +1,21 @@ +# GetCollectionImageRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `CollectionID` | *int64* | :heavy_check_mark: | The collection id | | +| `UpdatedAt` | *int64* | :heavy_check_mark: | The update time of the image. Used for busting cache. | | +| `Composite` | [*components.Composite](../../models/components/composite.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getcollectionimageresponse.md b/docs/models/operations/getcollectionimageresponse.md new file mode 100644 index 0000000..4d052b7 --- /dev/null +++ b/docs/models/operations/getcollectionimageresponse.md @@ -0,0 +1,11 @@ +# GetCollectionImageResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getcollectionitemsglobals.md b/docs/models/operations/getcollectionitemsglobals.md new file mode 100644 index 0000000..0d44621 --- /dev/null +++ b/docs/models/operations/getcollectionitemsglobals.md @@ -0,0 +1,18 @@ +# GetCollectionItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcollectionitemsrequest.md b/docs/models/operations/getcollectionitemsrequest.md new file mode 100644 index 0000000..8239eb0 --- /dev/null +++ b/docs/models/operations/getcollectionitemsrequest.md @@ -0,0 +1,19 @@ +# GetCollectionItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `CollectionID` | *int64* | :heavy_check_mark: | The collection id | | \ No newline at end of file diff --git a/docs/models/operations/getcollectionitemsresponse.md b/docs/models/operations/getcollectionitemsresponse.md new file mode 100644 index 0000000..27624a6 --- /dev/null +++ b/docs/models/operations/getcollectionitemsresponse.md @@ -0,0 +1,11 @@ +# GetCollectionItemsResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getcollectionsglobals.md b/docs/models/operations/getcollectionsglobals.md new file mode 100644 index 0000000..b7a059f --- /dev/null +++ b/docs/models/operations/getcollectionsglobals.md @@ -0,0 +1,18 @@ +# GetCollectionsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcollectionsrequest.md b/docs/models/operations/getcollectionsrequest.md new file mode 100644 index 0000000..9d1a8fd --- /dev/null +++ b/docs/models/operations/getcollectionsrequest.md @@ -0,0 +1,20 @@ +# GetCollectionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | \ No newline at end of file diff --git a/docs/models/operations/getcollectionsresponse.md b/docs/models/operations/getcollectionsresponse.md new file mode 100644 index 0000000..feceb5c --- /dev/null +++ b/docs/models/operations/getcollectionsresponse.md @@ -0,0 +1,12 @@ +# GetCollectionsResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcolorsglobals.md b/docs/models/operations/getcolorsglobals.md new file mode 100644 index 0000000..ecc96ff --- /dev/null +++ b/docs/models/operations/getcolorsglobals.md @@ -0,0 +1,18 @@ +# GetColorsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcolorsmediacontainer.md b/docs/models/operations/getcolorsmediacontainer.md new file mode 100644 index 0000000..966435a --- /dev/null +++ b/docs/models/operations/getcolorsmediacontainer.md @@ -0,0 +1,17 @@ +# GetColorsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `UltraBlurColors` | [][operations.UltraBlurColors](../../models/operations/ultrablurcolors.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcolorsrequest.md b/docs/models/operations/getcolorsrequest.md new file mode 100644 index 0000000..4a1d8ff --- /dev/null +++ b/docs/models/operations/getcolorsrequest.md @@ -0,0 +1,19 @@ +# GetColorsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URL` | **string* | :heavy_minus_sign: | Url for image which requires color extraction. Can be relative PMS library path or absolute url. | /library/metadata/217745/art/1718931408 | \ No newline at end of file diff --git a/docs/models/operations/getcolorsresponse.md b/docs/models/operations/getcolorsresponse.md new file mode 100644 index 0000000..4ccd867 --- /dev/null +++ b/docs/models/operations/getcolorsresponse.md @@ -0,0 +1,11 @@ +# GetColorsResponse + + +## 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.GetColorsResponseBody](../../models/operations/getcolorsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getcolorsresponsebody.md b/docs/models/operations/getcolorsresponsebody.md new file mode 100644 index 0000000..eab61ab --- /dev/null +++ b/docs/models/operations/getcolorsresponsebody.md @@ -0,0 +1,10 @@ +# GetColorsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetColorsMediaContainer](../../models/operations/getcolorsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcommonglobals.md b/docs/models/operations/getcommonglobals.md new file mode 100644 index 0000000..7237450 --- /dev/null +++ b/docs/models/operations/getcommonglobals.md @@ -0,0 +1,18 @@ +# GetCommonGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcommonrequest.md b/docs/models/operations/getcommonrequest.md new file mode 100644 index 0000000..ee76bfe --- /dev/null +++ b/docs/models/operations/getcommonrequest.md @@ -0,0 +1,21 @@ +# GetCommonRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Type` | **int64* | :heavy_minus_sign: | Item type | | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | \ No newline at end of file diff --git a/docs/models/operations/getcommonresponse.md b/docs/models/operations/getcommonresponse.md new file mode 100644 index 0000000..2003efc --- /dev/null +++ b/docs/models/operations/getcommonresponse.md @@ -0,0 +1,12 @@ +# GetCommonResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcompanionsdataresponse.md b/docs/models/operations/getcompanionsdataresponse.md deleted file mode 100644 index a9d6c3c..0000000 --- a/docs/models/operations/getcompanionsdataresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCompanionsDataResponse - - -## 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: | Companions Data | \ No newline at end of file diff --git a/docs/models/operations/getcontinuewatchingglobals.md b/docs/models/operations/getcontinuewatchingglobals.md new file mode 100644 index 0000000..b01d789 --- /dev/null +++ b/docs/models/operations/getcontinuewatchingglobals.md @@ -0,0 +1,18 @@ +# GetContinueWatchingGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcontinuewatchingmediacontainer.md b/docs/models/operations/getcontinuewatchingmediacontainer.md new file mode 100644 index 0000000..7b4290c --- /dev/null +++ b/docs/models/operations/getcontinuewatchingmediacontainer.md @@ -0,0 +1,17 @@ +# GetContinueWatchingMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcontinuewatchingrequest.md b/docs/models/operations/getcontinuewatchingrequest.md new file mode 100644 index 0000000..8b8d2e3 --- /dev/null +++ b/docs/models/operations/getcontinuewatchingrequest.md @@ -0,0 +1,19 @@ +# GetContinueWatchingRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | \ No newline at end of file diff --git a/docs/models/operations/getcontinuewatchingresponse.md b/docs/models/operations/getcontinuewatchingresponse.md new file mode 100644 index 0000000..a5b136d --- /dev/null +++ b/docs/models/operations/getcontinuewatchingresponse.md @@ -0,0 +1,12 @@ +# GetContinueWatchingResponse + + +## 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.GetContinueWatchingResponseBody](../../models/operations/getcontinuewatchingresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcontinuewatchingresponsebody.md b/docs/models/operations/getcontinuewatchingresponsebody.md new file mode 100644 index 0000000..2497c8e --- /dev/null +++ b/docs/models/operations/getcontinuewatchingresponsebody.md @@ -0,0 +1,10 @@ +# GetContinueWatchingResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetContinueWatchingMediaContainer](../../models/operations/getcontinuewatchingmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibrarydirectory.md b/docs/models/operations/getcountrieslibrarydirectory.md deleted file mode 100644 index eb1ad5b..0000000 --- a/docs/models/operations/getcountrieslibrarydirectory.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCountriesLibraryDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | -| `FastKey` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?country=15491 | -| `Key` | *string* | :heavy_check_mark: | N/A | 15491 | -| `Title` | *string* | :heavy_check_mark: | N/A | Japan | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibrarymediacontainer.md b/docs/models/operations/getcountrieslibrarymediacontainer.md deleted file mode 100644 index 516f86f..0000000 --- a/docs/models/operations/getcountrieslibrarymediacontainer.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetCountriesLibraryMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series | -| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor | -| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary | -| `Directory` | [][operations.GetCountriesLibraryDirectory](../../models/operations/getcountrieslibrarydirectory.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryqueryparamtype.md b/docs/models/operations/getcountrieslibraryqueryparamtype.md deleted file mode 100644 index 44ea08a..0000000 --- a/docs/models/operations/getcountrieslibraryqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetCountriesLibraryQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| --------------------------------------------- | --------------------------------------------- | -| `GetCountriesLibraryQueryParamTypeMovie` | 1 | -| `GetCountriesLibraryQueryParamTypeTvShow` | 2 | -| `GetCountriesLibraryQueryParamTypeSeason` | 3 | -| `GetCountriesLibraryQueryParamTypeEpisode` | 4 | -| `GetCountriesLibraryQueryParamTypeArtist` | 5 | -| `GetCountriesLibraryQueryParamTypeAlbum` | 6 | -| `GetCountriesLibraryQueryParamTypeTrack` | 7 | -| `GetCountriesLibraryQueryParamTypePhotoAlbum` | 8 | -| `GetCountriesLibraryQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryrequest.md b/docs/models/operations/getcountrieslibraryrequest.md deleted file mode 100644 index 439b182..0000000 --- a/docs/models/operations/getcountrieslibraryrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetCountriesLibraryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `Type` | [operations.GetCountriesLibraryQueryParamType](../../models/operations/getcountrieslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryresponse.md b/docs/models/operations/getcountrieslibraryresponse.md deleted file mode 100644 index 7a08396..0000000 --- a/docs/models/operations/getcountrieslibraryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCountriesLibraryResponse - - -## 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.GetCountriesLibraryResponseBody](../../models/operations/getcountrieslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryresponsebody.md b/docs/models/operations/getcountrieslibraryresponsebody.md deleted file mode 100644 index d567961..0000000 --- a/docs/models/operations/getcountrieslibraryresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCountriesLibraryResponseBody - -Successful response containing media container data. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetCountriesLibraryMediaContainer](../../models/operations/getcountrieslibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslineupsglobals.md b/docs/models/operations/getcountrieslineupsglobals.md new file mode 100644 index 0000000..2453109 --- /dev/null +++ b/docs/models/operations/getcountrieslineupsglobals.md @@ -0,0 +1,18 @@ +# GetCountriesLineupsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslineupsrequest.md b/docs/models/operations/getcountrieslineupsrequest.md new file mode 100644 index 0000000..af2ec2c --- /dev/null +++ b/docs/models/operations/getcountrieslineupsrequest.md @@ -0,0 +1,21 @@ +# GetCountriesLineupsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Country` | *string* | :heavy_check_mark: | 3 letter country code | | +| `EpgID` | *string* | :heavy_check_mark: | The `providerIdentifier` of the provider | | +| `PostalCode` | **string* | :heavy_minus_sign: | The postal code for the lineups to fetch | | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslineupsresponse.md b/docs/models/operations/getcountrieslineupsresponse.md new file mode 100644 index 0000000..16aa900 --- /dev/null +++ b/docs/models/operations/getcountrieslineupsresponse.md @@ -0,0 +1,11 @@ +# GetCountriesLineupsResponse + + +## 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 | +| `MediaContainerWithLineup` | [*components.MediaContainerWithLineup](../../models/components/mediacontainerwithlineup.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getcountriesmediacontainer.md b/docs/models/operations/getcountriesmediacontainer.md new file mode 100644 index 0000000..2a9ff8d --- /dev/null +++ b/docs/models/operations/getcountriesmediacontainer.md @@ -0,0 +1,17 @@ +# GetCountriesMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Country` | [][operations.Country](../../models/operations/country.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountriesresponse.md b/docs/models/operations/getcountriesresponse.md new file mode 100644 index 0000000..c592387 --- /dev/null +++ b/docs/models/operations/getcountriesresponse.md @@ -0,0 +1,12 @@ +# GetCountriesResponse + + +## 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.GetCountriesResponseBody](../../models/operations/getcountriesresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountriesresponsebody.md b/docs/models/operations/getcountriesresponsebody.md new file mode 100644 index 0000000..7f82167 --- /dev/null +++ b/docs/models/operations/getcountriesresponsebody.md @@ -0,0 +1,10 @@ +# GetCountriesResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetCountriesMediaContainer](../../models/operations/getcountriesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountryregionscountry.md b/docs/models/operations/getcountryregionscountry.md new file mode 100644 index 0000000..a187d61 --- /dev/null +++ b/docs/models/operations/getcountryregionscountry.md @@ -0,0 +1,11 @@ +# GetCountryRegionsCountry + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `National` | **bool* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountryregionsglobals.md b/docs/models/operations/getcountryregionsglobals.md new file mode 100644 index 0000000..5c672ce --- /dev/null +++ b/docs/models/operations/getcountryregionsglobals.md @@ -0,0 +1,18 @@ +# GetCountryRegionsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getcountryregionsmediacontainer.md b/docs/models/operations/getcountryregionsmediacontainer.md new file mode 100644 index 0000000..20ef616 --- /dev/null +++ b/docs/models/operations/getcountryregionsmediacontainer.md @@ -0,0 +1,17 @@ +# GetCountryRegionsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Country` | [][operations.GetCountryRegionsCountry](../../models/operations/getcountryregionscountry.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountryregionsrequest.md b/docs/models/operations/getcountryregionsrequest.md new file mode 100644 index 0000000..ee7a8a4 --- /dev/null +++ b/docs/models/operations/getcountryregionsrequest.md @@ -0,0 +1,20 @@ +# GetCountryRegionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Country` | *string* | :heavy_check_mark: | 3 letter country code | | +| `EpgID` | *string* | :heavy_check_mark: | The `providerIdentifier` of the provider | | \ No newline at end of file diff --git a/docs/models/operations/getcountryregionsresponse.md b/docs/models/operations/getcountryregionsresponse.md new file mode 100644 index 0000000..e577f88 --- /dev/null +++ b/docs/models/operations/getcountryregionsresponse.md @@ -0,0 +1,12 @@ +# GetCountryRegionsResponse + + +## 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.GetCountryRegionsResponseBody](../../models/operations/getcountryregionsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcountryregionsresponsebody.md b/docs/models/operations/getcountryregionsresponsebody.md new file mode 100644 index 0000000..3ae117e --- /dev/null +++ b/docs/models/operations/getcountryregionsresponsebody.md @@ -0,0 +1,10 @@ +# GetCountryRegionsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetCountryRegionsMediaContainer](../../models/operations/getcountryregionsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdevicedetailsglobals.md b/docs/models/operations/getdevicedetailsglobals.md new file mode 100644 index 0000000..e0a8e82 --- /dev/null +++ b/docs/models/operations/getdevicedetailsglobals.md @@ -0,0 +1,18 @@ +# GetDeviceDetailsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getdevicedetailsrequest.md b/docs/models/operations/getdevicedetailsrequest.md new file mode 100644 index 0000000..cfb98bc --- /dev/null +++ b/docs/models/operations/getdevicedetailsrequest.md @@ -0,0 +1,19 @@ +# GetDeviceDetailsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | \ No newline at end of file diff --git a/docs/models/operations/getdevicedetailsresponse.md b/docs/models/operations/getdevicedetailsresponse.md new file mode 100644 index 0000000..0343e44 --- /dev/null +++ b/docs/models/operations/getdevicedetailsresponse.md @@ -0,0 +1,11 @@ +# GetDeviceDetailsResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getdeviceschannelsglobals.md b/docs/models/operations/getdeviceschannelsglobals.md new file mode 100644 index 0000000..2f2b82d --- /dev/null +++ b/docs/models/operations/getdeviceschannelsglobals.md @@ -0,0 +1,18 @@ +# GetDevicesChannelsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getdeviceschannelsmediacontainer.md b/docs/models/operations/getdeviceschannelsmediacontainer.md new file mode 100644 index 0000000..75f2279 --- /dev/null +++ b/docs/models/operations/getdeviceschannelsmediacontainer.md @@ -0,0 +1,17 @@ +# GetDevicesChannelsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `DeviceChannel` | [][operations.DeviceChannel](../../models/operations/devicechannel.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdeviceschannelsrequest.md b/docs/models/operations/getdeviceschannelsrequest.md new file mode 100644 index 0000000..68f156e --- /dev/null +++ b/docs/models/operations/getdeviceschannelsrequest.md @@ -0,0 +1,19 @@ +# GetDevicesChannelsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | \ No newline at end of file diff --git a/docs/models/operations/getdeviceschannelsresponse.md b/docs/models/operations/getdeviceschannelsresponse.md new file mode 100644 index 0000000..cf8f4ab --- /dev/null +++ b/docs/models/operations/getdeviceschannelsresponse.md @@ -0,0 +1,12 @@ +# GetDevicesChannelsResponse + + +## 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.GetDevicesChannelsResponseBody](../../models/operations/getdeviceschannelsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdeviceschannelsresponsebody.md b/docs/models/operations/getdeviceschannelsresponsebody.md new file mode 100644 index 0000000..4c1a62d --- /dev/null +++ b/docs/models/operations/getdeviceschannelsresponsebody.md @@ -0,0 +1,10 @@ +# GetDevicesChannelsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetDevicesChannelsMediaContainer](../../models/operations/getdeviceschannelsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdevicesmediacontainer.md b/docs/models/operations/getdevicesmediacontainer.md deleted file mode 100644 index 6b35d1a..0000000 --- a/docs/models/operations/getdevicesmediacontainer.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 334fa77..0000000 --- a/docs/models/operations/getdevicesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index ababa00..0000000 --- a/docs/models/operations/getdevicesresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/getdownloadqueuedownloadqueue.md b/docs/models/operations/getdownloadqueuedownloadqueue.md new file mode 100644 index 0000000..3112c64 --- /dev/null +++ b/docs/models/operations/getdownloadqueuedownloadqueue.md @@ -0,0 +1,10 @@ +# GetDownloadQueueDownloadQueue + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `ItemCount` | **int64* | :heavy_minus_sign: | N/A | +| `Status` | [*operations.GetDownloadQueueStatus](../../models/operations/getdownloadqueuestatus.md) | :heavy_minus_sign: | The state of this queue
- deciding: At least one item is still being decided
- waiting: At least one item is waiting for transcode and none are currently transcoding
- processing: At least one item is being transcoded
- done: All items are available (or potentially expired)
- error: At least one item has encountered an error
| \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueglobals.md b/docs/models/operations/getdownloadqueueglobals.md new file mode 100644 index 0000000..5860d51 --- /dev/null +++ b/docs/models/operations/getdownloadqueueglobals.md @@ -0,0 +1,18 @@ +# GetDownloadQueueGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsdecisionresult.md b/docs/models/operations/getdownloadqueueitemsdecisionresult.md new file mode 100644 index 0000000..520dfcd --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsdecisionresult.md @@ -0,0 +1,16 @@ +# GetDownloadQueueItemsDecisionResult + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `AvailableBandwidth` | **int64* | :heavy_minus_sign: | The maximum bitrate set when item was added | +| `DirectPlayDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `DirectPlayDecisionText` | **string* | :heavy_minus_sign: | N/A | +| `GeneralDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `GeneralDecisionText` | **string* | :heavy_minus_sign: | N/A | +| `MdeDecisionCode` | **int64* | :heavy_minus_sign: | The code indicating the status of evaluation of playback when client indicates `hasMDE=1` | +| `MdeDecisionText` | **string* | :heavy_minus_sign: | Descriptive text for the above code | +| `TranscodeDecisionCode` | **int64* | :heavy_minus_sign: | N/A | +| `TranscodeDecisionText` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsdownloadqueueitem.md b/docs/models/operations/getdownloadqueueitemsdownloadqueueitem.md new file mode 100644 index 0000000..23975bc --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsdownloadqueueitem.md @@ -0,0 +1,15 @@ +# GetDownloadQueueItemsDownloadQueueItem + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DecisionResult` | [*operations.GetDownloadQueueItemsDecisionResult](../../models/operations/getdownloadqueueitemsdecisionresult.md) | :heavy_minus_sign: | N/A | +| `Error` | **string* | :heavy_minus_sign: | The error encountered in transcoding or decision | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `QueueID` | **int64* | :heavy_minus_sign: | N/A | +| `Status` | [*operations.GetDownloadQueueItemsStatus](../../models/operations/getdownloadqueueitemsstatus.md) | :heavy_minus_sign: | The state of the item:
- deciding: The item decision is pending
- waiting: The item is waiting for transcode
- processing: The item is being transcoded
- available: The item is available for download
- error: The item encountered an error in the decision or transcode
- expired: The transcoded item has timed out and is no longer available
| +| `Transcode` | [*operations.GetDownloadQueueItemsTranscode](../../models/operations/getdownloadqueueitemstranscode.md) | :heavy_minus_sign: | The transcode session object which is not yet documented otherwise it'd be a $ref here. | +| `TranscodeSession` | [*components.TranscodeSession](../../models/components/transcodesession.md) | :heavy_minus_sign: | The transcode session if item is currently being transcoded | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsglobals.md b/docs/models/operations/getdownloadqueueitemsglobals.md new file mode 100644 index 0000000..4a8294c --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsglobals.md @@ -0,0 +1,18 @@ +# GetDownloadQueueItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsmediacontainer.md b/docs/models/operations/getdownloadqueueitemsmediacontainer.md new file mode 100644 index 0000000..383a9db --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsmediacontainer.md @@ -0,0 +1,17 @@ +# GetDownloadQueueItemsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `DownloadQueueItem` | [][operations.GetDownloadQueueItemsDownloadQueueItem](../../models/operations/getdownloadqueueitemsdownloadqueueitem.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsrequest.md b/docs/models/operations/getdownloadqueueitemsrequest.md new file mode 100644 index 0000000..e526cd0 --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsrequest.md @@ -0,0 +1,20 @@ +# GetDownloadQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | +| `ItemID` | []*int64* | :heavy_check_mark: | The item ids | [
32,
345,
23
] | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsresponse.md b/docs/models/operations/getdownloadqueueitemsresponse.md new file mode 100644 index 0000000..2b401ab --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsresponse.md @@ -0,0 +1,11 @@ +# GetDownloadQueueItemsResponse + + +## 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.GetDownloadQueueItemsResponseBody](../../models/operations/getdownloadqueueitemsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsresponsebody.md b/docs/models/operations/getdownloadqueueitemsresponsebody.md new file mode 100644 index 0000000..ee12c6c --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsresponsebody.md @@ -0,0 +1,10 @@ +# GetDownloadQueueItemsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetDownloadQueueItemsMediaContainer](../../models/operations/getdownloadqueueitemsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemsstatus.md b/docs/models/operations/getdownloadqueueitemsstatus.md new file mode 100644 index 0000000..2883a76 --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemsstatus.md @@ -0,0 +1,22 @@ +# GetDownloadQueueItemsStatus + +The state of the item: + - deciding: The item decision is pending + - waiting: The item is waiting for transcode + - processing: The item is being transcoded + - available: The item is available for download + - error: The item encountered an error in the decision or transcode + - expired: The transcoded item has timed out and is no longer available + + + +## Values + +| Name | Value | +| --------------------------------------- | --------------------------------------- | +| `GetDownloadQueueItemsStatusDeciding` | deciding | +| `GetDownloadQueueItemsStatusWaiting` | waiting | +| `GetDownloadQueueItemsStatusProcessing` | processing | +| `GetDownloadQueueItemsStatusAvailable` | available | +| `GetDownloadQueueItemsStatusError` | error | +| `GetDownloadQueueItemsStatusExpired` | expired | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueitemstranscode.md b/docs/models/operations/getdownloadqueueitemstranscode.md new file mode 100644 index 0000000..cf4954a --- /dev/null +++ b/docs/models/operations/getdownloadqueueitemstranscode.md @@ -0,0 +1,9 @@ +# GetDownloadQueueItemsTranscode + +The transcode session object which is not yet documented otherwise it'd be a $ref here. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueuemediacontainer.md b/docs/models/operations/getdownloadqueuemediacontainer.md new file mode 100644 index 0000000..4b48015 --- /dev/null +++ b/docs/models/operations/getdownloadqueuemediacontainer.md @@ -0,0 +1,17 @@ +# GetDownloadQueueMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `DownloadQueue` | [][operations.GetDownloadQueueDownloadQueue](../../models/operations/getdownloadqueuedownloadqueue.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueuemediaglobals.md b/docs/models/operations/getdownloadqueuemediaglobals.md new file mode 100644 index 0000000..efd9ecd --- /dev/null +++ b/docs/models/operations/getdownloadqueuemediaglobals.md @@ -0,0 +1,18 @@ +# GetDownloadQueueMediaGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueuemediarequest.md b/docs/models/operations/getdownloadqueuemediarequest.md new file mode 100644 index 0000000..f504d7b --- /dev/null +++ b/docs/models/operations/getdownloadqueuemediarequest.md @@ -0,0 +1,20 @@ +# GetDownloadQueueMediaRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | +| `ItemID` | *int64* | :heavy_check_mark: | The item ids | 32 | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueuemediaresponse.md b/docs/models/operations/getdownloadqueuemediaresponse.md new file mode 100644 index 0000000..83c9bb1 --- /dev/null +++ b/docs/models/operations/getdownloadqueuemediaresponse.md @@ -0,0 +1,11 @@ +# GetDownloadQueueMediaResponse + + +## 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 | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueuerequest.md b/docs/models/operations/getdownloadqueuerequest.md new file mode 100644 index 0000000..edffa4b --- /dev/null +++ b/docs/models/operations/getdownloadqueuerequest.md @@ -0,0 +1,19 @@ +# GetDownloadQueueRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueresponse.md b/docs/models/operations/getdownloadqueueresponse.md new file mode 100644 index 0000000..de047ff --- /dev/null +++ b/docs/models/operations/getdownloadqueueresponse.md @@ -0,0 +1,11 @@ +# GetDownloadQueueResponse + + +## 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.GetDownloadQueueResponseBody](../../models/operations/getdownloadqueueresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueueresponsebody.md b/docs/models/operations/getdownloadqueueresponsebody.md new file mode 100644 index 0000000..d49023d --- /dev/null +++ b/docs/models/operations/getdownloadqueueresponsebody.md @@ -0,0 +1,10 @@ +# GetDownloadQueueResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetDownloadQueueMediaContainer](../../models/operations/getdownloadqueuemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdownloadqueuestatus.md b/docs/models/operations/getdownloadqueuestatus.md new file mode 100644 index 0000000..44732ff --- /dev/null +++ b/docs/models/operations/getdownloadqueuestatus.md @@ -0,0 +1,20 @@ +# GetDownloadQueueStatus + +The state of this queue + - deciding: At least one item is still being decided + - waiting: At least one item is waiting for transcode and none are currently transcoding + - processing: At least one item is being transcoded + - done: All items are available (or potentially expired) + - error: At least one item has encountered an error + + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `GetDownloadQueueStatusDeciding` | deciding | +| `GetDownloadQueueStatusWaiting` | waiting | +| `GetDownloadQueueStatusProcessing` | processing | +| `GetDownloadQueueStatusDone` | done | +| `GetDownloadQueueStatusError` | error | \ No newline at end of file diff --git a/docs/models/operations/getdvrdvr.md b/docs/models/operations/getdvrdvr.md new file mode 100644 index 0000000..c92e56a --- /dev/null +++ b/docs/models/operations/getdvrdvr.md @@ -0,0 +1,12 @@ +# GetDVRDVR + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdvrdvrsmediacontainer.md b/docs/models/operations/getdvrdvrsmediacontainer.md new file mode 100644 index 0000000..0eca8d3 --- /dev/null +++ b/docs/models/operations/getdvrdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# GetDVRDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/getdvrglobals.md b/docs/models/operations/getdvrglobals.md new file mode 100644 index 0000000..e4c120a --- /dev/null +++ b/docs/models/operations/getdvrglobals.md @@ -0,0 +1,18 @@ +# GetDVRGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getdvrmediacontainer.md b/docs/models/operations/getdvrmediacontainer.md new file mode 100644 index 0000000..60db4a8 --- /dev/null +++ b/docs/models/operations/getdvrmediacontainer.md @@ -0,0 +1,9 @@ +# GetDVRMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetDVRDVRsMediaContainer](../../models/operations/getdvrdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.GetDVRDVR](../../models/operations/getdvrdvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdvrrequest.md b/docs/models/operations/getdvrrequest.md new file mode 100644 index 0000000..751a805 --- /dev/null +++ b/docs/models/operations/getdvrrequest.md @@ -0,0 +1,19 @@ +# GetDVRRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | \ No newline at end of file diff --git a/docs/models/operations/getdvrresponse.md b/docs/models/operations/getdvrresponse.md new file mode 100644 index 0000000..64f80b5 --- /dev/null +++ b/docs/models/operations/getdvrresponse.md @@ -0,0 +1,12 @@ +# GetDVRResponse + + +## 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.GetDVRResponseBody](../../models/operations/getdvrresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdvrresponsebody.md b/docs/models/operations/getdvrresponsebody.md new file mode 100644 index 0000000..f5bcf0a --- /dev/null +++ b/docs/models/operations/getdvrresponsebody.md @@ -0,0 +1,10 @@ +# GetDVRResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetDVRMediaContainer](../../models/operations/getdvrmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getextrasglobals.md b/docs/models/operations/getextrasglobals.md new file mode 100644 index 0000000..f1bcf52 --- /dev/null +++ b/docs/models/operations/getextrasglobals.md @@ -0,0 +1,18 @@ +# GetExtrasGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getextrasrequest.md b/docs/models/operations/getextrasrequest.md new file mode 100644 index 0000000..553db34 --- /dev/null +++ b/docs/models/operations/getextrasrequest.md @@ -0,0 +1,19 @@ +# GetExtrasRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getextrasresponse.md b/docs/models/operations/getextrasresponse.md new file mode 100644 index 0000000..0af4cea --- /dev/null +++ b/docs/models/operations/getextrasresponse.md @@ -0,0 +1,12 @@ +# GetExtrasResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getfileglobals.md b/docs/models/operations/getfileglobals.md new file mode 100644 index 0000000..890acc5 --- /dev/null +++ b/docs/models/operations/getfileglobals.md @@ -0,0 +1,18 @@ +# GetFileGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getfilehashrequest.md b/docs/models/operations/getfilehashrequest.md deleted file mode 100644 index afa48f9..0000000 --- a/docs/models/operations/getfilehashrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index 14fc3f1..0000000 --- a/docs/models/operations/getfilehashresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/getfilerequest.md b/docs/models/operations/getfilerequest.md new file mode 100644 index 0000000..7733024 --- /dev/null +++ b/docs/models/operations/getfilerequest.md @@ -0,0 +1,20 @@ +# GetFileRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `URL` | **string* | :heavy_minus_sign: | The bundle url, typically starting with `metadata://` or `media://` | | \ No newline at end of file diff --git a/docs/models/operations/getfileresponse.md b/docs/models/operations/getfileresponse.md new file mode 100644 index 0000000..a4b0dd0 --- /dev/null +++ b/docs/models/operations/getfileresponse.md @@ -0,0 +1,12 @@ +# GetFileResponse + + +## 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 | +| `TwoHundredAudioMpeg3ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | +| `TwoHundredImageJpegResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getfirstcharactersdirectory.md b/docs/models/operations/getfirstcharactersdirectory.md new file mode 100644 index 0000000..abca84b --- /dev/null +++ b/docs/models/operations/getfirstcharactersdirectory.md @@ -0,0 +1,10 @@ +# GetFirstCharactersDirectory + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Size` | **int64* | :heavy_minus_sign: | The number of items starting with this character | +| `Title` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getfirstcharactersglobals.md b/docs/models/operations/getfirstcharactersglobals.md new file mode 100644 index 0000000..592e767 --- /dev/null +++ b/docs/models/operations/getfirstcharactersglobals.md @@ -0,0 +1,18 @@ +# GetFirstCharactersGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getfirstcharactersmediacontainer.md b/docs/models/operations/getfirstcharactersmediacontainer.md new file mode 100644 index 0000000..d0e6512 --- /dev/null +++ b/docs/models/operations/getfirstcharactersmediacontainer.md @@ -0,0 +1,17 @@ +# GetFirstCharactersMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][operations.GetFirstCharactersDirectory](../../models/operations/getfirstcharactersdirectory.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getfirstcharactersrequest.md b/docs/models/operations/getfirstcharactersrequest.md new file mode 100644 index 0000000..13c1581 --- /dev/null +++ b/docs/models/operations/getfirstcharactersrequest.md @@ -0,0 +1,22 @@ +# GetFirstCharactersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type to filter on | | +| `Sort` | **int64* | :heavy_minus_sign: | The metadata type to filter on | | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | \ No newline at end of file diff --git a/docs/models/operations/getfirstcharactersresponse.md b/docs/models/operations/getfirstcharactersresponse.md new file mode 100644 index 0000000..85e66a0 --- /dev/null +++ b/docs/models/operations/getfirstcharactersresponse.md @@ -0,0 +1,11 @@ +# GetFirstCharactersResponse + + +## 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.GetFirstCharactersResponseBody](../../models/operations/getfirstcharactersresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getfirstcharactersresponsebody.md b/docs/models/operations/getfirstcharactersresponsebody.md new file mode 100644 index 0000000..5417575 --- /dev/null +++ b/docs/models/operations/getfirstcharactersresponsebody.md @@ -0,0 +1,10 @@ +# GetFirstCharactersResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetFirstCharactersMediaContainer](../../models/operations/getfirstcharactersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getfoldersdirectory.md b/docs/models/operations/getfoldersdirectory.md new file mode 100644 index 0000000..6679cc4 --- /dev/null +++ b/docs/models/operations/getfoldersdirectory.md @@ -0,0 +1,10 @@ +# GetFoldersDirectory + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FastKey` | **string* | :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/getfoldersglobals.md b/docs/models/operations/getfoldersglobals.md new file mode 100644 index 0000000..bcfc3f3 --- /dev/null +++ b/docs/models/operations/getfoldersglobals.md @@ -0,0 +1,18 @@ +# GetFoldersGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getfoldersmediacontainer.md b/docs/models/operations/getfoldersmediacontainer.md new file mode 100644 index 0000000..dfbe6a0 --- /dev/null +++ b/docs/models/operations/getfoldersmediacontainer.md @@ -0,0 +1,17 @@ +# GetFoldersMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][operations.GetFoldersDirectory](../../models/operations/getfoldersdirectory.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getfoldersrequest.md b/docs/models/operations/getfoldersrequest.md new file mode 100644 index 0000000..0854cde --- /dev/null +++ b/docs/models/operations/getfoldersrequest.md @@ -0,0 +1,19 @@ +# GetFoldersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getfoldersresponse.md b/docs/models/operations/getfoldersresponse.md new file mode 100644 index 0000000..0a5c5cb --- /dev/null +++ b/docs/models/operations/getfoldersresponse.md @@ -0,0 +1,11 @@ +# GetFoldersResponse + + +## 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.GetFoldersResponseBody](../../models/operations/getfoldersresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getfoldersresponsebody.md b/docs/models/operations/getfoldersresponsebody.md new file mode 100644 index 0000000..c5d2b79 --- /dev/null +++ b/docs/models/operations/getfoldersresponsebody.md @@ -0,0 +1,10 @@ +# GetFoldersResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetFoldersMediaContainer](../../models/operations/getfoldersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibrarydirectory.md b/docs/models/operations/getgenreslibrarydirectory.md deleted file mode 100644 index dccf938..0000000 --- a/docs/models/operations/getgenreslibrarydirectory.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGenresLibraryDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | -| `FastKey` | *string* | :heavy_check_mark: | N/A | /library/sections/10/all?genre=89 | -| `Key` | *string* | :heavy_check_mark: | N/A | 89 | -| `Title` | *string* | :heavy_check_mark: | N/A | Action | -| `Type` | *string* | :heavy_check_mark: | N/A | genre | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibrarymediacontainer.md b/docs/models/operations/getgenreslibrarymediacontainer.md deleted file mode 100644 index fd797ec..0000000 --- a/docs/models/operations/getgenreslibrarymediacontainer.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetGenresLibraryMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series | -| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor | -| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary | -| `Directory` | [][operations.GetGenresLibraryDirectory](../../models/operations/getgenreslibrarydirectory.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryqueryparamtype.md b/docs/models/operations/getgenreslibraryqueryparamtype.md deleted file mode 100644 index 8a151cc..0000000 --- a/docs/models/operations/getgenreslibraryqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetGenresLibraryQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| ------------------------------------------ | ------------------------------------------ | -| `GetGenresLibraryQueryParamTypeMovie` | 1 | -| `GetGenresLibraryQueryParamTypeTvShow` | 2 | -| `GetGenresLibraryQueryParamTypeSeason` | 3 | -| `GetGenresLibraryQueryParamTypeEpisode` | 4 | -| `GetGenresLibraryQueryParamTypeArtist` | 5 | -| `GetGenresLibraryQueryParamTypeAlbum` | 6 | -| `GetGenresLibraryQueryParamTypeTrack` | 7 | -| `GetGenresLibraryQueryParamTypePhotoAlbum` | 8 | -| `GetGenresLibraryQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryrequest.md b/docs/models/operations/getgenreslibraryrequest.md deleted file mode 100644 index 47e430c..0000000 --- a/docs/models/operations/getgenreslibraryrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetGenresLibraryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `Type` | [operations.GetGenresLibraryQueryParamType](../../models/operations/getgenreslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryresponse.md b/docs/models/operations/getgenreslibraryresponse.md deleted file mode 100644 index 5cee803..0000000 --- a/docs/models/operations/getgenreslibraryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGenresLibraryResponse - - -## 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.GetGenresLibraryResponseBody](../../models/operations/getgenreslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryresponsebody.md b/docs/models/operations/getgenreslibraryresponsebody.md deleted file mode 100644 index 746ec4d..0000000 --- a/docs/models/operations/getgenreslibraryresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGenresLibraryResponseBody - -Successful response containing media container data. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetGenresLibraryMediaContainer](../../models/operations/getgenreslibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getgeodatageodata.md b/docs/models/operations/getgeodatageodata.md deleted file mode 100644 index 51020b9..0000000 --- a/docs/models/operations/getgeodatageodata.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetGeoDataGeoData - -Geo location data - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `Code` | *string* | :heavy_check_mark: | The ISO 3166-1 alpha-2 code of the country. | VI | -| `ContinentCode` | *string* | :heavy_check_mark: | The continent code where the country is located. | NA | -| `Country` | *string* | :heavy_check_mark: | The official name of the country. | United States Virgin Islands | -| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam | -| `EuropeanUnionMember` | **bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true | -| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas | -| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 | -| `InPrivacyRestrictedCountry` | **bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true | -| `InPrivacyRestrictedRegion` | **bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true | -| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas | -| `Coordinates` | *string* | :heavy_check_mark: | The geographical coordinates (latitude, longitude) of the location. | 18.3381, -64.8941 | \ No newline at end of file diff --git a/docs/models/operations/getgeodataresponse.md b/docs/models/operations/getgeodataresponse.md deleted file mode 100644 index fffa1ab..0000000 --- a/docs/models/operations/getgeodataresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGeoDataResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 | | -| `GeoData` | [*operations.GetGeoDataGeoData](../../models/operations/getgeodatageodata.md) | :heavy_minus_sign: | Gets the geo location data of the user | {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
} | \ No newline at end of file diff --git a/docs/models/operations/getglobalhubsmediacontainer.md b/docs/models/operations/getglobalhubsmediacontainer.md deleted file mode 100644 index 98e8aa5..0000000 --- a/docs/models/operations/getglobalhubsmediacontainer.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGlobalHubsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 8 | -| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | true | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `Hub` | [][operations.Hub](../../models/operations/hub.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getglobalhubsmetadata.md b/docs/models/operations/getglobalhubsmetadata.md deleted file mode 100644 index a245c4f..0000000 --- a/docs/models/operations/getglobalhubsmetadata.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetGlobalHubsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 57070 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/57070/items | -| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://9fee6c5b-3143-4923-813e-57bd0190056c | -| `Type` | **string* | :heavy_minus_sign: | N/A | playlist | -| `Title` | **string* | :heavy_minus_sign: | N/A | November Movie Day | -| `TitleSort` | **string* | :heavy_minus_sign: | N/A | Tracks | -| `Summary` | **string* | :heavy_minus_sign: | N/A | | -| `Smart` | **bool* | :heavy_minus_sign: | N/A | false | -| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video | -| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/57070/composite/1668787730 | -| `Icon` | **string* | :heavy_minus_sign: | N/A | playlist://image.smart | -| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 2 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1668787732 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 16873000 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 3 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1668779618 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1668787730 | \ No newline at end of file diff --git a/docs/models/operations/getglobalhubsrequest.md b/docs/models/operations/getglobalhubsrequest.md deleted file mode 100644 index 2399934..0000000 --- a/docs/models/operations/getglobalhubsrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index a087f0a..0000000 --- a/docs/models/operations/getglobalhubsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetGlobalHubsResponseBody](../../models/operations/getglobalhubsresponsebody.md) | :heavy_minus_sign: | returns global hubs | \ No newline at end of file diff --git a/docs/models/operations/getglobalhubsresponsebody.md b/docs/models/operations/getglobalhubsresponsebody.md deleted file mode 100644 index 396a0bf..0000000 --- a/docs/models/operations/getglobalhubsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGlobalHubsResponseBody - -returns global hubs - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetGlobalHubsMediaContainer](../../models/operations/getglobalhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gethistoryitemglobals.md b/docs/models/operations/gethistoryitemglobals.md new file mode 100644 index 0000000..f16cff6 --- /dev/null +++ b/docs/models/operations/gethistoryitemglobals.md @@ -0,0 +1,18 @@ +# GetHistoryItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/gethistoryitemrequest.md b/docs/models/operations/gethistoryitemrequest.md new file mode 100644 index 0000000..37ae1b6 --- /dev/null +++ b/docs/models/operations/gethistoryitemrequest.md @@ -0,0 +1,19 @@ +# GetHistoryItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `HistoryID` | *int64* | :heavy_check_mark: | The id of the history item (the `historyKey` from above) | | \ No newline at end of file diff --git a/docs/models/operations/gethistoryitemresponse.md b/docs/models/operations/gethistoryitemresponse.md new file mode 100644 index 0000000..91bd74b --- /dev/null +++ b/docs/models/operations/gethistoryitemresponse.md @@ -0,0 +1,12 @@ +# GetHistoryItemResponse + + +## 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 | +| `HistoryAllGetResponses200` | [*components.HistoryAllGetResponses200](../../models/components/historyallgetresponses200.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gethomedataresponse.md b/docs/models/operations/gethomedataresponse.md deleted file mode 100644 index f3d39ca..0000000 --- a/docs/models/operations/gethomedataresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetHomeDataResponse - - -## 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.GetHomeDataResponseBody](../../models/operations/gethomedataresponsebody.md) | :heavy_minus_sign: | Home Data | \ No newline at end of file diff --git a/docs/models/operations/gethomedataresponsebody.md b/docs/models/operations/gethomedataresponsebody.md deleted file mode 100644 index 099d0fc..0000000 --- a/docs/models/operations/gethomedataresponsebody.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetHomeDataResponseBody - -Home Data - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| `ID` | **float64* | :heavy_minus_sign: | N/A | 1841489 | -| `Name` | **string* | :heavy_minus_sign: | N/A | Blindkitty38's home | -| `GuestUserID` | **float64* | :heavy_minus_sign: | N/A | 58815432 | -| `GuestUserUUID` | **string* | :heavy_minus_sign: | N/A | f3df4e01bfca0787 | -| `GuestEnabled` | **bool* | :heavy_minus_sign: | N/A | | -| `Subscription` | **bool* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/gethubitemsglobals.md b/docs/models/operations/gethubitemsglobals.md new file mode 100644 index 0000000..d534055 --- /dev/null +++ b/docs/models/operations/gethubitemsglobals.md @@ -0,0 +1,18 @@ +# GetHubItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/gethubitemsrequest.md b/docs/models/operations/gethubitemsrequest.md new file mode 100644 index 0000000..59bc153 --- /dev/null +++ b/docs/models/operations/gethubitemsrequest.md @@ -0,0 +1,20 @@ +# GetHubItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `Identifier` | []*string* | :heavy_check_mark: | If provided, limit to only specified hubs | | \ No newline at end of file diff --git a/docs/models/operations/gethubitemsresponse.md b/docs/models/operations/gethubitemsresponse.md new file mode 100644 index 0000000..dabbdb9 --- /dev/null +++ b/docs/models/operations/gethubitemsresponse.md @@ -0,0 +1,12 @@ +# GetHubItemsResponse + + +## 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.GetHubItemsResponseBody](../../models/operations/gethubitemsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gethubitemsresponsebody.md b/docs/models/operations/gethubitemsresponsebody.md new file mode 100644 index 0000000..64bd5b6 --- /dev/null +++ b/docs/models/operations/gethubitemsresponsebody.md @@ -0,0 +1,10 @@ +# GetHubItemsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `MediaContainer` | [*components.MediaContainer](../../models/components/mediacontainer.md) | :heavy_minus_sign: | `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.
| \ No newline at end of file diff --git a/docs/models/operations/getidentitymediacontainer.md b/docs/models/operations/getidentitymediacontainer.md new file mode 100644 index 0000000..7685cc9 --- /dev/null +++ b/docs/models/operations/getidentitymediacontainer.md @@ -0,0 +1,11 @@ +# GetIdentityMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Claimed` | **bool* | :heavy_minus_sign: | Indicates whether this server has been claimed by a user | +| `MachineIdentifier` | **string* | :heavy_minus_sign: | A unique identifier of the computer | +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `Version` | **string* | :heavy_minus_sign: | The full version string of the PMS | \ No newline at end of file diff --git a/docs/models/operations/getidentityresponse.md b/docs/models/operations/getidentityresponse.md new file mode 100644 index 0000000..3c4d985 --- /dev/null +++ b/docs/models/operations/getidentityresponse.md @@ -0,0 +1,11 @@ +# GetIdentityResponse + + +## 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.GetIdentityResponseBody](../../models/operations/getidentityresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getidentityresponsebody.md b/docs/models/operations/getidentityresponsebody.md new file mode 100644 index 0000000..dee3cc4 --- /dev/null +++ b/docs/models/operations/getidentityresponsebody.md @@ -0,0 +1,10 @@ +# GetIdentityResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetIdentityMediaContainer](../../models/operations/getidentitymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getimagefrombifglobals.md b/docs/models/operations/getimagefrombifglobals.md new file mode 100644 index 0000000..06a18b1 --- /dev/null +++ b/docs/models/operations/getimagefrombifglobals.md @@ -0,0 +1,18 @@ +# GetImageFromBifGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getimagefrombifrequest.md b/docs/models/operations/getimagefrombifrequest.md new file mode 100644 index 0000000..bb3710b --- /dev/null +++ b/docs/models/operations/getimagefrombifrequest.md @@ -0,0 +1,21 @@ +# GetImageFromBifRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PartID` | *int64* | :heavy_check_mark: | The part id who's index is to be fetched | | +| `Index` | [operations.PathParamIndex](../../models/operations/pathparamindex.md) | :heavy_check_mark: | The type of index to grab. | | +| `Offset` | *int64* | :heavy_check_mark: | The offset to seek in ms. | | \ No newline at end of file diff --git a/docs/models/operations/getimagefrombifresponse.md b/docs/models/operations/getimagefrombifresponse.md new file mode 100644 index 0000000..ba91cb6 --- /dev/null +++ b/docs/models/operations/getimagefrombifresponse.md @@ -0,0 +1,11 @@ +# GetImageFromBifResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getimageglobals.md b/docs/models/operations/getimageglobals.md new file mode 100644 index 0000000..e4a938b --- /dev/null +++ b/docs/models/operations/getimageglobals.md @@ -0,0 +1,18 @@ +# GetImageGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getimagerequest.md b/docs/models/operations/getimagerequest.md new file mode 100644 index 0000000..c977d72 --- /dev/null +++ b/docs/models/operations/getimagerequest.md @@ -0,0 +1,25 @@ +# GetImageRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `TopLeft` | **string* | :heavy_minus_sign: | The base color (hex) for the top left quadrant. | 3f280a | +| `TopRight` | **string* | :heavy_minus_sign: | The base color (hex) for the top right quadrant. | 6b4713 | +| `BottomRight` | **string* | :heavy_minus_sign: | The base color (hex) for the bottom right quadrant. | 0f2a43 | +| `BottomLeft` | **string* | :heavy_minus_sign: | The base color (hex) for the bottom left quadrant. | 1c425d | +| `Width` | **int64* | :heavy_minus_sign: | Width in pixels for the image. | 1920 | +| `Height` | **int64* | :heavy_minus_sign: | Height in pixels for the image. | 1080 | +| `Noise` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether to add noise to the ouput image. Noise can reduce color banding with the gradients. Image sizes with noise will be larger. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getimageresponse.md b/docs/models/operations/getimageresponse.md new file mode 100644 index 0000000..36da8b7 --- /dev/null +++ b/docs/models/operations/getimageresponse.md @@ -0,0 +1,11 @@ +# GetImageResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getitemartworkglobals.md b/docs/models/operations/getitemartworkglobals.md new file mode 100644 index 0000000..29dd943 --- /dev/null +++ b/docs/models/operations/getitemartworkglobals.md @@ -0,0 +1,18 @@ +# GetItemArtworkGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getitemartworkpathparamelement.md b/docs/models/operations/getitemartworkpathparamelement.md new file mode 100644 index 0000000..e5e4f02 --- /dev/null +++ b/docs/models/operations/getitemartworkpathparamelement.md @@ -0,0 +1,13 @@ +# GetItemArtworkPathParamElement + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `GetItemArtworkPathParamElementThumb` | thumb | +| `GetItemArtworkPathParamElementArt` | art | +| `GetItemArtworkPathParamElementClearLogo` | clearLogo | +| `GetItemArtworkPathParamElementBanner` | banner | +| `GetItemArtworkPathParamElementPoster` | poster | +| `GetItemArtworkPathParamElementTheme` | theme | \ No newline at end of file diff --git a/docs/models/operations/getitemartworkrequest.md b/docs/models/operations/getitemartworkrequest.md new file mode 100644 index 0000000..24ed84d --- /dev/null +++ b/docs/models/operations/getitemartworkrequest.md @@ -0,0 +1,21 @@ +# GetItemArtworkRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Element` | [operations.GetItemArtworkPathParamElement](../../models/operations/getitemartworkpathparamelement.md) | :heavy_check_mark: | N/A | | +| `Timestamp` | *int64* | :heavy_check_mark: | A timestamp on the element used for cache management in the client | | \ No newline at end of file diff --git a/docs/models/operations/getitemartworkresponse.md b/docs/models/operations/getitemartworkresponse.md new file mode 100644 index 0000000..2917ae6 --- /dev/null +++ b/docs/models/operations/getitemartworkresponse.md @@ -0,0 +1,12 @@ +# GetItemArtworkResponse + + +## 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 | +| `TwoHundredAudioMpeg3ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | +| `TwoHundredImageJpegResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getitemdecisionglobals.md b/docs/models/operations/getitemdecisionglobals.md new file mode 100644 index 0000000..e737add --- /dev/null +++ b/docs/models/operations/getitemdecisionglobals.md @@ -0,0 +1,18 @@ +# GetItemDecisionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getitemdecisionrequest.md b/docs/models/operations/getitemdecisionrequest.md new file mode 100644 index 0000000..e7e1e51 --- /dev/null +++ b/docs/models/operations/getitemdecisionrequest.md @@ -0,0 +1,20 @@ +# GetItemDecisionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | +| `ItemID` | *int64* | :heavy_check_mark: | The item ids | 32 | \ No newline at end of file diff --git a/docs/models/operations/getitemdecisionresponse.md b/docs/models/operations/getitemdecisionresponse.md new file mode 100644 index 0000000..5878e83 --- /dev/null +++ b/docs/models/operations/getitemdecisionresponse.md @@ -0,0 +1,11 @@ +# GetItemDecisionResponse + + +## 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 | +| `MediaContainerWithDecision` | [*components.MediaContainerWithDecision](../../models/components/mediacontainerwithdecision.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getitemtreeglobals.md b/docs/models/operations/getitemtreeglobals.md new file mode 100644 index 0000000..32e3444 --- /dev/null +++ b/docs/models/operations/getitemtreeglobals.md @@ -0,0 +1,18 @@ +# GetItemTreeGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getitemtreerequest.md b/docs/models/operations/getitemtreerequest.md new file mode 100644 index 0000000..14267f4 --- /dev/null +++ b/docs/models/operations/getitemtreerequest.md @@ -0,0 +1,19 @@ +# GetItemTreeRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getitemtreeresponse.md b/docs/models/operations/getitemtreeresponse.md new file mode 100644 index 0000000..4efec94 --- /dev/null +++ b/docs/models/operations/getitemtreeresponse.md @@ -0,0 +1,11 @@ +# GetItemTreeResponse + + +## 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 | +| `MediaContainerWithNestedMetadata` | [*components.MediaContainerWithNestedMetadata](../../models/components/mediacontainerwithnestedmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsdirectory.md b/docs/models/operations/getlibrarydetailsdirectory.md deleted file mode 100644 index 7576d75..0000000 --- a/docs/models/operations/getlibrarydetailsdirectory.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryDetailsDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | **string* | :heavy_minus_sign: | N/A | search?type=1 | -| `Title` | **string* | :heavy_minus_sign: | N/A | Search... | -| `Secondary` | **bool* | :heavy_minus_sign: | N/A | true | -| `Prompt` | **string* | :heavy_minus_sign: | N/A | Search Movies | -| `Search` | **bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsfield.md b/docs/models/operations/getlibrarydetailsfield.md deleted file mode 100644 index d79a46f..0000000 --- a/docs/models/operations/getlibrarydetailsfield.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryDetailsField - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | **string* | :heavy_minus_sign: | N/A | label | -| `Title` | **string* | :heavy_minus_sign: | N/A | Label | -| `Type` | **string* | :heavy_minus_sign: | N/A | tag | -| `SubType` | **string* | :heavy_minus_sign: | N/A | bitrate | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsfieldtype.md b/docs/models/operations/getlibrarydetailsfieldtype.md deleted file mode 100644 index 4be754a..0000000 --- a/docs/models/operations/getlibrarydetailsfieldtype.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryDetailsFieldType - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Type` | **string* | :heavy_minus_sign: | N/A | resolution | -| `Operator` | [][operations.GetLibraryDetailsOperator](../../models/operations/getlibrarydetailsoperator.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsfilter.md b/docs/models/operations/getlibrarydetailsfilter.md deleted file mode 100644 index c8e35a0..0000000 --- a/docs/models/operations/getlibrarydetailsfilter.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryDetailsFilter - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `Filter` | **string* | :heavy_minus_sign: | N/A | label | -| `FilterType` | **string* | :heavy_minus_sign: | N/A | string | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/label | -| `Title` | **string* | :heavy_minus_sign: | N/A | Labels | -| `Type` | **string* | :heavy_minus_sign: | N/A | filter | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsglobals.md b/docs/models/operations/getlibrarydetailsglobals.md new file mode 100644 index 0000000..0457877 --- /dev/null +++ b/docs/models/operations/getlibrarydetailsglobals.md @@ -0,0 +1,18 @@ +# GetLibraryDetailsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsmediacontainer.md b/docs/models/operations/getlibrarydetailsmediacontainer.md index d56c276..37952c7 100644 --- a/docs/models/operations/getlibrarydetailsmediacontainer.md +++ b/docs/models/operations/getlibrarydetailsmediacontainer.md @@ -3,20 +3,19 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Size` | **int* | :heavy_minus_sign: | N/A | 29 | -| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false | -| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `Content` | **string* | :heavy_minus_sign: | N/A | secondary | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `LibrarySectionID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `MediaTagVersion` | **int* | :heavy_minus_sign: | N/A | 1701731894 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `Title1` | **string* | :heavy_minus_sign: | N/A | Movies | -| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | secondary | -| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 | -| `Directory` | [][operations.GetLibraryDetailsDirectory](../../models/operations/getlibrarydetailsdirectory.md) | :heavy_minus_sign: | N/A | | -| `Type` | [][operations.GetLibraryDetailsType](../../models/operations/getlibrarydetailstype.md) | :heavy_minus_sign: | N/A | | -| `FieldType` | [][operations.GetLibraryDetailsFieldType](../../models/operations/getlibrarydetailsfieldtype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Content` | **string* | :heavy_minus_sign: | The 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": true` 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": true` which used to be used to allow clients to build search dialogs on the fly. | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | +| `Art` | **string* | :heavy_minus_sign: | N/A | +| `Directory` | [][components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | N/A | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `LibrarySectionID` | **int64* | :heavy_minus_sign: | N/A | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | +| `MediaTagVersion` | **int64* | :heavy_minus_sign: | N/A | +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `SortAsc` | **bool* | :heavy_minus_sign: | N/A | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `Title1` | **string* | :heavy_minus_sign: | N/A | +| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | +| `ViewMode` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsoperator.md b/docs/models/operations/getlibrarydetailsoperator.md deleted file mode 100644 index a60652c..0000000 --- a/docs/models/operations/getlibrarydetailsoperator.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryDetailsOperator - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | **string* | :heavy_minus_sign: | N/A | = | -| `Title` | **string* | :heavy_minus_sign: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsrequest.md b/docs/models/operations/getlibrarydetailsrequest.md index c04a4ce..d05178f 100644 --- a/docs/models/operations/getlibrarydetailsrequest.md +++ b/docs/models/operations/getlibrarydetailsrequest.md @@ -3,7 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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.
| | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *string* | :heavy_check_mark: | The section identifier | | +| `IncludeDetails` | [*components.BoolInt](../../models/components/boolint.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. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsresponse.md b/docs/models/operations/getlibrarydetailsresponse.md index 2a37d4e..cb80eaa 100644 --- a/docs/models/operations/getlibrarydetailsresponse.md +++ b/docs/models/operations/getlibrarydetailsresponse.md @@ -8,4 +8,4 @@ | `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.GetLibraryDetailsResponseBody](../../models/operations/getlibrarydetailsresponsebody.md) | :heavy_minus_sign: | The details of the library | \ No newline at end of file +| `Object` | [*operations.GetLibraryDetailsResponseBody](../../models/operations/getlibrarydetailsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailsresponsebody.md b/docs/models/operations/getlibrarydetailsresponsebody.md index 1cc3f99..da15450 100644 --- a/docs/models/operations/getlibrarydetailsresponsebody.md +++ b/docs/models/operations/getlibrarydetailsresponsebody.md @@ -1,6 +1,6 @@ # GetLibraryDetailsResponseBody -The details of the library +OK ## Fields diff --git a/docs/models/operations/getlibrarydetailssort.md b/docs/models/operations/getlibrarydetailssort.md deleted file mode 100644 index f9919f0..0000000 --- a/docs/models/operations/getlibrarydetailssort.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetLibraryDetailsSort - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `Default` | **string* | :heavy_minus_sign: | N/A | asc | -| `DefaultDirection` | **string* | :heavy_minus_sign: | N/A | desc | -| `DescKey` | **string* | :heavy_minus_sign: | N/A | random:desc | -| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/firstCharacter | -| `Key` | **string* | :heavy_minus_sign: | N/A | random | -| `Title` | **string* | :heavy_minus_sign: | N/A | Randomly | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydetailstype.md b/docs/models/operations/getlibrarydetailstype.md deleted file mode 100644 index 22dfcbb..0000000 --- a/docs/models/operations/getlibrarydetailstype.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetLibraryDetailsType - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/all?type=1 | -| `Type` | **string* | :heavy_minus_sign: | N/A | movie | -| `Title` | **string* | :heavy_minus_sign: | N/A | Movies | -| `Active` | **bool* | :heavy_minus_sign: | N/A | false | -| `Filter` | [][operations.GetLibraryDetailsFilter](../../models/operations/getlibrarydetailsfilter.md) | :heavy_minus_sign: | N/A | | -| `Sort` | [][operations.GetLibraryDetailsSort](../../models/operations/getlibrarydetailssort.md) | :heavy_minus_sign: | N/A | | -| `Field` | [][operations.GetLibraryDetailsField](../../models/operations/getlibrarydetailsfield.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubscountry.md b/docs/models/operations/getlibraryhubscountry.md deleted file mode 100644 index b587c84..0000000 --- a/docs/models/operations/getlibraryhubscountry.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryHubsCountry - - -## 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/getlibraryhubsdirector.md b/docs/models/operations/getlibraryhubsdirector.md deleted file mode 100644 index cf66e24..0000000 --- a/docs/models/operations/getlibraryhubsdirector.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryHubsDirector - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Nathan Greno | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsgenre.md b/docs/models/operations/getlibraryhubsgenre.md deleted file mode 100644 index 7c099c1..0000000 --- a/docs/models/operations/getlibraryhubsgenre.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryHubsGenre - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Animation | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubshub.md b/docs/models/operations/getlibraryhubshub.md deleted file mode 100644 index ee1c168..0000000 --- a/docs/models/operations/getlibraryhubshub.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetLibraryHubsHub - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0 | -| `Title` | **string* | :heavy_minus_sign: | N/A | Recently Played Movies | -| `Type` | **string* | :heavy_minus_sign: | N/A | movie | -| `HubIdentifier` | **string* | :heavy_minus_sign: | N/A | movie.recentlyviewed.1 | -| `Context` | **string* | :heavy_minus_sign: | N/A | hub.movie.recentlyviewed | -| `Size` | **int* | :heavy_minus_sign: | N/A | 6 | -| `More` | **bool* | :heavy_minus_sign: | N/A | true | -| `Style` | **string* | :heavy_minus_sign: | N/A | shelf | -| `HubKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66485,66098,57249,11449,5858,14944 | -| `Metadata` | [][operations.GetLibraryHubsMetadata](../../models/operations/getlibraryhubsmetadata.md) | :heavy_minus_sign: | N/A | | -| `Promoted` | **bool* | :heavy_minus_sign: | N/A | true | -| `Random` | **bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsmedia.md b/docs/models/operations/getlibraryhubsmedia.md deleted file mode 100644 index a797bb7..0000000 --- a/docs/models/operations/getlibraryhubsmedia.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetLibraryHubsMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 38247 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 6017237 | -| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 2051 | -| `Width` | **int* | :heavy_minus_sign: | N/A | 1920 | -| `Height` | **int* | :heavy_minus_sign: | N/A | 1080 | -| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 1.78 | -| `AudioChannels` | **int* | :heavy_minus_sign: | N/A | 2 | -| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | aac | -| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | h264 | -| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | 1080 | -| `Container` | **string* | :heavy_minus_sign: | N/A | mp4 | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p | -| `OptimizedForStreaming` | **int* | :heavy_minus_sign: | N/A | 1 | -| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | high | -| `Part` | [][operations.GetLibraryHubsPart](../../models/operations/getlibraryhubspart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsmediacontainer.md b/docs/models/operations/getlibraryhubsmediacontainer.md deleted file mode 100644 index b8ca0eb..0000000 --- a/docs/models/operations/getlibraryhubsmediacontainer.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetLibraryHubsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `Size` | **int* | :heavy_minus_sign: | N/A | 7 | -| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | true | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `LibrarySectionID` | **int* | :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 | -| `Hub` | [][operations.GetLibraryHubsHub](../../models/operations/getlibraryhubshub.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsmetadata.md b/docs/models/operations/getlibraryhubsmetadata.md deleted file mode 100644 index ea3d046..0000000 --- a/docs/models/operations/getlibraryhubsmetadata.md +++ /dev/null @@ -1,41 +0,0 @@ -# GetLibraryHubsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 14944 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/14944 | -| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://movie/5d77686eeb5d26001f1eb339 | -| `Studio` | **string* | :heavy_minus_sign: | N/A | Walt Disney Animation Studios | -| `Type` | **string* | :heavy_minus_sign: | N/A | movie | -| `Title` | **string* | :heavy_minus_sign: | N/A | Tangled | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Movies | -| `LibrarySectionID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1 | -| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG | -| `Summary` | **string* | :heavy_minus_sign: | N/A | The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is. | -| `Rating` | **float64* | :heavy_minus_sign: | N/A | 8.9 | -| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 8.7 | -| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1704936047 | -| `Year` | **int* | :heavy_minus_sign: | N/A | 2010 | -| `Tagline` | **string* | :heavy_minus_sign: | N/A | They're taking adventure to new lengths. | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/14944/thumb/1705739847 | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/14944/art/1705739847 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 6017237 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2010-11-24 00:00:00 +0000 UTC | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1589412494 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705739847 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/14952 | -| `RatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `Media` | [][operations.GetLibraryHubsMedia](../../models/operations/getlibraryhubsmedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetLibraryHubsGenre](../../models/operations/getlibraryhubsgenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetLibraryHubsCountry](../../models/operations/getlibraryhubscountry.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetLibraryHubsDirector](../../models/operations/getlibraryhubsdirector.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetLibraryHubsRole](../../models/operations/getlibraryhubsrole.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetLibraryHubsWriter](../../models/operations/getlibraryhubswriter.md) | :heavy_minus_sign: | N/A | | -| `SkipCount` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ChapterSource` | **string* | :heavy_minus_sign: | N/A | media | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubspart.md b/docs/models/operations/getlibraryhubspart.md deleted file mode 100644 index da15daf..0000000 --- a/docs/models/operations/getlibraryhubspart.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetLibraryHubsPart - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ID` | **int* | :heavy_minus_sign: | N/A | 38247 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/38247/1589412494/file.mp4 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 6017237 | -| `File` | **string* | :heavy_minus_sign: | N/A | /movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4 | -| `Size` | **int* | :heavy_minus_sign: | N/A | 1545647447 | -| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | -| `Container` | **string* | :heavy_minus_sign: | N/A | mp4 | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | true | -| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | high | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsrequest.md b/docs/models/operations/getlibraryhubsrequest.md deleted file mode 100644 index 9a27f8c..0000000 --- a/docs/models/operations/getlibraryhubsrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 8c8c62c..0000000 --- a/docs/models/operations/getlibraryhubsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetLibraryHubsResponseBody](../../models/operations/getlibraryhubsresponsebody.md) | :heavy_minus_sign: | The hubs specific to the library | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsresponsebody.md b/docs/models/operations/getlibraryhubsresponsebody.md deleted file mode 100644 index 633a5b1..0000000 --- a/docs/models/operations/getlibraryhubsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryHubsResponseBody - -The hubs specific to the library - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetLibraryHubsMediaContainer](../../models/operations/getlibraryhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsrole.md b/docs/models/operations/getlibraryhubsrole.md deleted file mode 100644 index 3de8c82..0000000 --- a/docs/models/operations/getlibraryhubsrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryHubsRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Donna Murphy | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubswriter.md b/docs/models/operations/getlibraryhubswriter.md deleted file mode 100644 index 86b00eb..0000000 --- a/docs/models/operations/getlibraryhubswriter.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryHubsWriter - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Wilhelm Grimm | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsactivedirection.md b/docs/models/operations/getlibraryitemsactivedirection.md deleted file mode 100644 index 2ce4e80..0000000 --- a/docs/models/operations/getlibraryitemsactivedirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryItemsActiveDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| ------------------------------------------ | ------------------------------------------ | -| `GetLibraryItemsActiveDirectionAscending` | asc | -| `GetLibraryItemsActiveDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemscollection.md b/docs/models/operations/getlibraryitemscollection.md deleted file mode 100644 index b844f00..0000000 --- a/docs/models/operations/getlibraryitemscollection.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryItemsCollection - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemscountry.md b/docs/models/operations/getlibraryitemscountry.md deleted file mode 100644 index 3fad612..0000000 --- a/docs/models/operations/getlibraryitemscountry.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryItemsCountry - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the country.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsdefaultdirection.md b/docs/models/operations/getlibraryitemsdefaultdirection.md deleted file mode 100644 index 97e2fa1..0000000 --- a/docs/models/operations/getlibraryitemsdefaultdirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryItemsDefaultDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| ------------------------------------------- | ------------------------------------------- | -| `GetLibraryItemsDefaultDirectionAscending` | asc | -| `GetLibraryItemsDefaultDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsdirector.md b/docs/models/operations/getlibraryitemsdirector.md deleted file mode 100644 index bd706b1..0000000 --- a/docs/models/operations/getlibraryitemsdirector.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsDirector - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the director. | 126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the director. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsfield.md b/docs/models/operations/getlibraryitemsfield.md deleted file mode 100644 index 824cf91..0000000 --- a/docs/models/operations/getlibraryitemsfield.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryItemsField - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | show.title | -| `Title` | *string* | :heavy_check_mark: | N/A | Show Title | -| `Type` | *string* | :heavy_check_mark: | N/A | string | -| `SubType` | **string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsfieldtype.md b/docs/models/operations/getlibraryitemsfieldtype.md deleted file mode 100644 index 0ba7102..0000000 --- a/docs/models/operations/getlibraryitemsfieldtype.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryItemsFieldType - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Type` | *string* | :heavy_check_mark: | N/A | tag | -| `Operator` | [][operations.GetLibraryItemsOperator](../../models/operations/getlibraryitemsoperator.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsfilter.md b/docs/models/operations/getlibraryitemsfilter.md deleted file mode 100644 index 9585aa3..0000000 --- a/docs/models/operations/getlibraryitemsfilter.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryItemsFilter - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `Filter` | *string* | :heavy_check_mark: | N/A | genre | -| `FilterType` | *string* | :heavy_check_mark: | N/A | string | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | -| `Title` | *string* | :heavy_check_mark: | N/A | Genre | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsgenre.md b/docs/models/operations/getlibraryitemsgenre.md deleted file mode 100644 index 8bfef84..0000000 --- a/docs/models/operations/getlibraryitemsgenre.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryItemsGenre - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the genre.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item
| Crime | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsglobals.md b/docs/models/operations/getlibraryitemsglobals.md new file mode 100644 index 0000000..c89248b --- /dev/null +++ b/docs/models/operations/getlibraryitemsglobals.md @@ -0,0 +1,18 @@ +# GetLibraryItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsguids.md b/docs/models/operations/getlibraryitemsguids.md deleted file mode 100644 index fba6ca7..0000000 --- a/docs/models/operations/getlibraryitemsguids.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibraryItemsGuids - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
| {
"imdbExample": {
"summary": "IMDB example",
"value": "imdb://tt13015952"
},
"tmdbExample": {
"summary": "TMDB example",
"value": "tmdb://2434012"
},
"tvdbExample": {
"summary": "TVDB example",
"value": "tvdb://7945991"
}
} | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemshasthumbnail.md b/docs/models/operations/getlibraryitemshasthumbnail.md deleted file mode 100644 index 4011c09..0000000 --- a/docs/models/operations/getlibraryitemshasthumbnail.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryItemsHasThumbnail - -Indicates if the part has a thumbnail. - - - -## Values - -| Name | Value | -| ---------------------------------- | ---------------------------------- | -| `GetLibraryItemsHasThumbnailFalse` | 0 | -| `GetLibraryItemsHasThumbnailTrue` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsimage.md b/docs/models/operations/getlibraryitemsimage.md deleted file mode 100644 index 5e5aa11..0000000 --- a/docs/models/operations/getlibraryitemsimage.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsImage - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | -| `Type` | [operations.GetLibraryItemsLibraryResponseType](../../models/operations/getlibraryitemslibraryresponsetype.md) | :heavy_check_mark: | N/A | background | -| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemslibraryoptimizedforstreaming.md b/docs/models/operations/getlibraryitemslibraryoptimizedforstreaming.md deleted file mode 100644 index 3b6e80d..0000000 --- a/docs/models/operations/getlibraryitemslibraryoptimizedforstreaming.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetLibraryItemsLibraryOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - - -## Supported Types - -### GetLibraryItemsOptimizedForStreaming1 - -```go -getLibraryItemsLibraryOptimizedForStreaming := operations.CreateGetLibraryItemsLibraryOptimizedForStreamingGetLibraryItemsOptimizedForStreaming1(operations.GetLibraryItemsOptimizedForStreaming1{/* values here */}) -``` - -### - -```go -getLibraryItemsLibraryOptimizedForStreaming := operations.CreateGetLibraryItemsLibraryOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getlibraryitemslibraryresponsetype.md b/docs/models/operations/getlibraryitemslibraryresponsetype.md deleted file mode 100644 index 86d74be..0000000 --- a/docs/models/operations/getlibraryitemslibraryresponsetype.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryItemsLibraryResponseType - - -## Values - -| Name | Value | -| ----------------------------------------------- | ----------------------------------------------- | -| `GetLibraryItemsLibraryResponseTypeCoverPoster` | coverPoster | -| `GetLibraryItemsLibraryResponseTypeBackground` | background | -| `GetLibraryItemsLibraryResponseTypeSnapshot` | snapshot | -| `GetLibraryItemsLibraryResponseTypeClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemslibrarytype.md b/docs/models/operations/getlibraryitemslibrarytype.md deleted file mode 100644 index 3f121aa..0000000 --- a/docs/models/operations/getlibraryitemslibrarytype.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetLibraryItemsLibraryType - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | -| `Type` | *string* | :heavy_check_mark: | N/A | show | -| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows | -| `Active` | *bool* | :heavy_check_mark: | N/A | false | -| `Filter` | [][operations.GetLibraryItemsFilter](../../models/operations/getlibraryitemsfilter.md) | :heavy_minus_sign: | N/A | | -| `Sort` | [][operations.GetLibraryItemsSort](../../models/operations/getlibraryitemssort.md) | :heavy_minus_sign: | N/A | | -| `Field` | [][operations.GetLibraryItemsField](../../models/operations/getlibraryitemsfield.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemslocation.md b/docs/models/operations/getlibraryitemslocation.md deleted file mode 100644 index 9c290c9..0000000 --- a/docs/models/operations/getlibraryitemslocation.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsLocation - -The folder path for the media item. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `Path` | *string* | :heavy_check_mark: | N/A | /TV Shows/Clarkson's Farm | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsmedia.md b/docs/models/operations/getlibraryitemsmedia.md deleted file mode 100644 index 587665d..0000000 --- a/docs/models/operations/getlibraryitemsmedia.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetLibraryItemsMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 | -| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 | -| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 | -| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 | -| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 | -| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 | -| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | aac | -| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc | -| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k | -| `Container` | **string* | :heavy_minus_sign: | Container format of the media. | mp4 | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p
| 24p | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 | -| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | Indicates whether voice activity is detected. | false | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `OptimizedForStreaming` | [*operations.GetLibraryItemsOptimizedForStreaming](../../models/operations/getlibraryitemsoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | Indicates whether the media has 64-bit offsets.
This is relevant for media files that may require larger offsets than what 32-bit integers can provide.
| false | -| `Part` | [][operations.GetLibraryItemsPart](../../models/operations/getlibraryitemspart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsmediacontainer.md b/docs/models/operations/getlibraryitemsmediacontainer.md deleted file mode 100644 index a712543..0000000 --- a/docs/models/operations/getlibraryitemsmediacontainer.md +++ /dev/null @@ -1,28 +0,0 @@ -# GetLibraryItemsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `TotalSize` | *int* | :heavy_check_mark: | Total number of media items in the library. | 50 | -| `Offset` | *int64* | :heavy_check_mark: | Offset value for pagination. | 0 | -| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The unique identifier for the library section. | 2 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | TV Series | -| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | The universally unique identifier for the library section. | e69655a2-ef48-4aba-bb19-0cc34d1e7d36 | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series | -| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor | -| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary | -| `ViewMode` | **string* | :heavy_minus_sign: | Identifier for the view mode. | 131131 | -| `MixedParents` | **bool* | :heavy_minus_sign: | Indicates if the media container has mixed parents. | true | -| `Metadata` | [][operations.GetLibraryItemsMetadata](../../models/operations/getlibraryitemsmetadata.md) | :heavy_check_mark: | An array of metadata items. | | -| `Meta` | [*operations.GetLibraryItemsMeta](../../models/operations/getlibraryitemsmeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsmeta.md b/docs/models/operations/getlibraryitemsmeta.md deleted file mode 100644 index 890f158..0000000 --- a/docs/models/operations/getlibraryitemsmeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryItemsMeta - -The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Type` | [][operations.GetLibraryItemsLibraryType](../../models/operations/getlibraryitemslibrarytype.md) | :heavy_minus_sign: | N/A | -| `FieldType` | [][operations.GetLibraryItemsFieldType](../../models/operations/getlibraryitemsfieldtype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsmetadata.md b/docs/models/operations/getlibraryitemsmetadata.md deleted file mode 100644 index 48485bb..0000000 --- a/docs/models/operations/getlibraryitemsmetadata.md +++ /dev/null @@ -1,88 +0,0 @@ -# GetLibraryItemsMetadata - -Unknown - - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 | -| `Key` | *string* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 | -| `GUID` | *string* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 | -| `Slug` | *string* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas | -| `Studio` | **string* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios | -| `Type` | [operations.GetLibraryItemsType](../../models/operations/getlibraryitemstype.md) | :heavy_check_mark: | N/A | movie | -| `Title` | *string* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water | -| `Banner` | *string* | :heavy_check_mark: | The banner image URL for the media item. | /library/metadata/58683/banner/1703239236 | -| `TitleSort` | *string* | :heavy_check_mark: | The sort title used for ordering media items. | Whale | -| `ContentRating` | **string* | :heavy_minus_sign: | The content rating for the media item. | PG-13 | -| `Summary` | *string* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.
Once a familiar threat returns to finish what was previously started, Jake must
work with Neytiri and the army of the Na'vi race to protect their home.
| -| `Rating` | *float32* | :heavy_check_mark: | The critic rating for the media item. | 7.6 | -| `AudienceRating` | *float64* | :heavy_check_mark: | The audience rating for the media item. | 9.2 | -| `Year` | **int* | :heavy_minus_sign: | The release year of the media item. | 2022 | -| `Tagline` | *string* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. | -| `Thumb` | *string* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 | -| `Art` | *string* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 | -| `Theme` | *string* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 | -| `Index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 | -| `LeafCount` | **int* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 | -| `ChildCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 | -| `SeasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 | -| `Duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | The original release date of the media item. | 2022-12-14 | -| `AddedAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright | -| `ChapterSource` | **string* | :heavy_minus_sign: | The source from which chapter data is derived. | media | -| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 | -| `OriginalTitle` | **string* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent media item. | 66 | -| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 | -| `ParentGUID` | **string* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentGUID` | **string* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentSlug` | **string* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 | -| `ParentKey` | **string* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 | -| `GrandparentTheme` | **string* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 | -| `ParentTitle` | **string* | :heavy_minus_sign: | The title of the parent media item. | Caprica | -| `ParentIndex` | **int* | :heavy_minus_sign: | The index position of the parent media item. | 1 | -| `ParentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 | -| `RatingImage` | **string* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe | -| `ViewCount` | **int* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 | -| `ViewOffset` | **int* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 | -| `SkipCount` | **int* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 | -| `Subtype` | **string* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip | -| `LastRatedAt` | **int64* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 | -| `CreatedAtAccuracy` | **string* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local | -| `CreatedAtTZOffset` | **string* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 | -| `UserRating` | **float32* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 | -| `Image` | [][operations.GetLibraryItemsImage](../../models/operations/getlibraryitemsimage.md) | :heavy_minus_sign: | N/A | | -| `UltraBlurColors` | [*operations.GetLibraryItemsUltraBlurColors](../../models/operations/getlibraryitemsultrablurcolors.md) | :heavy_minus_sign: | N/A | | -| `Guids` | [][operations.GetLibraryItemsGuids](../../models/operations/getlibraryitemsguids.md) | :heavy_minus_sign: | N/A | | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The identifier for the library section. | 1 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | Movies | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | The key corresponding to the library section. | /library/sections/1 | -| `ShowOrdering` | [*operations.ShowOrdering](../../models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show.
Options:
- None = Library default
- tmdbAiring = The Movie Database (Aired)
- aired = TheTVDB (Aired)
- dvd = TheTVDB (DVD)
- absolute = TheTVDB (Absolute)
| absolute | -| `FlattenSeasons` | [*operations.FlattenSeasons](../../models/operations/flattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
| 1 | -| `SkipChildren` | **bool* | :heavy_minus_sign: | Indicates whether child items should be skipped. | false | -| `Media` | [][operations.GetLibraryItemsMedia](../../models/operations/getlibraryitemsmedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetLibraryItemsGenre](../../models/operations/getlibraryitemsgenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetLibraryItemsCountry](../../models/operations/getlibraryitemscountry.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetLibraryItemsDirector](../../models/operations/getlibraryitemsdirector.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetLibraryItemsWriter](../../models/operations/getlibraryitemswriter.md) | :heavy_minus_sign: | N/A | | -| `Producer` | [][operations.GetLibraryItemsProducer](../../models/operations/getlibraryitemsproducer.md) | :heavy_minus_sign: | N/A | | -| `Collection` | [][operations.GetLibraryItemsCollection](../../models/operations/getlibraryitemscollection.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetLibraryItemsRole](../../models/operations/getlibraryitemsrole.md) | :heavy_minus_sign: | N/A | | -| `Ratings` | [][operations.Ratings](../../models/operations/ratings.md) | :heavy_minus_sign: | N/A | | -| `Similar` | [][operations.GetLibraryItemsSimilar](../../models/operations/getlibraryitemssimilar.md) | :heavy_minus_sign: | N/A | | -| `Location` | [][operations.GetLibraryItemsLocation](../../models/operations/getlibraryitemslocation.md) | :heavy_minus_sign: | N/A | | -| `Chapter` | [][operations.Chapter](../../models/operations/chapter.md) | :heavy_minus_sign: | N/A | | -| `Marker` | [][operations.Marker](../../models/operations/marker.md) | :heavy_minus_sign: | N/A | | -| `Extras` | [*operations.Extras](../../models/operations/extras.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsoperator.md b/docs/models/operations/getlibraryitemsoperator.md deleted file mode 100644 index 58c7b30..0000000 --- a/docs/models/operations/getlibraryitemsoperator.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryItemsOperator - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | = | -| `Title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsoptimizedforstreaming.md b/docs/models/operations/getlibraryitemsoptimizedforstreaming.md deleted file mode 100644 index 4e3400f..0000000 --- a/docs/models/operations/getlibraryitemsoptimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetLibraryItemsOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### OptimizedForStreaming1 - -```go -getLibraryItemsOptimizedForStreaming := operations.CreateGetLibraryItemsOptimizedForStreamingOptimizedForStreaming1(operations.OptimizedForStreaming1{/* values here */}) -``` - -### - -```go -getLibraryItemsOptimizedForStreaming := operations.CreateGetLibraryItemsOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getlibraryitemsoptimizedforstreaming1.md b/docs/models/operations/getlibraryitemsoptimizedforstreaming1.md deleted file mode 100644 index 1effe8b..0000000 --- a/docs/models/operations/getlibraryitemsoptimizedforstreaming1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibraryItemsOptimizedForStreaming1 - - -## Values - -| Name | Value | -| ------------------------------------------- | ------------------------------------------- | -| `GetLibraryItemsOptimizedForStreaming1Zero` | 0 | -| `GetLibraryItemsOptimizedForStreaming1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemspart.md b/docs/models/operations/getlibraryitemspart.md deleted file mode 100644 index b1d6ac6..0000000 --- a/docs/models/operations/getlibraryitemspart.md +++ /dev/null @@ -1,22 +0,0 @@ -# GetLibraryItemsPart - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true | -| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true | -| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 | -| `Key` | **string* | :heavy_minus_sign: | Key to access this part. | /library/parts/418385/1735864239/file.mkv | -| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 | -| `File` | **string* | :heavy_minus_sign: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv | -| `Size` | **int64* | :heavy_minus_sign: | File size in bytes. | 30649952104 | -| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 | -| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | [*operations.GetLibraryItemsLibraryOptimizedForStreaming](../../models/operations/getlibraryitemslibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
| | -| `HasThumbnail` | [*operations.GetLibraryItemsHasThumbnail](../../models/operations/getlibraryitemshasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsproducer.md b/docs/models/operations/getlibraryitemsproducer.md deleted file mode 100644 index a772c85..0000000 --- a/docs/models/operations/getlibraryitemsproducer.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetLibraryItemsProducer - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | The unique role identifier. | 109501 | -| `Filter` | *string* | :heavy_check_mark: | The filter string for the role. | actor=109501 | -| `Tag` | *string* | :heavy_check_mark: | The actor's name. | Bob Odenkirk | -| `TagKey` | *string* | :heavy_check_mark: | A key associated with the actor tag. | 5d77683254f42c001f8c3f69 | -| `Role` | **string* | :heavy_minus_sign: | The character name or role. | Jimmy McGill | -| `Thumb` | **string* | :heavy_minus_sign: | URL for the role thumbnail image. | https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsqueryparamincludemeta.md b/docs/models/operations/getlibraryitemsqueryparamincludemeta.md deleted file mode 100644 index 518372b..0000000 --- a/docs/models/operations/getlibraryitemsqueryparamincludemeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibraryItemsQueryParamIncludeMeta - -Adds the Meta object to the response - - - -## Values - -| Name | Value | -| --------------------------------------------- | --------------------------------------------- | -| `GetLibraryItemsQueryParamIncludeMetaDisable` | 0 | -| `GetLibraryItemsQueryParamIncludeMetaEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsqueryparamtype.md b/docs/models/operations/getlibraryitemsqueryparamtype.md deleted file mode 100644 index 60d1cc2..0000000 --- a/docs/models/operations/getlibraryitemsqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetLibraryItemsQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| ----------------------------------------- | ----------------------------------------- | -| `GetLibraryItemsQueryParamTypeMovie` | 1 | -| `GetLibraryItemsQueryParamTypeTvShow` | 2 | -| `GetLibraryItemsQueryParamTypeSeason` | 3 | -| `GetLibraryItemsQueryParamTypeEpisode` | 4 | -| `GetLibraryItemsQueryParamTypeArtist` | 5 | -| `GetLibraryItemsQueryParamTypeAlbum` | 6 | -| `GetLibraryItemsQueryParamTypeTrack` | 7 | -| `GetLibraryItemsQueryParamTypePhotoAlbum` | 8 | -| `GetLibraryItemsQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsrequest.md b/docs/models/operations/getlibraryitemsrequest.md index e77d760..aec9ce1 100644 --- a/docs/models/operations/getlibraryitemsrequest.md +++ b/docs/models/operations/getlibraryitemsrequest.md @@ -3,12 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | -| `IncludeGuids` | [*operations.IncludeGuids](../../models/operations/includeguids.md) | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | -| `Type` | [operations.GetLibraryItemsQueryParamType](../../models/operations/getlibraryitemsqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `IncludeMeta` | [*operations.GetLibraryItemsQueryParamIncludeMeta](../../models/operations/getlibraryitemsqueryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | -| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | -| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsresponse.md b/docs/models/operations/getlibraryitemsresponse.md index bfc4c0e..042303a 100644 --- a/docs/models/operations/getlibraryitemsresponse.md +++ b/docs/models/operations/getlibraryitemsresponse.md @@ -3,9 +3,10 @@ ## 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.GetLibraryItemsResponseBody](../../models/operations/getlibraryitemsresponsebody.md) | :heavy_minus_sign: | The contents of the library by section and tag | \ No newline at end of file +| 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsresponsebody.md b/docs/models/operations/getlibraryitemsresponsebody.md deleted file mode 100644 index 8c8b465..0000000 --- a/docs/models/operations/getlibraryitemsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsResponseBody - -The contents of the library by section and tag - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetLibraryItemsMediaContainer](../../models/operations/getlibraryitemsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsrole.md b/docs/models/operations/getlibraryitemsrole.md deleted file mode 100644 index a5a33d6..0000000 --- a/docs/models/operations/getlibraryitemsrole.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryItemsRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the role.
NOTE: This is different for each Plex server and is not globally unique.
| 126522 | -| `Tag` | *string* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller | -| `Role` | **string* | :heavy_minus_sign: | The role played by the actor in the media item. | Self - Judge | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the actor. | https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemssimilar.md b/docs/models/operations/getlibraryitemssimilar.md deleted file mode 100644 index 80f4f22..0000000 --- a/docs/models/operations/getlibraryitemssimilar.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsSimilar - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | The unique similar item identifier. | 26 | -| `Filter` | *string* | :heavy_check_mark: | The filter string for similar items. | similar=26 | -| `Tag` | *string* | :heavy_check_mark: | The tag or title of the similar content. | Breaking Bad | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemssort.md b/docs/models/operations/getlibraryitemssort.md deleted file mode 100644 index b4e2db2..0000000 --- a/docs/models/operations/getlibraryitemssort.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetLibraryItemsSort - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `Default` | **string* | :heavy_minus_sign: | N/A | asc | -| `Active` | **bool* | :heavy_minus_sign: | N/A | false | -| `ActiveDirection` | [*operations.GetLibraryItemsActiveDirection](../../models/operations/getlibraryitemsactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DefaultDirection` | [*operations.GetLibraryItemsDefaultDirection](../../models/operations/getlibraryitemsdefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc | -| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | -| `Key` | *string* | :heavy_check_mark: | N/A | titleSort | -| `Title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemstype.md b/docs/models/operations/getlibraryitemstype.md deleted file mode 100644 index bf0fed4..0000000 --- a/docs/models/operations/getlibraryitemstype.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetLibraryItemsType - -The type of media content in the Plex library. This can represent videos, music, or photos. - - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `GetLibraryItemsTypeMovie` | movie | -| `GetLibraryItemsTypeTvShow` | show | -| `GetLibraryItemsTypeSeason` | season | -| `GetLibraryItemsTypeEpisode` | episode | -| `GetLibraryItemsTypeArtist` | artist | -| `GetLibraryItemsTypeAlbum` | album | -| `GetLibraryItemsTypeTrack` | track | -| `GetLibraryItemsTypePhotoAlbum` | photoalbum | -| `GetLibraryItemsTypePhoto` | photo | -| `GetLibraryItemsTypeCollection` | collection | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsultrablurcolors.md b/docs/models/operations/getlibraryitemsultrablurcolors.md deleted file mode 100644 index 88376a4..0000000 --- a/docs/models/operations/getlibraryitemsultrablurcolors.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryItemsUltraBlurColors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `TopLeft` | *string* | :heavy_check_mark: | N/A | 11333b | -| `TopRight` | *string* | :heavy_check_mark: | N/A | 0a232d | -| `BottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | -| `BottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemswriter.md b/docs/models/operations/getlibraryitemswriter.md deleted file mode 100644 index 4d8912d..0000000 --- a/docs/models/operations/getlibraryitemswriter.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsWriter - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the writer. | 126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the writer. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/operations/getlibrarymatchesglobals.md b/docs/models/operations/getlibrarymatchesglobals.md new file mode 100644 index 0000000..2cfac41 --- /dev/null +++ b/docs/models/operations/getlibrarymatchesglobals.md @@ -0,0 +1,18 @@ +# GetLibraryMatchesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getlibrarymatchesrequest.md b/docs/models/operations/getlibrarymatchesrequest.md new file mode 100644 index 0000000..5e6a660 --- /dev/null +++ b/docs/models/operations/getlibrarymatchesrequest.md @@ -0,0 +1,32 @@ +# GetLibraryMatchesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type to filter by | | +| `IncludeFullMetadata` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | +| `IncludeAncestorMetadata` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | +| `IncludeAlternateMetadataSources` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | +| `GUID` | **string* | :heavy_minus_sign: | Used for movies, shows, artists, albums, and tracks. Allowed for various URI schemes, to be defined. | | +| `Title` | **string* | :heavy_minus_sign: | The title to filter by or assign | | +| `Year` | **int64* | :heavy_minus_sign: | Used for movies shows, and albums. Optional. | | +| `Path` | **string* | :heavy_minus_sign: | Used for movies, episodes, and tracks. The full path to the media file, used for "cloud-scanning" an item. | | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | Used for episodes and tracks. The title of the show/artist. Required if `path` isn't passed. | | +| `GrandparentYear` | **int64* | :heavy_minus_sign: | Used for episodes. The year of the show. | | +| `ParentIndex` | **int64* | :heavy_minus_sign: | Used for episodes and tracks. The season/album number. | | +| `Index` | **int64* | :heavy_minus_sign: | Used for episodes and tracks. The episode/tracks number in the season/album. | | +| `OriginallyAvailableAt` | **string* | :heavy_minus_sign: | Used for episodes. In the format `YYYY-MM-DD`. | | +| `ParentTitle` | **string* | :heavy_minus_sign: | Used for albums and tracks. The artist name for albums or the album name for tracks. | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarymatchesresponse.md b/docs/models/operations/getlibrarymatchesresponse.md new file mode 100644 index 0000000..1256db3 --- /dev/null +++ b/docs/models/operations/getlibrarymatchesresponse.md @@ -0,0 +1,12 @@ +# GetLibraryMatchesResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallactivedirection.md b/docs/models/operations/getlibrarysectionsallactivedirection.md deleted file mode 100644 index 6b8914c..0000000 --- a/docs/models/operations/getlibrarysectionsallactivedirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibrarySectionsAllActiveDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| ------------------------------------------------ | ------------------------------------------------ | -| `GetLibrarySectionsAllActiveDirectionAscending` | asc | -| `GetLibrarySectionsAllActiveDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallcollection.md b/docs/models/operations/getlibrarysectionsallcollection.md deleted file mode 100644 index 6a5ba61..0000000 --- a/docs/models/operations/getlibrarysectionsallcollection.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllCollection - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallcountry.md b/docs/models/operations/getlibrarysectionsallcountry.md deleted file mode 100644 index 8f7c182..0000000 --- a/docs/models/operations/getlibrarysectionsallcountry.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllCountry - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalldefaultdirection.md b/docs/models/operations/getlibrarysectionsalldefaultdirection.md deleted file mode 100644 index 0f966f0..0000000 --- a/docs/models/operations/getlibrarysectionsalldefaultdirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibrarySectionsAllDefaultDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| ------------------------------------------------- | ------------------------------------------------- | -| `GetLibrarySectionsAllDefaultDirectionAscending` | asc | -| `GetLibrarySectionsAllDefaultDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalldirector.md b/docs/models/operations/getlibrarysectionsalldirector.md deleted file mode 100644 index 734b296..0000000 --- a/docs/models/operations/getlibrarysectionsalldirector.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllDirector - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallfield.md b/docs/models/operations/getlibrarysectionsallfield.md deleted file mode 100644 index 859db65..0000000 --- a/docs/models/operations/getlibrarysectionsallfield.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllField - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | show.title | -| `Title` | *string* | :heavy_check_mark: | N/A | Show Title | -| `Type` | *string* | :heavy_check_mark: | N/A | string | -| `SubType` | **string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallfieldtype.md b/docs/models/operations/getlibrarysectionsallfieldtype.md deleted file mode 100644 index 24b5001..0000000 --- a/docs/models/operations/getlibrarysectionsallfieldtype.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibrarySectionsAllFieldType - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `Type` | *string* | :heavy_check_mark: | N/A | tag | -| `Operator` | [][operations.GetLibrarySectionsAllOperator](../../models/operations/getlibrarysectionsalloperator.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallfilter.md b/docs/models/operations/getlibrarysectionsallfilter.md deleted file mode 100644 index 5f26bef..0000000 --- a/docs/models/operations/getlibrarysectionsallfilter.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetLibrarySectionsAllFilter - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `Filter` | *string* | :heavy_check_mark: | N/A | genre | -| `FilterType` | *string* | :heavy_check_mark: | N/A | string | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | -| `Title` | *string* | :heavy_check_mark: | N/A | Genre | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | -| `Advanced` | **bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallgenre.md b/docs/models/operations/getlibrarysectionsallgenre.md deleted file mode 100644 index 8e47801..0000000 --- a/docs/models/operations/getlibrarysectionsallgenre.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllGenre - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item
| Crime | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallguids.md b/docs/models/operations/getlibrarysectionsallguids.md deleted file mode 100644 index 8eb152c..0000000 --- a/docs/models/operations/getlibrarysectionsallguids.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllGuids - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
| {
"imdbExample": {
"summary": "IMDB example",
"value": "imdb://tt13015952"
},
"tmdbExample": {
"summary": "TMDB example",
"value": "tmdb://2434012"
},
"tvdbExample": {
"summary": "TVDB example",
"value": "tvdb://7945991"
}
} | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallhasthumbnail.md b/docs/models/operations/getlibrarysectionsallhasthumbnail.md deleted file mode 100644 index 1ab3032..0000000 --- a/docs/models/operations/getlibrarysectionsallhasthumbnail.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllHasThumbnail - -Indicates if the part has a thumbnail. - - -## Values - -| Name | Value | -| ---------------------------------------- | ---------------------------------------- | -| `GetLibrarySectionsAllHasThumbnailFalse` | 0 | -| `GetLibrarySectionsAllHasThumbnailTrue` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallimage.md b/docs/models/operations/getlibrarysectionsallimage.md deleted file mode 100644 index e09cd30..0000000 --- a/docs/models/operations/getlibrarysectionsallimage.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibrarySectionsAllImage - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | -| `Type` | [operations.GetLibrarySectionsAllLibraryResponseType](../../models/operations/getlibrarysectionsalllibraryresponsetype.md) | :heavy_check_mark: | N/A | background | -| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalllibraryoptimizedforstreaming.md b/docs/models/operations/getlibrarysectionsalllibraryoptimizedforstreaming.md deleted file mode 100644 index 524b0a2..0000000 --- a/docs/models/operations/getlibrarysectionsalllibraryoptimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetLibrarySectionsAllLibraryOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### GetLibrarySectionsAllOptimizedForStreamingLibrary1 - -```go -getLibrarySectionsAllLibraryOptimizedForStreaming := operations.CreateGetLibrarySectionsAllLibraryOptimizedForStreamingGetLibrarySectionsAllOptimizedForStreamingLibrary1(operations.GetLibrarySectionsAllOptimizedForStreamingLibrary1{/* values here */}) -``` - -### - -```go -getLibrarySectionsAllLibraryOptimizedForStreaming := operations.CreateGetLibrarySectionsAllLibraryOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getlibrarysectionsalllibraryresponsetype.md b/docs/models/operations/getlibrarysectionsalllibraryresponsetype.md deleted file mode 100644 index ab34bc2..0000000 --- a/docs/models/operations/getlibrarysectionsalllibraryresponsetype.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllLibraryResponseType - - -## Values - -| Name | Value | -| ----------------------------------------------------- | ----------------------------------------------------- | -| `GetLibrarySectionsAllLibraryResponseTypeCoverPoster` | coverPoster | -| `GetLibrarySectionsAllLibraryResponseTypeBackground` | background | -| `GetLibrarySectionsAllLibraryResponseTypeSnapshot` | snapshot | -| `GetLibrarySectionsAllLibraryResponseTypeClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalllibrarytype.md b/docs/models/operations/getlibrarysectionsalllibrarytype.md deleted file mode 100644 index f2a7de2..0000000 --- a/docs/models/operations/getlibrarysectionsalllibrarytype.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetLibrarySectionsAllLibraryType - -The type of media content in the Plex library. This can represent videos, music, or photos. - - - -## Values - -| Name | Value | -| -------------------------------------------- | -------------------------------------------- | -| `GetLibrarySectionsAllLibraryTypeMovie` | movie | -| `GetLibrarySectionsAllLibraryTypeTvShow` | show | -| `GetLibrarySectionsAllLibraryTypeSeason` | season | -| `GetLibrarySectionsAllLibraryTypeEpisode` | episode | -| `GetLibrarySectionsAllLibraryTypeArtist` | artist | -| `GetLibrarySectionsAllLibraryTypeAlbum` | album | -| `GetLibrarySectionsAllLibraryTypeTrack` | track | -| `GetLibrarySectionsAllLibraryTypePhotoAlbum` | photoalbum | -| `GetLibrarySectionsAllLibraryTypePhoto` | photo | -| `GetLibrarySectionsAllLibraryTypeCollection` | collection | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallmedia.md b/docs/models/operations/getlibrarysectionsallmedia.md deleted file mode 100644 index 36886d2..0000000 --- a/docs/models/operations/getlibrarysectionsallmedia.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetLibrarySectionsAllMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 | -| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 | -| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 | -| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 | -| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 | -| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 | -| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | eac3 | -| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc | -| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k | -| `Container` | **string* | :heavy_minus_sign: | File container type. | mkv | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p
| 24p | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 | -| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | Indicates whether voice activity is detected. | false | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `OptimizedForStreaming` | [*operations.GetLibrarySectionsAllOptimizedForStreaming](../../models/operations/getlibrarysectionsalloptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `Part` | [][operations.GetLibrarySectionsAllPart](../../models/operations/getlibrarysectionsallpart.md) | :heavy_minus_sign: | An array of parts for this media item. | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallmediacontainer.md b/docs/models/operations/getlibrarysectionsallmediacontainer.md deleted file mode 100644 index 0faed16..0000000 --- a/docs/models/operations/getlibrarysectionsallmediacontainer.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetLibrarySectionsAllMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `TotalSize` | *int* | :heavy_check_mark: | Total number of media items in the library. | 50 | -| `Offset` | *int64* | :heavy_check_mark: | Offset value for pagination. | 0 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The unique identifier for the library section. | 2 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | TV Series | -| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | The universally unique identifier for the library section. | e69655a2-ef48-4aba-bb19-0cc34d1e7d36 | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true | -| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series | -| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor | -| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary | -| `Meta` | [*operations.GetLibrarySectionsAllMeta](../../models/operations/getlibrarysectionsallmeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | -| `Metadata` | [][operations.GetLibrarySectionsAllMetadata](../../models/operations/getlibrarysectionsallmetadata.md) | :heavy_minus_sign: | An array of metadata items. | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallmeta.md b/docs/models/operations/getlibrarysectionsallmeta.md deleted file mode 100644 index 03f64f7..0000000 --- a/docs/models/operations/getlibrarysectionsallmeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibrarySectionsAllMeta - -The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `Type` | [][operations.GetLibrarySectionsAllType](../../models/operations/getlibrarysectionsalltype.md) | :heavy_minus_sign: | N/A | -| `FieldType` | [][operations.GetLibrarySectionsAllFieldType](../../models/operations/getlibrarysectionsallfieldtype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallmetadata.md b/docs/models/operations/getlibrarysectionsallmetadata.md deleted file mode 100644 index ba102f7..0000000 --- a/docs/models/operations/getlibrarysectionsallmetadata.md +++ /dev/null @@ -1,74 +0,0 @@ -# GetLibrarySectionsAllMetadata - -Unknown - - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 | -| `Key` | *string* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 | -| `GUID` | *string* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 | -| `Slug` | *string* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas | -| `Studio` | **string* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios | -| `Type` | [operations.GetLibrarySectionsAllLibraryType](../../models/operations/getlibrarysectionsalllibrarytype.md) | :heavy_check_mark: | N/A | movie | -| `Title` | *string* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water | -| `TitleSort` | *string* | :heavy_check_mark: | The sort title used for ordering media items. | Whale | -| `ContentRating` | **string* | :heavy_minus_sign: | The content rating for the media item. | PG-13 | -| `Summary` | *string* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.
Once a familiar threat returns to finish what was previously started, Jake must
work with Neytiri and the army of the Na'vi race to protect their home.
| -| `Rating` | *float32* | :heavy_check_mark: | The critic rating for the media item. | 7.6 | -| `AudienceRating` | *float64* | :heavy_check_mark: | The audience rating for the media item. | 9.2 | -| `Year` | **int* | :heavy_minus_sign: | The release year of the media item. | 2022 | -| `Tagline` | *string* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. | -| `Thumb` | *string* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 | -| `Art` | *string* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 | -| `Theme` | *string* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 | -| `Index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 | -| `LeafCount` | **int* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 | -| `ChildCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 | -| `SeasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 | -| `Duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | The original release date of the media item. | 2022-12-14 | -| `AddedAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright | -| `ChapterSource` | **string* | :heavy_minus_sign: | The source from which chapter data is derived. | media | -| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 | -| `OriginalTitle` | **string* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent media item. | 66 | -| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 | -| `ParentGUID` | **string* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentGUID` | **string* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentSlug` | **string* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 | -| `ParentKey` | **string* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 | -| `GrandparentTheme` | **string* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 | -| `ParentTitle` | **string* | :heavy_minus_sign: | The title of the parent media item. | Caprica | -| `ParentIndex` | **int* | :heavy_minus_sign: | The index position of the parent media item. | 1 | -| `ParentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 | -| `RatingImage` | **string* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe | -| `ViewCount` | **int* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 | -| `ViewOffset` | **int* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 | -| `SkipCount` | **int* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 | -| `Subtype` | **string* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip | -| `LastRatedAt` | **int64* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 | -| `CreatedAtAccuracy` | **string* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local | -| `CreatedAtTZOffset` | **string* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 | -| `UserRating` | **float32* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 | -| `Image` | [][operations.GetLibrarySectionsAllImage](../../models/operations/getlibrarysectionsallimage.md) | :heavy_minus_sign: | N/A | | -| `UltraBlurColors` | [*operations.GetLibrarySectionsAllUltraBlurColors](../../models/operations/getlibrarysectionsallultrablurcolors.md) | :heavy_minus_sign: | N/A | | -| `Guids` | [][operations.GetLibrarySectionsAllGuids](../../models/operations/getlibrarysectionsallguids.md) | :heavy_minus_sign: | N/A | | -| `Media` | [][operations.GetLibrarySectionsAllMedia](../../models/operations/getlibrarysectionsallmedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetLibrarySectionsAllGenre](../../models/operations/getlibrarysectionsallgenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetLibrarySectionsAllCountry](../../models/operations/getlibrarysectionsallcountry.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetLibrarySectionsAllDirector](../../models/operations/getlibrarysectionsalldirector.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetLibrarySectionsAllWriter](../../models/operations/getlibrarysectionsallwriter.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetLibrarySectionsAllRole](../../models/operations/getlibrarysectionsallrole.md) | :heavy_minus_sign: | N/A | | -| `Collection` | [][operations.GetLibrarySectionsAllCollection](../../models/operations/getlibrarysectionsallcollection.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalloperator.md b/docs/models/operations/getlibrarysectionsalloperator.md deleted file mode 100644 index 36d9bad..0000000 --- a/docs/models/operations/getlibrarysectionsalloperator.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibrarySectionsAllOperator - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | = | -| `Title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalloptimizedforstreaming.md b/docs/models/operations/getlibrarysectionsalloptimizedforstreaming.md deleted file mode 100644 index 63c8042..0000000 --- a/docs/models/operations/getlibrarysectionsalloptimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetLibrarySectionsAllOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### GetLibrarySectionsAllOptimizedForStreaming1 - -```go -getLibrarySectionsAllOptimizedForStreaming := operations.CreateGetLibrarySectionsAllOptimizedForStreamingGetLibrarySectionsAllOptimizedForStreaming1(operations.GetLibrarySectionsAllOptimizedForStreaming1{/* values here */}) -``` - -### - -```go -getLibrarySectionsAllOptimizedForStreaming := operations.CreateGetLibrarySectionsAllOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getlibrarysectionsalloptimizedforstreaming1.md b/docs/models/operations/getlibrarysectionsalloptimizedforstreaming1.md deleted file mode 100644 index ef4e5e6..0000000 --- a/docs/models/operations/getlibrarysectionsalloptimizedforstreaming1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibrarySectionsAllOptimizedForStreaming1 - - -## Values - -| Name | Value | -| ------------------------------------------------- | ------------------------------------------------- | -| `GetLibrarySectionsAllOptimizedForStreaming1Zero` | 0 | -| `GetLibrarySectionsAllOptimizedForStreaming1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalloptimizedforstreaminglibrary1.md b/docs/models/operations/getlibrarysectionsalloptimizedforstreaminglibrary1.md deleted file mode 100644 index de5d4a0..0000000 --- a/docs/models/operations/getlibrarysectionsalloptimizedforstreaminglibrary1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetLibrarySectionsAllOptimizedForStreamingLibrary1 - - -## Values - -| Name | Value | -| -------------------------------------------------------- | -------------------------------------------------------- | -| `GetLibrarySectionsAllOptimizedForStreamingLibrary1Zero` | 0 | -| `GetLibrarySectionsAllOptimizedForStreamingLibrary1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallpart.md b/docs/models/operations/getlibrarysectionsallpart.md deleted file mode 100644 index 9c67c1c..0000000 --- a/docs/models/operations/getlibrarysectionsallpart.md +++ /dev/null @@ -1,23 +0,0 @@ -# GetLibrarySectionsAllPart - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true | -| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true | -| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 | -| `Key` | *string* | :heavy_check_mark: | Key to access this part. | /library/parts/418385/1735864239/file.mkv | -| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 | -| `File` | *string* | :heavy_check_mark: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv | -| `Size` | *int64* | :heavy_check_mark: | File size in bytes. | 30649952104 | -| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 | -| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | [*operations.GetLibrarySectionsAllLibraryOptimizedForStreaming](../../models/operations/getlibrarysectionsalllibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `HasThumbnail` | [*operations.GetLibrarySectionsAllHasThumbnail](../../models/operations/getlibrarysectionsallhasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | -| `Stream` | [][operations.GetLibrarySectionsAllStream](../../models/operations/getlibrarysectionsallstream.md) | :heavy_minus_sign: | An array of streams for this part. | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallqueryparamincludemeta.md b/docs/models/operations/getlibrarysectionsallqueryparamincludemeta.md deleted file mode 100644 index db650ef..0000000 --- a/docs/models/operations/getlibrarysectionsallqueryparamincludemeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetLibrarySectionsAllQueryParamIncludeMeta - -Adds the Meta object to the response - - - -## Values - -| Name | Value | -| --------------------------------------------------- | --------------------------------------------------- | -| `GetLibrarySectionsAllQueryParamIncludeMetaDisable` | 0 | -| `GetLibrarySectionsAllQueryParamIncludeMetaEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallqueryparamtype.md b/docs/models/operations/getlibrarysectionsallqueryparamtype.md deleted file mode 100644 index 0b765b1..0000000 --- a/docs/models/operations/getlibrarysectionsallqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetLibrarySectionsAllQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| ----------------------------------------------- | ----------------------------------------------- | -| `GetLibrarySectionsAllQueryParamTypeMovie` | 1 | -| `GetLibrarySectionsAllQueryParamTypeTvShow` | 2 | -| `GetLibrarySectionsAllQueryParamTypeSeason` | 3 | -| `GetLibrarySectionsAllQueryParamTypeEpisode` | 4 | -| `GetLibrarySectionsAllQueryParamTypeArtist` | 5 | -| `GetLibrarySectionsAllQueryParamTypeAlbum` | 6 | -| `GetLibrarySectionsAllQueryParamTypeTrack` | 7 | -| `GetLibrarySectionsAllQueryParamTypePhotoAlbum` | 8 | -| `GetLibrarySectionsAllQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallrequest.md b/docs/models/operations/getlibrarysectionsallrequest.md deleted file mode 100644 index f8a2b1f..0000000 --- a/docs/models/operations/getlibrarysectionsallrequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetLibrarySectionsAllRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `Type` | [operations.GetLibrarySectionsAllQueryParamType](../../models/operations/getlibrarysectionsallqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `IncludeMeta` | [*operations.GetLibrarySectionsAllQueryParamIncludeMeta](../../models/operations/getlibrarysectionsallqueryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | -| `IncludeGuids` | [*operations.QueryParamIncludeGuids](../../models/operations/queryparamincludeguids.md) | :heavy_minus_sign: | Adds the Guid object to the response
| 1 | -| `IncludeAdvanced` | [*operations.IncludeAdvanced](../../models/operations/includeadvanced.md) | :heavy_minus_sign: | N/A | 1 | -| `IncludeCollections` | [*operations.QueryParamIncludeCollections](../../models/operations/queryparamincludecollections.md) | :heavy_minus_sign: | N/A | 1 | -| `IncludeExternalMedia` | [*operations.QueryParamIncludeExternalMedia](../../models/operations/queryparamincludeexternalmedia.md) | :heavy_minus_sign: | N/A | 1 | -| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | -| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallresponse.md b/docs/models/operations/getlibrarysectionsallresponse.md deleted file mode 100644 index 706151c..0000000 --- a/docs/models/operations/getlibrarysectionsallresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllResponse - - -## 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.GetLibrarySectionsAllResponseBody](../../models/operations/getlibrarysectionsallresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallresponsebody.md b/docs/models/operations/getlibrarysectionsallresponsebody.md deleted file mode 100644 index 0e2c5dd..0000000 --- a/docs/models/operations/getlibrarysectionsallresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibrarySectionsAllResponseBody - -Successful response containing media container data. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetLibrarySectionsAllMediaContainer](../../models/operations/getlibrarysectionsallmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallrole.md b/docs/models/operations/getlibrarysectionsallrole.md deleted file mode 100644 index 10233d2..0000000 --- a/docs/models/operations/getlibrarysectionsallrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `Tag` | *string* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallsort.md b/docs/models/operations/getlibrarysectionsallsort.md deleted file mode 100644 index c31a464..0000000 --- a/docs/models/operations/getlibrarysectionsallsort.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetLibrarySectionsAllSort - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `Default` | **string* | :heavy_minus_sign: | N/A | asc | -| `Active` | **bool* | :heavy_minus_sign: | N/A | false | -| `ActiveDirection` | [*operations.GetLibrarySectionsAllActiveDirection](../../models/operations/getlibrarysectionsallactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DefaultDirection` | [*operations.GetLibrarySectionsAllDefaultDirection](../../models/operations/getlibrarysectionsalldefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc | -| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | -| `Key` | *string* | :heavy_check_mark: | N/A | titleSort | -| `Title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallstream.md b/docs/models/operations/getlibrarysectionsallstream.md deleted file mode 100644 index 016bde0..0000000 --- a/docs/models/operations/getlibrarysectionsallstream.md +++ /dev/null @@ -1,58 +0,0 @@ -# GetLibrarySectionsAllStream - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique stream identifier. | 1002625 | -| `StreamType` | *int64* | :heavy_check_mark: | Stream type:
- VIDEO = 1
- AUDIO = 2
- SUBTITLE = 3
| | -| `Format` | **string* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt | -| `Default` | **bool* | :heavy_minus_sign: | Indicates if this stream is default. | true | -| `Codec` | *string* | :heavy_check_mark: | Codec used by the stream. | hevc | -| `Index` | **int* | :heavy_minus_sign: | Index of the stream. | 0 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate of the stream. | 24743 | -| `Language` | **string* | :heavy_minus_sign: | Language of the stream. | English | -| `LanguageTag` | **string* | :heavy_minus_sign: | Language tag (e.g., en). | en | -| `LanguageCode` | **string* | :heavy_minus_sign: | ISO language code. | eng | -| `HeaderCompression` | **bool* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true | -| `DOVIBLCompatID` | **int* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 | -| `DOVIBLPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true | -| `DOVIELPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false | -| `DOVILevel` | **int* | :heavy_minus_sign: | Dolby Vision level. | 6 | -| `DOVIPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true | -| `DOVIProfile` | **int* | :heavy_minus_sign: | Dolby Vision profile. | 8 | -| `DOVIRPUPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true | -| `DOVIVersion` | **string* | :heavy_minus_sign: | Dolby Vision version. | 1.0 | -| `BitDepth` | **int* | :heavy_minus_sign: | Bit depth of the video stream. | 10 | -| `ChromaLocation` | **string* | :heavy_minus_sign: | Chroma sample location. | topleft | -| `ChromaSubsampling` | **string* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 | -| `CodedHeight` | **int* | :heavy_minus_sign: | Coded video height. | 1608 | -| `CodedWidth` | **int* | :heavy_minus_sign: | Coded video width. | 3840 | -| `ClosedCaptions` | **bool* | :heavy_minus_sign: | N/A | true | -| `ColorPrimaries` | **string* | :heavy_minus_sign: | Color primaries used. | bt2020 | -| `ColorRange` | **string* | :heavy_minus_sign: | Color range (e.g., tv). | tv | -| `ColorSpace` | **string* | :heavy_minus_sign: | Color space. | bt2020nc | -| `ColorTrc` | **string* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 | -| `FrameRate` | **float32* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 | -| `Key` | **string* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 | -| `Height` | **int* | :heavy_minus_sign: | Height of the video stream. | 1602 | -| `Level` | **int* | :heavy_minus_sign: | Video level. | 150 | -| `Original` | **bool* | :heavy_minus_sign: | Indicates if this is the original stream. | true | -| `HasScalingMatrix` | **bool* | :heavy_minus_sign: | N/A | false | -| `Profile` | **string* | :heavy_minus_sign: | Video profile. | main 10 | -| `ScanType` | **string* | :heavy_minus_sign: | N/A | progressive | -| `EmbeddedInVideo` | **string* | :heavy_minus_sign: | N/A | progressive | -| `RefFrames` | **int* | :heavy_minus_sign: | Number of reference frames. | 1 | -| `Width` | **int* | :heavy_minus_sign: | Width of the video stream. | 3840 | -| `DisplayTitle` | *string* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) | -| `ExtendedDisplayTitle` | *string* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) | -| `Selected` | **bool* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true | -| `Forced` | **bool* | :heavy_minus_sign: | N/A | true | -| `Channels` | **int* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 | -| `AudioChannelLayout` | **string* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) | -| `SamplingRate` | **int* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 | -| `CanAutoSync` | **bool* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false | -| `HearingImpaired` | **bool* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true | -| `Dub` | **bool* | :heavy_minus_sign: | Indicates if the stream is a dub. | true | -| `Title` | **string* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsalltype.md b/docs/models/operations/getlibrarysectionsalltype.md deleted file mode 100644 index cff2a03..0000000 --- a/docs/models/operations/getlibrarysectionsalltype.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetLibrarySectionsAllType - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | -| `Subtype` | **string* | :heavy_minus_sign: | N/A | clip | -| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows | -| `Active` | *bool* | :heavy_check_mark: | N/A | false | -| `Filter` | [][operations.GetLibrarySectionsAllFilter](../../models/operations/getlibrarysectionsallfilter.md) | :heavy_minus_sign: | N/A | | -| `Sort` | [][operations.GetLibrarySectionsAllSort](../../models/operations/getlibrarysectionsallsort.md) | :heavy_minus_sign: | N/A | | -| `Field` | [][operations.GetLibrarySectionsAllField](../../models/operations/getlibrarysectionsallfield.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallultrablurcolors.md b/docs/models/operations/getlibrarysectionsallultrablurcolors.md deleted file mode 100644 index ea42dca..0000000 --- a/docs/models/operations/getlibrarysectionsallultrablurcolors.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllUltraBlurColors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `TopLeft` | *string* | :heavy_check_mark: | N/A | 11333b | -| `TopRight` | *string* | :heavy_check_mark: | N/A | 0a232d | -| `BottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | -| `BottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/models/operations/getlibrarysectionsallwriter.md b/docs/models/operations/getlibrarysectionsallwriter.md deleted file mode 100644 index b7e940d..0000000 --- a/docs/models/operations/getlibrarysectionsallwriter.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetLibrarySectionsAllWriter - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | *string* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson | \ No newline at end of file diff --git a/docs/models/operations/getlineupchannelsglobals.md b/docs/models/operations/getlineupchannelsglobals.md new file mode 100644 index 0000000..7a8b2d6 --- /dev/null +++ b/docs/models/operations/getlineupchannelsglobals.md @@ -0,0 +1,18 @@ +# GetLineupChannelsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getlineupchannelsmediacontainer.md b/docs/models/operations/getlineupchannelsmediacontainer.md new file mode 100644 index 0000000..b72969f --- /dev/null +++ b/docs/models/operations/getlineupchannelsmediacontainer.md @@ -0,0 +1,17 @@ +# GetLineupChannelsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Lineup` | [][operations.Lineup](../../models/operations/lineup.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlineupchannelsrequest.md b/docs/models/operations/getlineupchannelsrequest.md new file mode 100644 index 0000000..5a8e3b2 --- /dev/null +++ b/docs/models/operations/getlineupchannelsrequest.md @@ -0,0 +1,19 @@ +# GetLineupChannelsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Lineup` | []*string* | :heavy_check_mark: | The URIs describing the lineups | | \ No newline at end of file diff --git a/docs/models/operations/getlineupchannelsresponse.md b/docs/models/operations/getlineupchannelsresponse.md new file mode 100644 index 0000000..4a3731d --- /dev/null +++ b/docs/models/operations/getlineupchannelsresponse.md @@ -0,0 +1,11 @@ +# GetLineupChannelsResponse + + +## 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.GetLineupChannelsResponseBody](../../models/operations/getlineupchannelsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getlineupchannelsresponsebody.md b/docs/models/operations/getlineupchannelsresponsebody.md new file mode 100644 index 0000000..447c787 --- /dev/null +++ b/docs/models/operations/getlineupchannelsresponsebody.md @@ -0,0 +1,10 @@ +# GetLineupChannelsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetLineupChannelsMediaContainer](../../models/operations/getlineupchannelsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlineupglobals.md b/docs/models/operations/getlineupglobals.md new file mode 100644 index 0000000..9f24f41 --- /dev/null +++ b/docs/models/operations/getlineupglobals.md @@ -0,0 +1,18 @@ +# GetLineupGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getlineuprequest.md b/docs/models/operations/getlineuprequest.md new file mode 100644 index 0000000..a1be1c5 --- /dev/null +++ b/docs/models/operations/getlineuprequest.md @@ -0,0 +1,20 @@ +# GetLineupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceQueryParameter` | *string* | :heavy_check_mark: | The URI describing the device | | +| `LineupGroup` | *string* | :heavy_check_mark: | The URI describing the lineupGroup | | \ No newline at end of file diff --git a/docs/models/operations/getlineupresponse.md b/docs/models/operations/getlineupresponse.md new file mode 100644 index 0000000..f75285d --- /dev/null +++ b/docs/models/operations/getlineupresponse.md @@ -0,0 +1,11 @@ +# GetLineupResponse + + +## 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 | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getlivetvsessionglobals.md b/docs/models/operations/getlivetvsessionglobals.md new file mode 100644 index 0000000..f57af42 --- /dev/null +++ b/docs/models/operations/getlivetvsessionglobals.md @@ -0,0 +1,18 @@ +# GetLiveTVSessionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getlivetvsessionrequest.md b/docs/models/operations/getlivetvsessionrequest.md new file mode 100644 index 0000000..2a2a0b5 --- /dev/null +++ b/docs/models/operations/getlivetvsessionrequest.md @@ -0,0 +1,19 @@ +# GetLiveTVSessionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SessionID` | *string* | :heavy_check_mark: | The session id | | \ No newline at end of file diff --git a/docs/models/operations/getlivetvsessionresponse.md b/docs/models/operations/getlivetvsessionresponse.md new file mode 100644 index 0000000..d91b195 --- /dev/null +++ b/docs/models/operations/getlivetvsessionresponse.md @@ -0,0 +1,12 @@ +# GetLiveTVSessionResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediaartsmediacontainer.md b/docs/models/operations/getmediaartsmediacontainer.md deleted file mode 100644 index 9111840..0000000 --- a/docs/models/operations/getmediaartsmediacontainer.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaArtsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `Metadata` | [][operations.GetMediaArtsMetadata](../../models/operations/getmediaartsmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getmediaartsmetadata.md b/docs/models/operations/getmediaartsmetadata.md deleted file mode 100644 index faec649..0000000 --- a/docs/models/operations/getmediaartsmetadata.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaArtsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg | -| `Provider` | **string* | :heavy_minus_sign: | The provider of the artwork. | tmdb | -| `RatingKey` | *string* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg | -| `Selected` | *bool* | :heavy_check_mark: | Whether this is the selected artwork. | true | -| `Thumb` | *string* | :heavy_check_mark: | The URL of the artwork thumbnail. | https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg | \ No newline at end of file diff --git a/docs/models/operations/getmediaartsrequest.md b/docs/models/operations/getmediaartsrequest.md deleted file mode 100644 index c578e45..0000000 --- a/docs/models/operations/getmediaartsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetMediaArtsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 | \ No newline at end of file diff --git a/docs/models/operations/getmediaartsresponse.md b/docs/models/operations/getmediaartsresponse.md deleted file mode 100644 index 78660d0..0000000 --- a/docs/models/operations/getmediaartsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaArtsResponse - - -## 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.GetMediaArtsResponseBody](../../models/operations/getmediaartsresponsebody.md) | :heavy_minus_sign: | The available background artwork for the library item. | \ No newline at end of file diff --git a/docs/models/operations/getmediaartsresponsebody.md b/docs/models/operations/getmediaartsresponsebody.md deleted file mode 100644 index 44ebf89..0000000 --- a/docs/models/operations/getmediaartsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaArtsResponseBody - -The available background artwork for the library item. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetMediaArtsMediaContainer](../../models/operations/getmediaartsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataattributes.md b/docs/models/operations/getmediametadataattributes.md deleted file mode 100644 index e66f9c7..0000000 --- a/docs/models/operations/getmediametadataattributes.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaMetaDataAttributes - -Attributes associated with the marker. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | The identifier for the attributes. | 306970 | -| `Version` | **int64* | :heavy_minus_sign: | The version number of the marker attributes. | 4 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatachapter.md b/docs/models/operations/getmediametadatachapter.md deleted file mode 100644 index 4445704..0000000 --- a/docs/models/operations/getmediametadatachapter.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetMediaMetaDataChapter - -The thumbnail for the chapter - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `ID` | *int64* | :heavy_check_mark: | N/A | 4 | -| `Filter` | *string* | :heavy_check_mark: | N/A | thumb=4 | -| `Index` | *int64* | :heavy_check_mark: | N/A | 1 | -| `StartTimeOffset` | *int64* | :heavy_check_mark: | N/A | 0 | -| `EndTimeOffset` | *int64* | :heavy_check_mark: | N/A | 100100 | -| `Thumb` | *string* | :heavy_check_mark: | N/A | /library/media/46883/chapterImages/1 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatacountry.md b/docs/models/operations/getmediametadatacountry.md deleted file mode 100644 index 45fb8db..0000000 --- a/docs/models/operations/getmediametadatacountry.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaMetaDataCountry - -The filter query string for country media items. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the country.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America | -| `Filter` | *string* | :heavy_check_mark: | N/A | country=19 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatadirector.md b/docs/models/operations/getmediametadatadirector.md deleted file mode 100644 index 058aeb6..0000000 --- a/docs/models/operations/getmediametadatadirector.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaMetaDataDirector - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the director. | 126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this director. | director=235876 | -| `TagKey` | *string* | :heavy_check_mark: | A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. | 5d776831151a60001f24d031 | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the director. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataextras.md b/docs/models/operations/getmediametadataextras.md deleted file mode 100644 index 3b87bf1..0000000 --- a/docs/models/operations/getmediametadataextras.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetMediaMetaDataExtras - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `Size` | **int64* | :heavy_minus_sign: | The size of the extras. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatagenre.md b/docs/models/operations/getmediametadatagenre.md deleted file mode 100644 index 991cc5c..0000000 --- a/docs/models/operations/getmediametadatagenre.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaMetaDataGenre - -The filter query string for similar items. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the genre.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item
| Crime | -| `Filter` | *string* | :heavy_check_mark: | N/A | genre=19 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataguids.md b/docs/models/operations/getmediametadataguids.md deleted file mode 100644 index 26ae107..0000000 --- a/docs/models/operations/getmediametadataguids.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetMediaMetaDataGuids - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
| {
"imdbExample": {
"summary": "IMDB example",
"value": "imdb://tt13015952"
},
"tmdbExample": {
"summary": "TMDB example",
"value": "tmdb://2434012"
},
"tvdbExample": {
"summary": "TVDB example",
"value": "tvdb://7945991"
}
} | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatahasthumbnail.md b/docs/models/operations/getmediametadatahasthumbnail.md deleted file mode 100644 index 55b1ae2..0000000 --- a/docs/models/operations/getmediametadatahasthumbnail.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaMetaDataHasThumbnail - -Indicates if the part has a thumbnail. - - - -## Values - -| Name | Value | -| ----------------------------------- | ----------------------------------- | -| `GetMediaMetaDataHasThumbnailFalse` | 0 | -| `GetMediaMetaDataHasThumbnailTrue` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataimage.md b/docs/models/operations/getmediametadataimage.md deleted file mode 100644 index 0ffb96c..0000000 --- a/docs/models/operations/getmediametadataimage.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaMetaDataImage - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | -| `Type` | [operations.GetMediaMetaDataLibraryType](../../models/operations/getmediametadatalibrarytype.md) | :heavy_check_mark: | N/A | background | -| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatalibraryoptimizedforstreaming.md b/docs/models/operations/getmediametadatalibraryoptimizedforstreaming.md deleted file mode 100644 index 6bc474f..0000000 --- a/docs/models/operations/getmediametadatalibraryoptimizedforstreaming.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetMediaMetaDataLibraryOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - - -## Supported Types - -### GetMediaMetaDataOptimizedForStreamingLibrary1 - -```go -getMediaMetaDataLibraryOptimizedForStreaming := operations.CreateGetMediaMetaDataLibraryOptimizedForStreamingGetMediaMetaDataOptimizedForStreamingLibrary1(operations.GetMediaMetaDataOptimizedForStreamingLibrary1{/* values here */}) -``` - -### - -```go -getMediaMetaDataLibraryOptimizedForStreaming := operations.CreateGetMediaMetaDataLibraryOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getmediametadatalibrarytype.md b/docs/models/operations/getmediametadatalibrarytype.md deleted file mode 100644 index 0ea0339..0000000 --- a/docs/models/operations/getmediametadatalibrarytype.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaMetaDataLibraryType - - -## Values - -| Name | Value | -| ---------------------------------------- | ---------------------------------------- | -| `GetMediaMetaDataLibraryTypeCoverPoster` | coverPoster | -| `GetMediaMetaDataLibraryTypeBackground` | background | -| `GetMediaMetaDataLibraryTypeSnapshot` | snapshot | -| `GetMediaMetaDataLibraryTypeClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatalocation.md b/docs/models/operations/getmediametadatalocation.md deleted file mode 100644 index a3a1d7b..0000000 --- a/docs/models/operations/getmediametadatalocation.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetMediaMetaDataLocation - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Path` | *string* | :heavy_check_mark: | The file path for the location. | /TV Shows/Better Call Saul | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatamarker.md b/docs/models/operations/getmediametadatamarker.md deleted file mode 100644 index c72de44..0000000 --- a/docs/models/operations/getmediametadatamarker.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetMediaMetaDataMarker - -The final status of the marker - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | N/A | 306970 | -| `Type` | *string* | :heavy_check_mark: | N/A | credits | -| `StartTimeOffset` | *int64* | :heavy_check_mark: | N/A | 4176050 | -| `EndTimeOffset` | *int64* | :heavy_check_mark: | N/A | 4393389 | -| `Final` | **bool* | :heavy_minus_sign: | N/A | true | -| `Attributes` | [*operations.GetMediaMetaDataAttributes](../../models/operations/getmediametadataattributes.md) | :heavy_minus_sign: | Attributes associated with the marker. | | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatamedia.md b/docs/models/operations/getmediametadatamedia.md deleted file mode 100644 index c6cf018..0000000 --- a/docs/models/operations/getmediametadatamedia.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetMediaMetaDataMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 | -| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 | -| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 | -| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 | -| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 | -| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 | -| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | aac | -| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc | -| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k | -| `Container` | **string* | :heavy_minus_sign: | Container format of the media. | mp4 | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p
| 24p | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 | -| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | Indicates whether voice activity is detected. | false | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `OptimizedForStreaming` | [*operations.GetMediaMetaDataOptimizedForStreaming](../../models/operations/getmediametadataoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | Indicates whether the media has 64-bit offsets.
This is relevant for media files that may require larger offsets than what 32-bit integers can provide.
| false | -| `Part` | [][operations.GetMediaMetaDataPart](../../models/operations/getmediametadatapart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatamediacontainer.md b/docs/models/operations/getmediametadatamediacontainer.md deleted file mode 100644 index 4ce19ee..0000000 --- a/docs/models/operations/getmediametadatamediacontainer.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetMediaMetaDataMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The unique identifier for the library section. | 2 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | TV Series | -| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | The universally unique identifier for the library section. | e69655a2-ef48-4aba-bb19-0cc34d1e7d36 | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Metadata` | [][operations.GetMediaMetaDataMetadata](../../models/operations/getmediametadatametadata.md) | :heavy_check_mark: | An array of metadata items. | | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatametadata.md b/docs/models/operations/getmediametadatametadata.md deleted file mode 100644 index d74a383..0000000 --- a/docs/models/operations/getmediametadatametadata.md +++ /dev/null @@ -1,83 +0,0 @@ -# GetMediaMetaDataMetadata - -Unknown - - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 | -| `Key` | *string* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 | -| `GUID` | *string* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 | -| `Slug` | *string* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas | -| `Studio` | **string* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios | -| `Type` | [operations.GetMediaMetaDataType](../../models/operations/getmediametadatatype.md) | :heavy_check_mark: | N/A | movie | -| `Title` | *string* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water | -| `TitleSort` | *string* | :heavy_check_mark: | The sort title used for ordering media items. | Whale | -| `ContentRating` | **string* | :heavy_minus_sign: | The content rating for the media item. | PG-13 | -| `Summary` | *string* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.
Once a familiar threat returns to finish what was previously started, Jake must
work with Neytiri and the army of the Na'vi race to protect their home.
| -| `Rating` | *float32* | :heavy_check_mark: | The critic rating for the media item. | 7.6 | -| `AudienceRating` | *float64* | :heavy_check_mark: | The audience rating for the media item. | 9.2 | -| `Year` | **int* | :heavy_minus_sign: | The release year of the media item. | 2022 | -| `Tagline` | *string* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. | -| `Thumb` | *string* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 | -| `Art` | *string* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 | -| `Theme` | *string* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 | -| `Index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 | -| `LeafCount` | **int* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 | -| `ChildCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 | -| `SeasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 | -| `Duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | The original release date of the media item. | 2022-12-14 | -| `AddedAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright | -| `ChapterSource` | **string* | :heavy_minus_sign: | The source from which chapter data is derived. | media | -| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 | -| `OriginalTitle` | **string* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent media item. | 66 | -| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 | -| `ParentGUID` | **string* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentGUID` | **string* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentSlug` | **string* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 | -| `ParentKey` | **string* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 | -| `GrandparentTheme` | **string* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 | -| `ParentTitle` | **string* | :heavy_minus_sign: | The title of the parent media item. | Caprica | -| `ParentIndex` | **int* | :heavy_minus_sign: | The index position of the parent media item. | 1 | -| `ParentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 | -| `RatingImage` | **string* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe | -| `ViewCount` | **int* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 | -| `ViewOffset` | **int* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 | -| `SkipCount` | **int* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 | -| `Subtype` | **string* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip | -| `LastRatedAt` | **int64* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 | -| `CreatedAtAccuracy` | **string* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local | -| `CreatedAtTZOffset` | **string* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 | -| `UserRating` | **float32* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 | -| `Image` | [][operations.GetMediaMetaDataImage](../../models/operations/getmediametadataimage.md) | :heavy_minus_sign: | N/A | | -| `UltraBlurColors` | [*operations.GetMediaMetaDataUltraBlurColors](../../models/operations/getmediametadataultrablurcolors.md) | :heavy_minus_sign: | N/A | | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The identifier for the library section. | 1 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | Movies | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | The key corresponding to the library section. | /library/sections/1 | -| `Guids` | [][operations.GetMediaMetaDataGuids](../../models/operations/getmediametadataguids.md) | :heavy_minus_sign: | N/A | | -| `Media` | [][operations.GetMediaMetaDataMedia](../../models/operations/getmediametadatamedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetMediaMetaDataGenre](../../models/operations/getmediametadatagenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetMediaMetaDataCountry](../../models/operations/getmediametadatacountry.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetMediaMetaDataDirector](../../models/operations/getmediametadatadirector.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetMediaMetaDataWriter](../../models/operations/getmediametadatawriter.md) | :heavy_minus_sign: | N/A | | -| `Producer` | [][operations.GetMediaMetaDataProducer](../../models/operations/getmediametadataproducer.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetMediaMetaDataRole](../../models/operations/getmediametadatarole.md) | :heavy_minus_sign: | N/A | | -| `Ratings` | [][operations.GetMediaMetaDataRatings](../../models/operations/getmediametadataratings.md) | :heavy_minus_sign: | N/A | | -| `Similar` | [][operations.GetMediaMetaDataSimilar](../../models/operations/getmediametadatasimilar.md) | :heavy_minus_sign: | N/A | | -| `Location` | [][operations.GetMediaMetaDataLocation](../../models/operations/getmediametadatalocation.md) | :heavy_minus_sign: | N/A | | -| `Chapter` | [][operations.GetMediaMetaDataChapter](../../models/operations/getmediametadatachapter.md) | :heavy_minus_sign: | N/A | | -| `Marker` | [][operations.GetMediaMetaDataMarker](../../models/operations/getmediametadatamarker.md) | :heavy_minus_sign: | N/A | | -| `Extras` | [*operations.GetMediaMetaDataExtras](../../models/operations/getmediametadataextras.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataoptimizedforstreaming.md b/docs/models/operations/getmediametadataoptimizedforstreaming.md deleted file mode 100644 index 43e7076..0000000 --- a/docs/models/operations/getmediametadataoptimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetMediaMetaDataOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### GetMediaMetaDataOptimizedForStreaming1 - -```go -getMediaMetaDataOptimizedForStreaming := operations.CreateGetMediaMetaDataOptimizedForStreamingGetMediaMetaDataOptimizedForStreaming1(operations.GetMediaMetaDataOptimizedForStreaming1{/* values here */}) -``` - -### - -```go -getMediaMetaDataOptimizedForStreaming := operations.CreateGetMediaMetaDataOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getmediametadataoptimizedforstreaming1.md b/docs/models/operations/getmediametadataoptimizedforstreaming1.md deleted file mode 100644 index c50c9da..0000000 --- a/docs/models/operations/getmediametadataoptimizedforstreaming1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetMediaMetaDataOptimizedForStreaming1 - - -## Values - -| Name | Value | -| -------------------------------------------- | -------------------------------------------- | -| `GetMediaMetaDataOptimizedForStreaming1Zero` | 0 | -| `GetMediaMetaDataOptimizedForStreaming1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataoptimizedforstreaminglibrary1.md b/docs/models/operations/getmediametadataoptimizedforstreaminglibrary1.md deleted file mode 100644 index 31e0f34..0000000 --- a/docs/models/operations/getmediametadataoptimizedforstreaminglibrary1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetMediaMetaDataOptimizedForStreamingLibrary1 - - -## Values - -| Name | Value | -| --------------------------------------------------- | --------------------------------------------------- | -| `GetMediaMetaDataOptimizedForStreamingLibrary1Zero` | 0 | -| `GetMediaMetaDataOptimizedForStreamingLibrary1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatapart.md b/docs/models/operations/getmediametadatapart.md deleted file mode 100644 index 37074d1..0000000 --- a/docs/models/operations/getmediametadatapart.md +++ /dev/null @@ -1,23 +0,0 @@ -# GetMediaMetaDataPart - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true | -| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true | -| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 | -| `Key` | **string* | :heavy_minus_sign: | Key to access this part. | /library/parts/418385/1735864239/file.mkv | -| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 | -| `File` | **string* | :heavy_minus_sign: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv | -| `Size` | **int64* | :heavy_minus_sign: | File size in bytes. | 30649952104 | -| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 | -| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | [*operations.GetMediaMetaDataLibraryOptimizedForStreaming](../../models/operations/getmediametadatalibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
| | -| `HasThumbnail` | [*operations.GetMediaMetaDataHasThumbnail](../../models/operations/getmediametadatahasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | -| `Stream` | [][operations.GetMediaMetaDataStream](../../models/operations/getmediametadatastream.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataproducer.md b/docs/models/operations/getmediametadataproducer.md deleted file mode 100644 index 11cf110..0000000 --- a/docs/models/operations/getmediametadataproducer.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetMediaMetaDataProducer - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | The unique role identifier. | 109501 | -| `Filter` | *string* | :heavy_check_mark: | The filter string for the role. | actor=109501 | -| `Tag` | *string* | :heavy_check_mark: | The actor's name. | Bob Odenkirk | -| `TagKey` | *string* | :heavy_check_mark: | A key associated with the actor tag. | 5d77683254f42c001f8c3f69 | -| `Role` | **string* | :heavy_minus_sign: | The character name or role. | Jimmy McGill | -| `Thumb` | **string* | :heavy_minus_sign: | URL for the role thumbnail image. | https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataratings.md b/docs/models/operations/getmediametadataratings.md deleted file mode 100644 index a377e39..0000000 --- a/docs/models/operations/getmediametadataratings.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaMetaDataRatings - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `Image` | *string* | :heavy_check_mark: | The image or reference for the rating. | imdb://image.rating | -| `Value` | *float32* | :heavy_check_mark: | The rating value. | 9 | -| `Type` | *string* | :heavy_check_mark: | The type of rating (e.g., audience, critic). | audience | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatarequest.md b/docs/models/operations/getmediametadatarequest.md deleted file mode 100644 index 639869d..0000000 --- a/docs/models/operations/getmediametadatarequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetMediaMetaDataRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `RatingKey` | *string* | :heavy_check_mark: | The id(s) of the library item(s) to return metadata for. Can be a single ID or comma-separated list of IDs. | 21119,21617 | -| `IncludeConcerts` | **bool* | :heavy_minus_sign: | Include concerts data if set to true. | true | -| `IncludeExtras` | **bool* | :heavy_minus_sign: | Include extra content (e.g. bonus features). | true | -| `IncludeOnDeck` | **bool* | :heavy_minus_sign: | Include on-deck items. | true | -| `IncludePopularLeaves` | **bool* | :heavy_minus_sign: | Include popular leaves (episodes/chapters). | true | -| `IncludePreferences` | **bool* | :heavy_minus_sign: | Include preferences information. | true | -| `IncludeReviews` | **bool* | :heavy_minus_sign: | Include reviews for the content. | true | -| `IncludeChapters` | **bool* | :heavy_minus_sign: | Include chapter details. | true | -| `IncludeStations` | **bool* | :heavy_minus_sign: | Include station data. | true | -| `IncludeExternalMedia` | **bool* | :heavy_minus_sign: | Include external media data. | true | -| `AsyncAugmentMetadata` | **bool* | :heavy_minus_sign: | Trigger asynchronous metadata augmentation. | true | -| `AsyncCheckFiles` | **bool* | :heavy_minus_sign: | Trigger asynchronous file checking. | true | -| `AsyncRefreshAnalysis` | **bool* | :heavy_minus_sign: | Trigger asynchronous refresh of analysis. | true | -| `AsyncRefreshLocalMediaAgent` | **bool* | :heavy_minus_sign: | Trigger asynchronous refresh of the local media agent. | true | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataresponse.md b/docs/models/operations/getmediametadataresponse.md deleted file mode 100644 index 2497361..0000000 --- a/docs/models/operations/getmediametadataresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaMetaDataResponse - - -## 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.GetMediaMetaDataResponseBody](../../models/operations/getmediametadataresponsebody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataresponsebody.md b/docs/models/operations/getmediametadataresponsebody.md deleted file mode 100644 index 9df9048..0000000 --- a/docs/models/operations/getmediametadataresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaMetaDataResponseBody - -The metadata of the library item. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetMediaMetaDataMediaContainer](../../models/operations/getmediametadatamediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatarole.md b/docs/models/operations/getmediametadatarole.md deleted file mode 100644 index 5438675..0000000 --- a/docs/models/operations/getmediametadatarole.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetMediaMetaDataRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the role.
NOTE: This is different for each Plex server and is not globally unique.
| 126522 | -| `Tag` | *string* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller | -| `Role` | **string* | :heavy_minus_sign: | The role played by the actor in the media item. | Self - Judge | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. | actor=126522 | -| `TagKey` | *string* | :heavy_check_mark: | A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification.
NOTE: This is globally unique across all Plex Servers.
| 5d77683d85719b001f3a535e | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the actor. | https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatasimilar.md b/docs/models/operations/getmediametadatasimilar.md deleted file mode 100644 index 9531b4b..0000000 --- a/docs/models/operations/getmediametadatasimilar.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaMetaDataSimilar - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | The unique similar item identifier. | 26 | -| `Filter` | *string* | :heavy_check_mark: | The filter string for similar items. | similar=26 | -| `Tag` | *string* | :heavy_check_mark: | The tag or title of the similar content. | Breaking Bad | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatastream.md b/docs/models/operations/getmediametadatastream.md deleted file mode 100644 index 7b64621..0000000 --- a/docs/models/operations/getmediametadatastream.md +++ /dev/null @@ -1,58 +0,0 @@ -# GetMediaMetaDataStream - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique stream identifier. | 1002625 | -| `StreamType` | *int64* | :heavy_check_mark: | Stream type:
- VIDEO = 1
- AUDIO = 2
- SUBTITLE = 3
| | -| `Format` | **string* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt | -| `Default` | **bool* | :heavy_minus_sign: | Indicates if this stream is default. | true | -| `Codec` | **string* | :heavy_minus_sign: | Codec used by the stream. | hevc | -| `Index` | **int* | :heavy_minus_sign: | Index of the stream. | 0 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate of the stream. | 24743 | -| `Language` | **string* | :heavy_minus_sign: | Language of the stream. | English | -| `LanguageTag` | **string* | :heavy_minus_sign: | Language tag (e.g., en). | en | -| `LanguageCode` | **string* | :heavy_minus_sign: | ISO language code. | eng | -| `HeaderCompression` | **bool* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true | -| `DOVIBLCompatID` | **int* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 | -| `DOVIBLPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true | -| `DOVIELPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false | -| `DOVILevel` | **int* | :heavy_minus_sign: | Dolby Vision level. | 6 | -| `DOVIPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true | -| `DOVIProfile` | **int* | :heavy_minus_sign: | Dolby Vision profile. | 8 | -| `DOVIRPUPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true | -| `DOVIVersion` | **string* | :heavy_minus_sign: | Dolby Vision version. | 1.0 | -| `BitDepth` | **int* | :heavy_minus_sign: | Bit depth of the video stream. | 10 | -| `ChromaLocation` | **string* | :heavy_minus_sign: | Chroma sample location. | topleft | -| `ChromaSubsampling` | **string* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 | -| `CodedHeight` | **int* | :heavy_minus_sign: | Coded video height. | 1608 | -| `CodedWidth` | **int* | :heavy_minus_sign: | Coded video width. | 3840 | -| `ClosedCaptions` | **bool* | :heavy_minus_sign: | N/A | true | -| `ColorPrimaries` | **string* | :heavy_minus_sign: | Color primaries used. | bt2020 | -| `ColorRange` | **string* | :heavy_minus_sign: | Color range (e.g., tv). | tv | -| `ColorSpace` | **string* | :heavy_minus_sign: | Color space. | bt2020nc | -| `ColorTrc` | **string* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 | -| `FrameRate` | **float32* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 | -| `Key` | **string* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 | -| `Height` | **int* | :heavy_minus_sign: | Height of the video stream. | 1602 | -| `Level` | **int* | :heavy_minus_sign: | Video level. | 150 | -| `Original` | **bool* | :heavy_minus_sign: | Indicates if this is the original stream. | true | -| `HasScalingMatrix` | **bool* | :heavy_minus_sign: | N/A | false | -| `Profile` | **string* | :heavy_minus_sign: | Video profile. | main 10 | -| `ScanType` | **string* | :heavy_minus_sign: | N/A | progressive | -| `EmbeddedInVideo` | **string* | :heavy_minus_sign: | N/A | progressive | -| `RefFrames` | **int* | :heavy_minus_sign: | Number of reference frames. | 1 | -| `Width` | **int* | :heavy_minus_sign: | Width of the video stream. | 3840 | -| `DisplayTitle` | **string* | :heavy_minus_sign: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) | -| `ExtendedDisplayTitle` | **string* | :heavy_minus_sign: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) | -| `Selected` | **bool* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true | -| `Forced` | **bool* | :heavy_minus_sign: | N/A | true | -| `Channels` | **int* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 | -| `AudioChannelLayout` | **string* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) | -| `SamplingRate` | **int* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 | -| `CanAutoSync` | **bool* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false | -| `HearingImpaired` | **bool* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true | -| `Dub` | **bool* | :heavy_minus_sign: | Indicates if the stream is a dub. | true | -| `Title` | **string* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatatype.md b/docs/models/operations/getmediametadatatype.md deleted file mode 100644 index 7282316..0000000 --- a/docs/models/operations/getmediametadatatype.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetMediaMetaDataType - -The type of media content in the Plex library. This can represent videos, music, or photos. - - - -## Values - -| Name | Value | -| -------------------------------- | -------------------------------- | -| `GetMediaMetaDataTypeMovie` | movie | -| `GetMediaMetaDataTypeTvShow` | show | -| `GetMediaMetaDataTypeSeason` | season | -| `GetMediaMetaDataTypeEpisode` | episode | -| `GetMediaMetaDataTypeArtist` | artist | -| `GetMediaMetaDataTypeAlbum` | album | -| `GetMediaMetaDataTypeTrack` | track | -| `GetMediaMetaDataTypePhotoAlbum` | photoalbum | -| `GetMediaMetaDataTypePhoto` | photo | -| `GetMediaMetaDataTypeCollection` | collection | \ No newline at end of file diff --git a/docs/models/operations/getmediametadataultrablurcolors.md b/docs/models/operations/getmediametadataultrablurcolors.md deleted file mode 100644 index f7cb003..0000000 --- a/docs/models/operations/getmediametadataultrablurcolors.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaMetaDataUltraBlurColors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `TopLeft` | *string* | :heavy_check_mark: | N/A | 11333b | -| `TopRight` | *string* | :heavy_check_mark: | N/A | 0a232d | -| `BottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | -| `BottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/models/operations/getmediametadatawriter.md b/docs/models/operations/getmediametadatawriter.md deleted file mode 100644 index cb126b4..0000000 --- a/docs/models/operations/getmediametadatawriter.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaMetaDataWriter - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the writer. | 126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this writer. | writer=126522 | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the writer. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | -| `TagKey` | **string* | :heavy_minus_sign: | A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. | 5d77683d85719b001f3a535e | \ No newline at end of file diff --git a/docs/models/operations/getmediapartglobals.md b/docs/models/operations/getmediapartglobals.md new file mode 100644 index 0000000..e508767 --- /dev/null +++ b/docs/models/operations/getmediapartglobals.md @@ -0,0 +1,18 @@ +# GetMediaPartGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getmediapartrequest.md b/docs/models/operations/getmediapartrequest.md new file mode 100644 index 0000000..d28391e --- /dev/null +++ b/docs/models/operations/getmediapartrequest.md @@ -0,0 +1,22 @@ +# GetMediaPartRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PartID` | *int64* | :heavy_check_mark: | The part id who's index is to be fetched | | +| `Changestamp` | *int64* | :heavy_check_mark: | The changestamp of the part; used for busting potential caches. Provided in the `key` for the part | | +| `Filename` | *string* | :heavy_check_mark: | A generic filename used for a client media stack which relies on the extension in the request. Provided in the `key` for the part | | +| `Download` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this is a file download | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmediapartresponse.md b/docs/models/operations/getmediapartresponse.md new file mode 100644 index 0000000..934754f --- /dev/null +++ b/docs/models/operations/getmediapartresponse.md @@ -0,0 +1,11 @@ +# GetMediaPartResponse + + +## 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 | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediapostersmediacontainer.md b/docs/models/operations/getmediapostersmediacontainer.md deleted file mode 100644 index 97e9b3e..0000000 --- a/docs/models/operations/getmediapostersmediacontainer.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaPostersMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `Metadata` | [][operations.GetMediaPostersMetadata](../../models/operations/getmediapostersmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getmediapostersmetadata.md b/docs/models/operations/getmediapostersmetadata.md deleted file mode 100644 index 70c48c8..0000000 --- a/docs/models/operations/getmediapostersmetadata.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMediaPostersMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg | -| `Provider` | **string* | :heavy_minus_sign: | The provider of the poster. | tmdb | -| `RatingKey` | *string* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg | -| `Selected` | *bool* | :heavy_check_mark: | Whether this is the selected poster. | true | -| `Thumb` | *string* | :heavy_check_mark: | The URL of the poster thumbnail. | https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg | \ No newline at end of file diff --git a/docs/models/operations/getmediapostersrequest.md b/docs/models/operations/getmediapostersrequest.md deleted file mode 100644 index 0154211..0000000 --- a/docs/models/operations/getmediapostersrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetMediaPostersRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 | \ No newline at end of file diff --git a/docs/models/operations/getmediapostersresponse.md b/docs/models/operations/getmediapostersresponse.md deleted file mode 100644 index d8c91d8..0000000 --- a/docs/models/operations/getmediapostersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaPostersResponse - - -## 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.GetMediaPostersResponseBody](../../models/operations/getmediapostersresponsebody.md) | :heavy_minus_sign: | The available posters for the library item. | \ No newline at end of file diff --git a/docs/models/operations/getmediapostersresponsebody.md b/docs/models/operations/getmediapostersresponsebody.md deleted file mode 100644 index 8e86cef..0000000 --- a/docs/models/operations/getmediapostersresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaPostersResponseBody - -The available posters for the library item. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetMediaPostersMediaContainer](../../models/operations/getmediapostersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediaprovidersdirectory.md b/docs/models/operations/getmediaprovidersdirectory.md deleted file mode 100644 index eacc1a5..0000000 --- a/docs/models/operations/getmediaprovidersdirectory.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetMediaProvidersDirectory - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `HubKey` | **string* | :heavy_minus_sign: | N/A | -| `Title` | **string* | :heavy_minus_sign: | N/A | -| `Agent` | **string* | :heavy_minus_sign: | N/A | -| `Language` | **string* | :heavy_minus_sign: | N/A | -| `Refreshing` | **bool* | :heavy_minus_sign: | N/A | -| `Scanner` | **string* | :heavy_minus_sign: | N/A | -| `UUID` | **string* | :heavy_minus_sign: | N/A | -| `ID` | **string* | :heavy_minus_sign: | N/A | -| `Key` | **string* | :heavy_minus_sign: | N/A | -| `Type` | **string* | :heavy_minus_sign: | N/A | -| `Subtype` | **string* | :heavy_minus_sign: | N/A | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | N/A | -| `ScannedAt` | **int64* | :heavy_minus_sign: | N/A | -| `Pivot` | [][operations.Pivot](../../models/operations/pivot.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediaprovidersmediacontainer.md b/docs/models/operations/getmediaprovidersmediacontainer.md deleted file mode 100644 index 15e012a..0000000 --- a/docs/models/operations/getmediaprovidersmediacontainer.md +++ /dev/null @@ -1,51 +0,0 @@ -# GetMediaProvidersMediaContainer - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Size` | **int64* | :heavy_minus_sign: | N/A | -| `AllowCameraUpload` | **bool* | :heavy_minus_sign: | N/A | -| `AllowChannelAccess` | **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 | -| `Livetv` | **int64* | :heavy_minus_sign: | N/A | -| `MachineIdentifier` | **string* | :heavy_minus_sign: | N/A | -| `MusicAnalysis` | **int64* | :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` | **int64* | :heavy_minus_sign: | N/A | -| `OwnerFeatures` | **string* | :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` | **int64* | :heavy_minus_sign: | N/A | -| `StreamingBrainVersion` | **int64* | :heavy_minus_sign: | N/A | -| `Sync` | **bool* | :heavy_minus_sign: | N/A | -| `TranscoderActiveVideoSessions` | **int64* | :heavy_minus_sign: | N/A | -| `TranscoderAudio` | **bool* | :heavy_minus_sign: | N/A | -| `TranscoderLyrics` | **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` | **int64* | :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 | -| `MediaProvider` | [][operations.MediaProvider](../../models/operations/mediaprovider.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmediaprovidersrequest.md b/docs/models/operations/getmediaprovidersrequest.md deleted file mode 100644 index 9dea2da..0000000 --- a/docs/models/operations/getmediaprovidersrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetMediaProvidersRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/getmediaprovidersresponse.md b/docs/models/operations/getmediaprovidersresponse.md deleted file mode 100644 index d165337..0000000 --- a/docs/models/operations/getmediaprovidersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaProvidersResponse - - -## 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.GetMediaProvidersResponseBody](../../models/operations/getmediaprovidersresponsebody.md) | :heavy_minus_sign: | Media providers and their features | \ No newline at end of file diff --git a/docs/models/operations/getmediaprovidersresponsebody.md b/docs/models/operations/getmediaprovidersresponsebody.md deleted file mode 100644 index c23aa89..0000000 --- a/docs/models/operations/getmediaprovidersresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaProvidersResponseBody - -Media providers and their features - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetMediaProvidersMediaContainer](../../models/operations/getmediaprovidersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrendirectory.md b/docs/models/operations/getmetadatachildrendirectory.md deleted file mode 100644 index 1d803d6..0000000 --- a/docs/models/operations/getmetadatachildrendirectory.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetMetadataChildrenDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 16 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/thumb/1705739923 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | N/A | 16 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/allLeaves | -| `Title` | **string* | :heavy_minus_sign: | N/A | All episodes | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenmediacontainer.md b/docs/models/operations/getmetadatachildrenmediacontainer.md deleted file mode 100644 index 766bd95..0000000 --- a/docs/models/operations/getmetadatachildrenmediacontainer.md +++ /dev/null @@ -1,30 +0,0 @@ -# GetMetadataChildrenMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 3 | -| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | true | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/art/1705739923 | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `Key` | **string* | :heavy_minus_sign: | N/A | 30072 | -| `LibrarySectionID` | **int* | :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 | -| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `MediaTagVersion` | **int* | :heavy_minus_sign: | N/A | 1701731894 | -| `Nocache` | **bool* | :heavy_minus_sign: | N/A | true | -| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Reacher | -| `ParentYear` | **int* | :heavy_minus_sign: | N/A | 2022 | -| `Summary` | **string* | :heavy_minus_sign: | N/A | When retired Military Police Officer Jack Reacher is arrested for a murder he did not commit, he finds himself in the middle of a deadly conspiracy full of dirty cops, shady businessmen, and scheming politicians. With nothing but his wits, he must figure out what is happening in Margrave, Georgia. | -| `Theme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/theme/1705739923 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/thumb/1705739923 | -| `Title1` | **string* | :heavy_minus_sign: | N/A | TV Shows | -| `Title2` | **string* | :heavy_minus_sign: | N/A | Reacher | -| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | season | -| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65593 | -| `Directory` | [][operations.GetMetadataChildrenDirectory](../../models/operations/getmetadatachildrendirectory.md) | :heavy_minus_sign: | N/A | [
{
"leafCount": 16,
"thumb": "/library/metadata/30072/thumb/1705739923",
"viewedLeafCount": 16,
"key": "/library/metadata/30072/allLeaves",
"title": "All episodes"
}
] | -| `Metadata` | [][operations.GetMetadataChildrenMetadata](../../models/operations/getmetadatachildrenmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenmetadata.md b/docs/models/operations/getmetadatachildrenmetadata.md deleted file mode 100644 index dc14d21..0000000 --- a/docs/models/operations/getmetadatachildrenmetadata.md +++ /dev/null @@ -1,34 +0,0 @@ -# GetMetadataChildrenMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 66488 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66488/children | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | N/A | 30072 | -| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://season/652aea6549508477c34c6000 | -| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c09190aaccd001f8f42f0 | -| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | Amazon Studios | -| `Type` | **string* | :heavy_minus_sign: | N/A | season | -| `Title` | **string* | :heavy_minus_sign: | N/A | Season 2 | -| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072 | -| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Reacher | -| `Summary` | **string* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind-revenge. | -| `Index` | **int* | :heavy_minus_sign: | N/A | 2 | -| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 11 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1705646565 | -| `ParentYear` | **int* | :heavy_minus_sign: | N/A | 2022 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66488/thumb/1703065033 | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/art/1705739923 | -| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/thumb/1705739923 | -| `ParentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/30072/theme/1705739923 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 8 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | N/A | 8 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1702602021 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1703065033 | -| `UserRating` | **int* | :heavy_minus_sign: | N/A | 9 | -| `SkipCount` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LastRatedAt` | **int* | :heavy_minus_sign: | N/A | 1703881224 | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenrequest.md b/docs/models/operations/getmetadatachildrenrequest.md deleted file mode 100644 index 851ab84..0000000 --- a/docs/models/operations/getmetadatachildrenrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetMetadataChildrenRequest - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `RatingKey` | *float64* | :heavy_check_mark: | the id of the library item to return the children of. | -| `IncludeElements` | **string* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)
| \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenresponse.md b/docs/models/operations/getmetadatachildrenresponse.md deleted file mode 100644 index e53a171..0000000 --- a/docs/models/operations/getmetadatachildrenresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetMetadataChildrenResponseBody](../../models/operations/getmetadatachildrenresponsebody.md) | :heavy_minus_sign: | The children of the library item. | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenresponsebody.md b/docs/models/operations/getmetadatachildrenresponsebody.md deleted file mode 100644 index 897dc4e..0000000 --- a/docs/models/operations/getmetadatachildrenresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMetadataChildrenResponseBody - -The children of the library item. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetMetadataChildrenMediaContainer](../../models/operations/getmetadatachildrenmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmetadatahubsglobals.md b/docs/models/operations/getmetadatahubsglobals.md new file mode 100644 index 0000000..077d104 --- /dev/null +++ b/docs/models/operations/getmetadatahubsglobals.md @@ -0,0 +1,18 @@ +# GetMetadataHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getmetadatahubsrequest.md b/docs/models/operations/getmetadatahubsrequest.md new file mode 100644 index 0000000..10454ec --- /dev/null +++ b/docs/models/operations/getmetadatahubsrequest.md @@ -0,0 +1,21 @@ +# GetMetadataHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `MetadataID` | *int64* | :heavy_check_mark: | The metadata ID for the hubs to fetch | | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `OnlyTransient` | [*components.BoolInt](../../models/components/boolint.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) | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmetadatahubsresponse.md b/docs/models/operations/getmetadatahubsresponse.md new file mode 100644 index 0000000..f2ce3c7 --- /dev/null +++ b/docs/models/operations/getmetadatahubsresponse.md @@ -0,0 +1,12 @@ +# GetMetadataHubsResponse + + +## 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 | +| `MediaContainerWithHubs` | [*components.MediaContainerWithHubs](../../models/components/mediacontainerwithhubs.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmetadataitemglobals.md b/docs/models/operations/getmetadataitemglobals.md new file mode 100644 index 0000000..4516a45 --- /dev/null +++ b/docs/models/operations/getmetadataitemglobals.md @@ -0,0 +1,18 @@ +# GetMetadataItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getmetadataitemrequest.md b/docs/models/operations/getmetadataitemrequest.md new file mode 100644 index 0000000..8fd0f47 --- /dev/null +++ b/docs/models/operations/getmetadataitemrequest.md @@ -0,0 +1,27 @@ +# GetMetadataItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | []*string* | :heavy_check_mark: | N/A | | +| `AsyncCheckFiles` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Determines if file check should be performed asynchronously. An activity is created to indicate progress. Default is false. | 1 | +| `AsyncRefreshLocalMediaAgent` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Determines if local media agent refresh should be performed asynchronously. An activity is created to indicate progress. Default is false. | 1 | +| `AsyncRefreshAnalysis` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Determines if analysis refresh should be performed asynchronously. An activity is created to indicate progress. Default is false. | 1 | +| `CheckFiles` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Determines if file check should be performed synchronously. Specifying `asyncCheckFiles` will cause this option to be ignored. Default is false. | 1 | +| `SkipRefresh` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Determines if synchronous local media agent and analysis refresh should be skipped. Specifying async versions will cause synchronous versions to be skipped. Default is false. | 1 | +| `CheckFileAvailability` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Determines if file existence check should be performed synchronously. Specifying `checkFiles` will imply this option. Default is false. | 1 | +| `AsyncAugmentMetadata` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Add metadata augmentations. An activity is created to indicate progress. Option will be ignored if specified by non-admin or if multiple metadata items are requested. Default is false. | 1 | +| `AugmentCount` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Number of augmentations to add. Requires `asyncAugmentMetadata` to be specified. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getmetadataitemresponse.md b/docs/models/operations/getmetadataitemresponse.md new file mode 100644 index 0000000..fb6d3a1 --- /dev/null +++ b/docs/models/operations/getmetadataitemresponse.md @@ -0,0 +1,12 @@ +# GetMetadataItemResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmyplexaccountresponse.md b/docs/models/operations/getmyplexaccountresponse.md deleted file mode 100644 index 260b526..0000000 --- a/docs/models/operations/getmyplexaccountresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 52f0908..0000000 --- a/docs/models/operations/getmyplexaccountresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/getnotificationsglobals.md b/docs/models/operations/getnotificationsglobals.md new file mode 100644 index 0000000..1f50c27 --- /dev/null +++ b/docs/models/operations/getnotificationsglobals.md @@ -0,0 +1,18 @@ +# GetNotificationsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getnotificationsrequest.md b/docs/models/operations/getnotificationsrequest.md new file mode 100644 index 0000000..01a2ebf --- /dev/null +++ b/docs/models/operations/getnotificationsrequest.md @@ -0,0 +1,19 @@ +# GetNotificationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Filter` | []*string* | :heavy_minus_sign: | By default, all events except logs are sent. A rich filtering mechanism is provided to allow clients to opt into or out of each event type using the `filters` parameter. For example:

- `filters=-log`: All event types except logs (the default).
- `filters=foo,bar`: Only the foo and bar event types.
- `filters=`: All events types.
- `filters=-foo,bar`: All event types except foo and bar.
| | \ No newline at end of file diff --git a/docs/models/operations/getnotificationsresponse.md b/docs/models/operations/getnotificationsresponse.md new file mode 100644 index 0000000..6bd5511 --- /dev/null +++ b/docs/models/operations/getnotificationsresponse.md @@ -0,0 +1,11 @@ +# GetNotificationsResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpartindexglobals.md b/docs/models/operations/getpartindexglobals.md new file mode 100644 index 0000000..e103eeb --- /dev/null +++ b/docs/models/operations/getpartindexglobals.md @@ -0,0 +1,18 @@ +# GetPartIndexGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getpartindexrequest.md b/docs/models/operations/getpartindexrequest.md new file mode 100644 index 0000000..f88b0fc --- /dev/null +++ b/docs/models/operations/getpartindexrequest.md @@ -0,0 +1,21 @@ +# GetPartIndexRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PartID` | *int64* | :heavy_check_mark: | The part id who's index is to be fetched | | +| `Index` | [operations.Index](../../models/operations/index.md) | :heavy_check_mark: | The type of index to grab. | | +| `Interval` | **int64* | :heavy_minus_sign: | The interval between images to return in ms. | | \ No newline at end of file diff --git a/docs/models/operations/getpartindexresponse.md b/docs/models/operations/getpartindexresponse.md new file mode 100644 index 0000000..d3a9fe7 --- /dev/null +++ b/docs/models/operations/getpartindexresponse.md @@ -0,0 +1,11 @@ +# GetPartIndexResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpersonglobals.md b/docs/models/operations/getpersonglobals.md new file mode 100644 index 0000000..f35af2b --- /dev/null +++ b/docs/models/operations/getpersonglobals.md @@ -0,0 +1,18 @@ +# GetPersonGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getpersonmediacontainer.md b/docs/models/operations/getpersonmediacontainer.md new file mode 100644 index 0000000..f873a20 --- /dev/null +++ b/docs/models/operations/getpersonmediacontainer.md @@ -0,0 +1,17 @@ +# GetPersonMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpersonrequest.md b/docs/models/operations/getpersonrequest.md new file mode 100644 index 0000000..8b378af --- /dev/null +++ b/docs/models/operations/getpersonrequest.md @@ -0,0 +1,19 @@ +# GetPersonRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PersonID` | *string* | :heavy_check_mark: | Either the PMS tag `id` of the person or `tagKey` of the actor. Note the `tagKey` is the hex portion of the plex guid for the actor | | \ No newline at end of file diff --git a/docs/models/operations/getpersonresponse.md b/docs/models/operations/getpersonresponse.md new file mode 100644 index 0000000..e6bb9d8 --- /dev/null +++ b/docs/models/operations/getpersonresponse.md @@ -0,0 +1,11 @@ +# GetPersonResponse + + +## 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.GetPersonResponseBody](../../models/operations/getpersonresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpersonresponsebody.md b/docs/models/operations/getpersonresponsebody.md new file mode 100644 index 0000000..b913e0f --- /dev/null +++ b/docs/models/operations/getpersonresponsebody.md @@ -0,0 +1,10 @@ +# GetPersonResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetPersonMediaContainer](../../models/operations/getpersonmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpinauthpincontainer.md b/docs/models/operations/getpinauthpincontainer.md deleted file mode 100644 index aec6127..0000000 --- a/docs/models/operations/getpinauthpincontainer.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetPinAuthPinContainer - -Requests a new pin id used in the authentication flow - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | N/A | 308667304 | -| `Code` | *string* | :heavy_check_mark: | N/A | 7RQZ | -| `Product` | *string* | :heavy_check_mark: | N/A | Tautulli | -| `Trusted` | **bool* | :heavy_minus_sign: | N/A | | -| `Qr` | *string* | :heavy_check_mark: | N/A | https://plex.tv/api/v2/pins/qr/7RQZ | -| `ClientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | Tautulli | -| `Location` | [operations.GeoData](../../models/operations/geodata.md) | :heavy_check_mark: | Geo location data | {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
} | -| `ExpiresIn` | **int64* | :heavy_minus_sign: | The number of seconds this pin expires, by default 900 seconds | 876 | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2024-07-16T17:03:05Z | -| `ExpiresAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2024-07-16T17:18:05Z | -| `AuthToken` | **string* | :heavy_minus_sign: | N/A | gcgzw5rz2xovp84b4vha3a40 | -| `NewRegistration` | *any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getpinrequest.md b/docs/models/operations/getpinrequest.md deleted file mode 100644 index a73c917..0000000 --- a/docs/models/operations/getpinrequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetPinRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Strong` | **bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | -| `ClientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `ClientName` | **string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `DeviceNickname` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `ClientVersion` | **string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `Platform` | **string* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/models/operations/getpinresponse.md b/docs/models/operations/getpinresponse.md deleted file mode 100644 index 8ce7a22..0000000 --- a/docs/models/operations/getpinresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPinResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 | | -| `AuthPinContainer` | [*operations.GetPinAuthPinContainer](../../models/operations/getpinauthpincontainer.md) | :heavy_minus_sign: | Requests a new pin id used in the authentication flow | {
"id": 308667304,
"code": "7RQZ",
"product": "0",
"trusted": false,
"qr": "https://plex.tv/api/v2/pins/qr/7RQZ",
"clientIdentifier": "string",
"location": {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
},
"expiresIn": 876,
"createdAt": "2024-07-16T17:03:05Z",
"expiresAt": "2024-07-16T17:18:05Z",
"authToken": null,
"newRegistration": null
} | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentscountry.md b/docs/models/operations/getplaylistcontentscountry.md deleted file mode 100644 index 0295516..0000000 --- a/docs/models/operations/getplaylistcontentscountry.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetPlaylistContentsCountry - - -## 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/getplaylistcontentsdirector.md b/docs/models/operations/getplaylistcontentsdirector.md deleted file mode 100644 index 4e3952c..0000000 --- a/docs/models/operations/getplaylistcontentsdirector.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetPlaylistContentsDirector - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Joss Whedon | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsgenre.md b/docs/models/operations/getplaylistcontentsgenre.md deleted file mode 100644 index ac5daab..0000000 --- a/docs/models/operations/getplaylistcontentsgenre.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetPlaylistContentsGenre - - -## 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/getplaylistcontentsmedia.md b/docs/models/operations/getplaylistcontentsmedia.md deleted file mode 100644 index 72e37ea..0000000 --- a/docs/models/operations/getplaylistcontentsmedia.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetPlaylistContentsMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `ID` | **int* | :heavy_minus_sign: | N/A | 15 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 141416 | -| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 2273 | -| `Width` | **int* | :heavy_minus_sign: | N/A | 1920 | -| `Height` | **int* | :heavy_minus_sign: | N/A | 814 | -| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 2.35 | -| `AudioChannels` | **int* | :heavy_minus_sign: | N/A | 2 | -| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | aac | -| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | h264 | -| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | 1080 | -| `Container` | **string* | :heavy_minus_sign: | N/A | mp4 | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p | -| `OptimizedForStreaming` | **int* | :heavy_minus_sign: | N/A | 0 | -| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | high | -| `Part` | [][operations.GetPlaylistContentsPart](../../models/operations/getplaylistcontentspart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsmediacontainer.md b/docs/models/operations/getplaylistcontentsmediacontainer.md deleted file mode 100644 index d78263d..0000000 --- a/docs/models/operations/getplaylistcontentsmediacontainer.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetPlaylistContentsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 2 | -| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/95/composite/1705717521 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 282 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 2 | -| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 95 | -| `Smart` | **bool* | :heavy_minus_sign: | N/A | true | -| `Title` | **string* | :heavy_minus_sign: | N/A | Smart Movie Playlist | -| `Metadata` | [][operations.GetPlaylistContentsMetadata](../../models/operations/getplaylistcontentsmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsmetadata.md b/docs/models/operations/getplaylistcontentsmetadata.md deleted file mode 100644 index f24b795..0000000 --- a/docs/models/operations/getplaylistcontentsmetadata.md +++ /dev/null @@ -1,39 +0,0 @@ -# GetPlaylistContentsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 17 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/17 | -| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | -| `Studio` | **string* | :heavy_minus_sign: | N/A | Universal Pictures | -| `Type` | **string* | :heavy_minus_sign: | N/A | movie | -| `Title` | **string* | :heavy_minus_sign: | N/A | Serenity | -| `TitleSort` | **string* | :heavy_minus_sign: | N/A | Amazing Spider-Man 2 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Movies | -| `LibrarySectionID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1 | -| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 | -| `Summary` | **string* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | -| `Rating` | **float64* | :heavy_minus_sign: | N/A | 8.2 | -| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 9.1 | -| `Year` | **int* | :heavy_minus_sign: | N/A | 2005 | -| `Tagline` | **string* | :heavy_minus_sign: | N/A | They aim to misbehave. | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 141416 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705637164 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705637165 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `HasPremiumExtras` | **string* | :heavy_minus_sign: | N/A | 1 | -| `HasPremiumPrimaryExtra` | **string* | :heavy_minus_sign: | N/A | 1 | -| `RatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `Media` | [][operations.GetPlaylistContentsMedia](../../models/operations/getplaylistcontentsmedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetPlaylistContentsGenre](../../models/operations/getplaylistcontentsgenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetPlaylistContentsCountry](../../models/operations/getplaylistcontentscountry.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetPlaylistContentsDirector](../../models/operations/getplaylistcontentsdirector.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetPlaylistContentsWriter](../../models/operations/getplaylistcontentswriter.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetPlaylistContentsRole](../../models/operations/getplaylistcontentsrole.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentspart.md b/docs/models/operations/getplaylistcontentspart.md deleted file mode 100644 index c2261dd..0000000 --- a/docs/models/operations/getplaylistcontentspart.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetPlaylistContentsPart - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 15 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/15/1705637151/file.mp4 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 141416 | -| `File` | **string* | :heavy_minus_sign: | N/A | /movies/Serenity (2005)/Serenity (2005).mp4 | -| `Size` | **int* | :heavy_minus_sign: | N/A | 40271948 | -| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | -| `Container` | **string* | :heavy_minus_sign: | N/A | mp4 | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | false | -| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | high | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsqueryparamtype.md b/docs/models/operations/getplaylistcontentsqueryparamtype.md deleted file mode 100644 index 897b464..0000000 --- a/docs/models/operations/getplaylistcontentsqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetPlaylistContentsQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| --------------------------------------------- | --------------------------------------------- | -| `GetPlaylistContentsQueryParamTypeMovie` | 1 | -| `GetPlaylistContentsQueryParamTypeTvShow` | 2 | -| `GetPlaylistContentsQueryParamTypeSeason` | 3 | -| `GetPlaylistContentsQueryParamTypeEpisode` | 4 | -| `GetPlaylistContentsQueryParamTypeArtist` | 5 | -| `GetPlaylistContentsQueryParamTypeAlbum` | 6 | -| `GetPlaylistContentsQueryParamTypeTrack` | 7 | -| `GetPlaylistContentsQueryParamTypePhotoAlbum` | 8 | -| `GetPlaylistContentsQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsrequest.md b/docs/models/operations/getplaylistcontentsrequest.md deleted file mode 100644 index 4c98222..0000000 --- a/docs/models/operations/getplaylistcontentsrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetPlaylistContentsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | | -| `Type` | [operations.GetPlaylistContentsQueryParamType](../../models/operations/getplaylistcontentsqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsresponse.md b/docs/models/operations/getplaylistcontentsresponse.md deleted file mode 100644 index 8b36b34..0000000 --- a/docs/models/operations/getplaylistcontentsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetPlaylistContentsResponseBody](../../models/operations/getplaylistcontentsresponsebody.md) | :heavy_minus_sign: | The playlist contents | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsresponsebody.md b/docs/models/operations/getplaylistcontentsresponsebody.md deleted file mode 100644 index 76bfd39..0000000 --- a/docs/models/operations/getplaylistcontentsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistContentsResponseBody - -The playlist contents - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetPlaylistContentsMediaContainer](../../models/operations/getplaylistcontentsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsrole.md b/docs/models/operations/getplaylistcontentsrole.md deleted file mode 100644 index afcf22d..0000000 --- a/docs/models/operations/getplaylistcontentsrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetPlaylistContentsRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Gina Torres | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentswriter.md b/docs/models/operations/getplaylistcontentswriter.md deleted file mode 100644 index 9f360cf..0000000 --- a/docs/models/operations/getplaylistcontentswriter.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetPlaylistContentsWriter - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Joss Whedon | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratordevice.md b/docs/models/operations/getplaylistgeneratordevice.md new file mode 100644 index 0000000..4fbf979 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratordevice.md @@ -0,0 +1,8 @@ +# GetPlaylistGeneratorDevice + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Profile` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorglobals.md b/docs/models/operations/getplaylistgeneratorglobals.md new file mode 100644 index 0000000..eb845c6 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorglobals.md @@ -0,0 +1,18 @@ +# GetPlaylistGeneratorGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritem.md b/docs/models/operations/getplaylistgeneratoritem.md new file mode 100644 index 0000000..413afcc --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritem.md @@ -0,0 +1,18 @@ +# GetPlaylistGeneratorItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `Composite` | **string* | :heavy_minus_sign: | The composite thumbnail image path | +| `Device` | [*operations.GetPlaylistGeneratorDevice](../../models/operations/getplaylistgeneratordevice.md) | :heavy_minus_sign: | N/A | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `Location` | [*operations.GetPlaylistGeneratorLocation](../../models/operations/getplaylistgeneratorlocation.md) | :heavy_minus_sign: | N/A | +| `MediaSettings` | [*operations.MediaSettings](../../models/operations/mediasettings.md) | :heavy_minus_sign: | N/A | +| `Policy` | [*operations.GetPlaylistGeneratorPolicy](../../models/operations/getplaylistgeneratorpolicy.md) | :heavy_minus_sign: | N/A | +| `Status` | [*operations.GetPlaylistGeneratorStatus](../../models/operations/getplaylistgeneratorstatus.md) | :heavy_minus_sign: | N/A | +| `Target` | **string* | :heavy_minus_sign: | N/A | +| `TargetTagID` | **int64* | :heavy_minus_sign: | The tag of this generator's settings | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | [*operations.GetPlaylistGeneratorType](../../models/operations/getplaylistgeneratortype.md) | :heavy_minus_sign: | The type of this generator | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritemsglobals.md b/docs/models/operations/getplaylistgeneratoritemsglobals.md new file mode 100644 index 0000000..41cab01 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritemsglobals.md @@ -0,0 +1,18 @@ +# GetPlaylistGeneratorItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritemsmediacontainer.md b/docs/models/operations/getplaylistgeneratoritemsmediacontainer.md new file mode 100644 index 0000000..ca327c7 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritemsmediacontainer.md @@ -0,0 +1,17 @@ +# GetPlaylistGeneratorItemsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [*operations.GetPlaylistGeneratorItemsMetadata](../../models/operations/getplaylistgeneratoritemsmetadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritemsmetadata.md b/docs/models/operations/getplaylistgeneratoritemsmetadata.md new file mode 100644 index 0000000..b61890f --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritemsmetadata.md @@ -0,0 +1,84 @@ +# GetPlaylistGeneratorItemsMetadata + +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `Media` | [][components.Media](../../models/components/media.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `ProcessingState` | [*operations.ProcessingState](../../models/operations/processingstate.md) | :heavy_minus_sign: | The state of processing if this generator is part of an optimizer playlist | +| `ProcessingStateContext` | [*operations.ProcessingStateContext](../../models/operations/processingstatecontext.md) | :heavy_minus_sign: | The error which could have occurred (or `good`) | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritemsrequest.md b/docs/models/operations/getplaylistgeneratoritemsrequest.md new file mode 100644 index 0000000..2f7c1d9 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritemsrequest.md @@ -0,0 +1,20 @@ +# GetPlaylistGeneratorItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `GeneratorID` | *int64* | :heavy_check_mark: | The generator item ID to delete. | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritemsresponse.md b/docs/models/operations/getplaylistgeneratoritemsresponse.md new file mode 100644 index 0000000..32a1edc --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritemsresponse.md @@ -0,0 +1,11 @@ +# GetPlaylistGeneratorItemsResponse + + +## 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.GetPlaylistGeneratorItemsResponseBody](../../models/operations/getplaylistgeneratoritemsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratoritemsresponsebody.md b/docs/models/operations/getplaylistgeneratoritemsresponsebody.md new file mode 100644 index 0000000..816d812 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratoritemsresponsebody.md @@ -0,0 +1,10 @@ +# GetPlaylistGeneratorItemsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetPlaylistGeneratorItemsMediaContainer](../../models/operations/getplaylistgeneratoritemsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorlocation.md b/docs/models/operations/getplaylistgeneratorlocation.md new file mode 100644 index 0000000..25f76c9 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorlocation.md @@ -0,0 +1,9 @@ +# GetPlaylistGeneratorLocation + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `LibrarySectionID` | **int64* | :heavy_minus_sign: | N/A | +| `URI` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratormediacontainer.md b/docs/models/operations/getplaylistgeneratormediacontainer.md new file mode 100644 index 0000000..1004c01 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratormediacontainer.md @@ -0,0 +1,17 @@ +# GetPlaylistGeneratorMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Item` | [][operations.GetPlaylistGeneratorItem](../../models/operations/getplaylistgeneratoritem.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorpolicy.md b/docs/models/operations/getplaylistgeneratorpolicy.md new file mode 100644 index 0000000..8871b1c --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorpolicy.md @@ -0,0 +1,10 @@ +# GetPlaylistGeneratorPolicy + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Scope` | [*operations.GetPlaylistGeneratorScope](../../models/operations/getplaylistgeneratorscope.md) | :heavy_minus_sign: | N/A | +| `Unwatched` | **bool* | :heavy_minus_sign: | True if only unwatched items are optimized | +| `Value` | **int64* | :heavy_minus_sign: | If the scope is count, the number of items to optimize | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorrequest.md b/docs/models/operations/getplaylistgeneratorrequest.md new file mode 100644 index 0000000..d1ef1ac --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorrequest.md @@ -0,0 +1,20 @@ +# GetPlaylistGeneratorRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `GeneratorID` | *int64* | :heavy_check_mark: | The generator item ID to delete. | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorresponse.md b/docs/models/operations/getplaylistgeneratorresponse.md new file mode 100644 index 0000000..b609f47 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorresponse.md @@ -0,0 +1,11 @@ +# GetPlaylistGeneratorResponse + + +## 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.GetPlaylistGeneratorResponseBody](../../models/operations/getplaylistgeneratorresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorresponsebody.md b/docs/models/operations/getplaylistgeneratorresponsebody.md new file mode 100644 index 0000000..bbf1b33 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorresponsebody.md @@ -0,0 +1,10 @@ +# GetPlaylistGeneratorResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetPlaylistGeneratorMediaContainer](../../models/operations/getplaylistgeneratormediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorscope.md b/docs/models/operations/getplaylistgeneratorscope.md new file mode 100644 index 0000000..ab7a988 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorscope.md @@ -0,0 +1,9 @@ +# GetPlaylistGeneratorScope + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `GetPlaylistGeneratorScopeAll` | all | +| `GetPlaylistGeneratorScopeCount` | count | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorsglobals.md b/docs/models/operations/getplaylistgeneratorsglobals.md new file mode 100644 index 0000000..ed20d93 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorsglobals.md @@ -0,0 +1,18 @@ +# GetPlaylistGeneratorsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorsmediacontainer.md b/docs/models/operations/getplaylistgeneratorsmediacontainer.md new file mode 100644 index 0000000..c35ce10 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorsmediacontainer.md @@ -0,0 +1,17 @@ +# GetPlaylistGeneratorsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `PlayQueueGenerator` | [][operations.PlayQueueGenerator](../../models/operations/playqueuegenerator.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorsrequest.md b/docs/models/operations/getplaylistgeneratorsrequest.md new file mode 100644 index 0000000..585ec10 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorsrequest.md @@ -0,0 +1,19 @@ +# GetPlaylistGeneratorsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorsresponse.md b/docs/models/operations/getplaylistgeneratorsresponse.md new file mode 100644 index 0000000..1d8aebd --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorsresponse.md @@ -0,0 +1,11 @@ +# GetPlaylistGeneratorsResponse + + +## 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.GetPlaylistGeneratorsResponseBody](../../models/operations/getplaylistgeneratorsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorsresponsebody.md b/docs/models/operations/getplaylistgeneratorsresponsebody.md new file mode 100644 index 0000000..dd3a0d4 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorsresponsebody.md @@ -0,0 +1,10 @@ +# GetPlaylistGeneratorsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetPlaylistGeneratorsMediaContainer](../../models/operations/getplaylistgeneratorsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorstate.md b/docs/models/operations/getplaylistgeneratorstate.md new file mode 100644 index 0000000..1daa0a3 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorstate.md @@ -0,0 +1,10 @@ +# GetPlaylistGeneratorState + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `GetPlaylistGeneratorStatePending` | pending | +| `GetPlaylistGeneratorStateComplete` | complete | +| `GetPlaylistGeneratorStateFailed` | failed | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorstatus.md b/docs/models/operations/getplaylistgeneratorstatus.md new file mode 100644 index 0000000..676ed03 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorstatus.md @@ -0,0 +1,12 @@ +# GetPlaylistGeneratorStatus + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ItemsCompleteCount` | **int64* | :heavy_minus_sign: | N/A | +| `ItemsCount` | **int64* | :heavy_minus_sign: | N/A | +| `ItemsSuccessfulCount` | **int64* | :heavy_minus_sign: | N/A | +| `State` | [*operations.GetPlaylistGeneratorState](../../models/operations/getplaylistgeneratorstate.md) | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorstype.md b/docs/models/operations/getplaylistgeneratorstype.md new file mode 100644 index 0000000..5b6a8c7 --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorstype.md @@ -0,0 +1,15 @@ +# GetPlaylistGeneratorsType + +The type of playlist generator. + + - -1: A smart playlist generator + - 42: A optimized version generator + + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `GetPlaylistGeneratorsTypeMinus1` | -1 | +| `GetPlaylistGeneratorsTypeFortyTwo` | 42 | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratorsubtitles.md b/docs/models/operations/getplaylistgeneratorsubtitles.md new file mode 100644 index 0000000..94a2e8a --- /dev/null +++ b/docs/models/operations/getplaylistgeneratorsubtitles.md @@ -0,0 +1,13 @@ +# GetPlaylistGeneratorSubtitles + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `GetPlaylistGeneratorSubtitlesAuto` | auto | +| `GetPlaylistGeneratorSubtitlesBurn` | burn | +| `GetPlaylistGeneratorSubtitlesNone` | none | +| `GetPlaylistGeneratorSubtitlesSidecar` | sidecar | +| `GetPlaylistGeneratorSubtitlesEmbedded` | embedded | +| `GetPlaylistGeneratorSubtitlesSegmented` | segmented | \ No newline at end of file diff --git a/docs/models/operations/getplaylistgeneratortype.md b/docs/models/operations/getplaylistgeneratortype.md new file mode 100644 index 0000000..bfe885e --- /dev/null +++ b/docs/models/operations/getplaylistgeneratortype.md @@ -0,0 +1,11 @@ +# GetPlaylistGeneratorType + +The type of this generator + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `GetPlaylistGeneratorTypeMinus1` | -1 | +| `GetPlaylistGeneratorTypeFortyTwo` | 42 | \ No newline at end of file diff --git a/docs/models/operations/getplaylistglobals.md b/docs/models/operations/getplaylistglobals.md new file mode 100644 index 0000000..2b9ac29 --- /dev/null +++ b/docs/models/operations/getplaylistglobals.md @@ -0,0 +1,18 @@ +# GetPlaylistGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getplaylistitemsglobals.md b/docs/models/operations/getplaylistitemsglobals.md new file mode 100644 index 0000000..5324f25 --- /dev/null +++ b/docs/models/operations/getplaylistitemsglobals.md @@ -0,0 +1,18 @@ +# GetPlaylistItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getplaylistitemsrequest.md b/docs/models/operations/getplaylistitemsrequest.md new file mode 100644 index 0000000..99df7e3 --- /dev/null +++ b/docs/models/operations/getplaylistitemsrequest.md @@ -0,0 +1,20 @@ +# GetPlaylistItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `Type` | []*int64* | :heavy_minus_sign: | The metadata types of the item to return. Values past the first are only used in fetching items from the background processing playlist. | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistitemsresponse.md b/docs/models/operations/getplaylistitemsresponse.md new file mode 100644 index 0000000..e13fe3f --- /dev/null +++ b/docs/models/operations/getplaylistitemsresponse.md @@ -0,0 +1,12 @@ +# GetPlaylistItemsResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistmediacontainer.md b/docs/models/operations/getplaylistmediacontainer.md deleted file mode 100644 index e6db8e1..0000000 --- a/docs/models/operations/getplaylistmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetPlaylistMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Metadata` | [][operations.GetPlaylistMetadata](../../models/operations/getplaylistmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistmetadata.md b/docs/models/operations/getplaylistmetadata.md deleted file mode 100644 index 28aa76a..0000000 --- a/docs/models/operations/getplaylistmetadata.md +++ /dev/null @@ -1,22 +0,0 @@ -# GetPlaylistMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `Content` | **string* | :heavy_minus_sign: | N/A | library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26push%3D1%26title%3D2%26or%3D1%26title%3DSerenity%26pop%3D1 | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 95 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/95/items | -| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://87425529-380f-44b8-a689-9a0537e7ec91 | -| `Type` | **string* | :heavy_minus_sign: | N/A | playlist | -| `Title` | **string* | :heavy_minus_sign: | N/A | Smart Movie Playlist | -| `Summary` | **string* | :heavy_minus_sign: | N/A | | -| `Smart` | **bool* | :heavy_minus_sign: | N/A | true | -| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video | -| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/95/composite/1705717387 | -| `Icon` | **string* | :heavy_minus_sign: | N/A | playlist://image.smart | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 282000 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 2 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705716493 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705717387 | \ No newline at end of file diff --git a/docs/models/operations/getplaylistrequest.md b/docs/models/operations/getplaylistrequest.md index 4415f1b..a71c4ee 100644 --- a/docs/models/operations/getplaylistrequest.md +++ b/docs/models/operations/getplaylistrequest.md @@ -3,6 +3,17 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :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 index 86b165f..33bcbf1 100644 --- a/docs/models/operations/getplaylistresponse.md +++ b/docs/models/operations/getplaylistresponse.md @@ -3,9 +3,9 @@ ## 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.GetPlaylistResponseBody](../../models/operations/getplaylistresponsebody.md) | :heavy_minus_sign: | The playlist | \ No newline at end of file +| 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getplaylistresponsebody.md b/docs/models/operations/getplaylistresponsebody.md deleted file mode 100644 index 5e3e758..0000000 --- a/docs/models/operations/getplaylistresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistResponseBody - -The playlist - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetPlaylistMediaContainer](../../models/operations/getplaylistmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistsmediacontainer.md b/docs/models/operations/getplaylistsmediacontainer.md deleted file mode 100644 index e81c558..0000000 --- a/docs/models/operations/getplaylistsmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetPlaylistsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Size` | **int* | :heavy_minus_sign: | N/A | 4 | -| `Metadata` | [][operations.GetPlaylistsMetadata](../../models/operations/getplaylistsmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getplaylistsmetadata.md b/docs/models/operations/getplaylistsmetadata.md deleted file mode 100644 index ccb1ab8..0000000 --- a/docs/models/operations/getplaylistsmetadata.md +++ /dev/null @@ -1,23 +0,0 @@ -# GetPlaylistsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 92 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/92/items | -| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://7ca5aaef-58e8-4828-9e21-c009c97f2903 | -| `Type` | **string* | :heavy_minus_sign: | N/A | playlist | -| `Title` | **string* | :heavy_minus_sign: | N/A | Static Playlist | -| `Summary` | **string* | :heavy_minus_sign: | N/A | A Great Playlist | -| `Smart` | **bool* | :heavy_minus_sign: | N/A | false | -| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video | -| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/92/composite/1705716440 | -| `Icon` | **string* | :heavy_minus_sign: | N/A | playlist://image.smart | -| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1705716298 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 7328000 | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 32 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705716298 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705716440 | \ No newline at end of file diff --git a/docs/models/operations/getplaylistsrequest.md b/docs/models/operations/getplaylistsrequest.md deleted file mode 100644 index 522c518..0000000 --- a/docs/models/operations/getplaylistsrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index eb699fa..0000000 --- a/docs/models/operations/getplaylistsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetPlaylistsResponseBody](../../models/operations/getplaylistsresponsebody.md) | :heavy_minus_sign: | returns all playlists | \ No newline at end of file diff --git a/docs/models/operations/getplaylistsresponsebody.md b/docs/models/operations/getplaylistsresponsebody.md deleted file mode 100644 index dde101c..0000000 --- a/docs/models/operations/getplaylistsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistsResponseBody - -returns all playlists - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetPlaylistsMediaContainer](../../models/operations/getplaylistsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplayqueueglobals.md b/docs/models/operations/getplayqueueglobals.md new file mode 100644 index 0000000..f53cc4f --- /dev/null +++ b/docs/models/operations/getplayqueueglobals.md @@ -0,0 +1,18 @@ +# GetPlayQueueGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getplayqueuerequest.md b/docs/models/operations/getplayqueuerequest.md new file mode 100644 index 0000000..07d2ea7 --- /dev/null +++ b/docs/models/operations/getplayqueuerequest.md @@ -0,0 +1,24 @@ +# GetPlayQueueRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | +| `Own` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | If the server should transfer ownership to the requesting client (used in remote control scenarios). | 1 | +| `Center` | **string* | :heavy_minus_sign: | The play queue item ID for the center of the window - this doesn't change the current selected item. | | +| `Window` | **int64* | :heavy_minus_sign: | How many items on each side of the center of the window | | +| `IncludeBefore` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether to include the items before the center (if 0, center is not included either), defaults to 1. | 1 | +| `IncludeAfter` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether to include the items after the center (if 0, center is not included either), defaults to 1. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getplayqueueresponse.md b/docs/models/operations/getplayqueueresponse.md new file mode 100644 index 0000000..41d8503 --- /dev/null +++ b/docs/models/operations/getplayqueueresponse.md @@ -0,0 +1,11 @@ +# GetPlayQueueResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpostplayhubsglobals.md b/docs/models/operations/getpostplayhubsglobals.md new file mode 100644 index 0000000..5a920f7 --- /dev/null +++ b/docs/models/operations/getpostplayhubsglobals.md @@ -0,0 +1,18 @@ +# GetPostplayHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getpostplayhubsrequest.md b/docs/models/operations/getpostplayhubsrequest.md new file mode 100644 index 0000000..456d44b --- /dev/null +++ b/docs/models/operations/getpostplayhubsrequest.md @@ -0,0 +1,21 @@ +# GetPostplayHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `MetadataID` | *int64* | :heavy_check_mark: | The metadata ID for the hubs to fetch | | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `OnlyTransient` | [*components.BoolInt](../../models/components/boolint.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) | 1 | \ No newline at end of file diff --git a/docs/models/operations/getpostplayhubsresponse.md b/docs/models/operations/getpostplayhubsresponse.md new file mode 100644 index 0000000..6ec06c7 --- /dev/null +++ b/docs/models/operations/getpostplayhubsresponse.md @@ -0,0 +1,12 @@ +# GetPostplayHubsResponse + + +## 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 | +| `MediaContainerWithHubs` | [*components.MediaContainerWithHubs](../../models/components/mediacontainerwithhubs.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpreferenceglobals.md b/docs/models/operations/getpreferenceglobals.md new file mode 100644 index 0000000..667b781 --- /dev/null +++ b/docs/models/operations/getpreferenceglobals.md @@ -0,0 +1,18 @@ +# GetPreferenceGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getpreferencerequest.md b/docs/models/operations/getpreferencerequest.md new file mode 100644 index 0000000..c2b2c11 --- /dev/null +++ b/docs/models/operations/getpreferencerequest.md @@ -0,0 +1,19 @@ +# GetPreferenceRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `ID` | **string* | :heavy_minus_sign: | The preference to fetch | | \ No newline at end of file diff --git a/docs/models/operations/getpreferenceresponse.md b/docs/models/operations/getpreferenceresponse.md new file mode 100644 index 0000000..7060d57 --- /dev/null +++ b/docs/models/operations/getpreferenceresponse.md @@ -0,0 +1,11 @@ +# GetPreferenceResponse + + +## 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 | +| `MediaContainerWithSettings` | [*components.MediaContainerWithSettings](../../models/components/mediacontainerwithsettings.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpromotedhubsglobals.md b/docs/models/operations/getpromotedhubsglobals.md new file mode 100644 index 0000000..25c0b3a --- /dev/null +++ b/docs/models/operations/getpromotedhubsglobals.md @@ -0,0 +1,18 @@ +# GetPromotedHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getpromotedhubsmediacontainer.md b/docs/models/operations/getpromotedhubsmediacontainer.md new file mode 100644 index 0000000..58f6369 --- /dev/null +++ b/docs/models/operations/getpromotedhubsmediacontainer.md @@ -0,0 +1,17 @@ +# GetPromotedHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpromotedhubsrequest.md b/docs/models/operations/getpromotedhubsrequest.md new file mode 100644 index 0000000..877bfb2 --- /dev/null +++ b/docs/models/operations/getpromotedhubsrequest.md @@ -0,0 +1,19 @@ +# GetPromotedHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | \ No newline at end of file diff --git a/docs/models/operations/getpromotedhubsresponse.md b/docs/models/operations/getpromotedhubsresponse.md new file mode 100644 index 0000000..87424fc --- /dev/null +++ b/docs/models/operations/getpromotedhubsresponse.md @@ -0,0 +1,12 @@ +# GetPromotedHubsResponse + + +## 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.GetPromotedHubsResponseBody](../../models/operations/getpromotedhubsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpromotedhubsresponsebody.md b/docs/models/operations/getpromotedhubsresponsebody.md new file mode 100644 index 0000000..92ecf37 --- /dev/null +++ b/docs/models/operations/getpromotedhubsresponsebody.md @@ -0,0 +1,10 @@ +# GetPromotedHubsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetPromotedHubsMediaContainer](../../models/operations/getpromotedhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrandomartworkglobals.md b/docs/models/operations/getrandomartworkglobals.md new file mode 100644 index 0000000..809a42a --- /dev/null +++ b/docs/models/operations/getrandomartworkglobals.md @@ -0,0 +1,18 @@ +# GetRandomArtworkGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getrandomartworkrequest.md b/docs/models/operations/getrandomartworkrequest.md new file mode 100644 index 0000000..398e3fc --- /dev/null +++ b/docs/models/operations/getrandomartworkrequest.md @@ -0,0 +1,19 @@ +# GetRandomArtworkRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Sections` | []*int64* | :heavy_minus_sign: | The sections for which to fetch artwork. | [
5,
6
] | \ No newline at end of file diff --git a/docs/models/operations/getrandomartworkresponse.md b/docs/models/operations/getrandomartworkresponse.md new file mode 100644 index 0000000..8228159 --- /dev/null +++ b/docs/models/operations/getrandomartworkresponse.md @@ -0,0 +1,11 @@ +# GetRandomArtworkResponse + + +## 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 | +| `MediaContainerWithArtwork` | [*components.MediaContainerWithArtwork](../../models/components/mediacontainerwithartwork.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedactivedirection.md b/docs/models/operations/getrecentlyaddedactivedirection.md deleted file mode 100644 index e5e674a..0000000 --- a/docs/models/operations/getrecentlyaddedactivedirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetRecentlyAddedActiveDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| ------------------------------------------- | ------------------------------------------- | -| `GetRecentlyAddedActiveDirectionAscending` | asc | -| `GetRecentlyAddedActiveDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddeddefaultdirection.md b/docs/models/operations/getrecentlyaddeddefaultdirection.md deleted file mode 100644 index 7152a2a..0000000 --- a/docs/models/operations/getrecentlyaddeddefaultdirection.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetRecentlyAddedDefaultDirection - -The direction of the sort. Can be either `asc` or `desc`. - - - -## Values - -| Name | Value | -| -------------------------------------------- | -------------------------------------------- | -| `GetRecentlyAddedDefaultDirectionAscending` | asc | -| `GetRecentlyAddedDefaultDirectionDescending` | desc | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedfield.md b/docs/models/operations/getrecentlyaddedfield.md deleted file mode 100644 index d9982a1..0000000 --- a/docs/models/operations/getrecentlyaddedfield.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRecentlyAddedField - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | show.title | -| `Title` | *string* | :heavy_check_mark: | N/A | Show Title | -| `Type` | *string* | :heavy_check_mark: | N/A | string | -| `SubType` | **string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedfieldtype.md b/docs/models/operations/getrecentlyaddedfieldtype.md deleted file mode 100644 index 0fbbb02..0000000 --- a/docs/models/operations/getrecentlyaddedfieldtype.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetRecentlyAddedFieldType - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Type` | *string* | :heavy_check_mark: | N/A | tag | -| `Operator` | [][operations.GetRecentlyAddedOperator](../../models/operations/getrecentlyaddedoperator.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedfilter.md b/docs/models/operations/getrecentlyaddedfilter.md deleted file mode 100644 index 053ae9d..0000000 --- a/docs/models/operations/getrecentlyaddedfilter.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetRecentlyAddedFilter - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `Filter` | *string* | :heavy_check_mark: | N/A | genre | -| `FilterType` | *string* | :heavy_check_mark: | N/A | string | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | -| `Title` | *string* | :heavy_check_mark: | N/A | Genre | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | -| `Advanced` | **bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedhubsresponsetype.md b/docs/models/operations/getrecentlyaddedhubsresponsetype.md deleted file mode 100644 index 3abc583..0000000 --- a/docs/models/operations/getrecentlyaddedhubsresponsetype.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRecentlyAddedHubsResponseType - - -## Values - -| Name | Value | -| --------------------------------------------- | --------------------------------------------- | -| `GetRecentlyAddedHubsResponseTypeCoverPoster` | coverPoster | -| `GetRecentlyAddedHubsResponseTypeBackground` | background | -| `GetRecentlyAddedHubsResponseTypeSnapshot` | snapshot | -| `GetRecentlyAddedHubsResponseTypeClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedhubstype.md b/docs/models/operations/getrecentlyaddedhubstype.md deleted file mode 100644 index d0efe87..0000000 --- a/docs/models/operations/getrecentlyaddedhubstype.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetRecentlyAddedHubsType - -The type of media content in the Plex library. This can represent videos, music, or photos. - - - -## Values - -| Name | Value | -| ------------------------------------ | ------------------------------------ | -| `GetRecentlyAddedHubsTypeMovie` | movie | -| `GetRecentlyAddedHubsTypeTvShow` | show | -| `GetRecentlyAddedHubsTypeSeason` | season | -| `GetRecentlyAddedHubsTypeEpisode` | episode | -| `GetRecentlyAddedHubsTypeArtist` | artist | -| `GetRecentlyAddedHubsTypeAlbum` | album | -| `GetRecentlyAddedHubsTypeTrack` | track | -| `GetRecentlyAddedHubsTypePhotoAlbum` | photoalbum | -| `GetRecentlyAddedHubsTypePhoto` | photo | -| `GetRecentlyAddedHubsTypeCollection` | collection | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedimage.md b/docs/models/operations/getrecentlyaddedimage.md deleted file mode 100644 index f23d340..0000000 --- a/docs/models/operations/getrecentlyaddedimage.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRecentlyAddedImage - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | -| `Type` | [operations.GetRecentlyAddedHubsResponseType](../../models/operations/getrecentlyaddedhubsresponsetype.md) | :heavy_check_mark: | N/A | background | -| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarycountry.md b/docs/models/operations/getrecentlyaddedlibrarycountry.md deleted file mode 100644 index 3dd4caa..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarycountry.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetRecentlyAddedLibraryCountry - - -## 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/getrecentlyaddedlibrarydirector.md b/docs/models/operations/getrecentlyaddedlibrarydirector.md deleted file mode 100644 index b8138d4..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarydirector.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetRecentlyAddedLibraryDirector - - -## 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/getrecentlyaddedlibraryfilter.md b/docs/models/operations/getrecentlyaddedlibraryfilter.md deleted file mode 100644 index 76e1d9c..0000000 --- a/docs/models/operations/getrecentlyaddedlibraryfilter.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetRecentlyAddedLibraryFilter - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `Filter` | *string* | :heavy_check_mark: | N/A | genre | -| `FilterType` | *string* | :heavy_check_mark: | N/A | string | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | -| `Title` | *string* | :heavy_check_mark: | N/A | Genre | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | -| `Advanced` | **bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarygenre.md b/docs/models/operations/getrecentlyaddedlibrarygenre.md deleted file mode 100644 index 03605d8..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarygenre.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetRecentlyAddedLibraryGenre - - -## 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/getrecentlyaddedlibrarymedia.md b/docs/models/operations/getrecentlyaddedlibrarymedia.md deleted file mode 100644 index 44ed5e7..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarymedia.md +++ /dev/null @@ -1,23 +0,0 @@ -# GetRecentlyAddedLibraryMedia - - -## 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.GetRecentlyAddedLibraryPart](../../models/operations/getrecentlyaddedlibrarypart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarymediacontainer.md b/docs/models/operations/getrecentlyaddedlibrarymediacontainer.md deleted file mode 100644 index 8daf95d..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarymediacontainer.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetRecentlyAddedLibraryMediaContainer - -The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Type` | [][operations.GetRecentlyAddedLibraryType](../../models/operations/getrecentlyaddedlibrarytype.md) | :heavy_minus_sign: | N/A | | -| `FieldType` | [][operations.FieldType](../../models/operations/fieldtype.md) | :heavy_minus_sign: | N/A | | -| `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.GetRecentlyAddedLibraryMetadata](../../models/operations/getrecentlyaddedlibrarymetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarymetadata.md b/docs/models/operations/getrecentlyaddedlibrarymetadata.md deleted file mode 100644 index ab8e189..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarymetadata.md +++ /dev/null @@ -1,39 +0,0 @@ -# GetRecentlyAddedLibraryMetadata - - -## 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.GetRecentlyAddedLibraryMedia](../../models/operations/getrecentlyaddedlibrarymedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetRecentlyAddedLibraryGenre](../../models/operations/getrecentlyaddedlibrarygenre.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetRecentlyAddedLibraryDirector](../../models/operations/getrecentlyaddedlibrarydirector.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetRecentlyAddedLibraryWriter](../../models/operations/getrecentlyaddedlibrarywriter.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetRecentlyAddedLibraryCountry](../../models/operations/getrecentlyaddedlibrarycountry.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetRecentlyAddedLibraryRole](../../models/operations/getrecentlyaddedlibraryrole.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarypart.md b/docs/models/operations/getrecentlyaddedlibrarypart.md deleted file mode 100644 index 2cfbcd0..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarypart.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetRecentlyAddedLibraryPart - - -## 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/getrecentlyaddedlibraryrequest.md b/docs/models/operations/getrecentlyaddedlibraryrequest.md deleted file mode 100644 index 55a060f..0000000 --- a/docs/models/operations/getrecentlyaddedlibraryrequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetRecentlyAddedLibraryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentDirectoryID` | **int64* | :heavy_minus_sign: | N/A | 2 | -| `PinnedContentDirectoryID` | []*int64* | :heavy_minus_sign: | N/A | [
3,
5,
7,
13,
12,
1,
6,
14,
2,
10,
16,
17
] | -| `SectionID` | **int64* | :heavy_minus_sign: | The library section ID for filtering content. | 2 | -| `Type` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `IncludeMeta` | [*operations.QueryParamIncludeMeta](../../models/operations/queryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | -| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | -| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibraryresponse.md b/docs/models/operations/getrecentlyaddedlibraryresponse.md deleted file mode 100644 index 768ce6f..0000000 --- a/docs/models/operations/getrecentlyaddedlibraryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRecentlyAddedLibraryResponse - - -## 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.GetRecentlyAddedLibraryResponseBody](../../models/operations/getrecentlyaddedlibraryresponsebody.md) | :heavy_minus_sign: | The recently added content | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibraryresponsebody.md b/docs/models/operations/getrecentlyaddedlibraryresponsebody.md deleted file mode 100644 index 4469751..0000000 --- a/docs/models/operations/getrecentlyaddedlibraryresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRecentlyAddedLibraryResponseBody - -The recently added content - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetRecentlyAddedLibraryMediaContainer](../../models/operations/getrecentlyaddedlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibraryrole.md b/docs/models/operations/getrecentlyaddedlibraryrole.md deleted file mode 100644 index f1b8636..0000000 --- a/docs/models/operations/getrecentlyaddedlibraryrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetRecentlyAddedLibraryRole - - -## 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/getrecentlyaddedlibrarytype.md b/docs/models/operations/getrecentlyaddedlibrarytype.md deleted file mode 100644 index 4cc5871..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarytype.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetRecentlyAddedLibraryType - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | -| `Subtype` | **string* | :heavy_minus_sign: | N/A | clip | -| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows | -| `Active` | *bool* | :heavy_check_mark: | N/A | false | -| `Filter` | [][operations.GetRecentlyAddedLibraryFilter](../../models/operations/getrecentlyaddedlibraryfilter.md) | :heavy_minus_sign: | N/A | | -| `Sort` | [][operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | N/A | | -| `Field` | [][operations.Field](../../models/operations/field.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarywriter.md b/docs/models/operations/getrecentlyaddedlibrarywriter.md deleted file mode 100644 index 4c79e32..0000000 --- a/docs/models/operations/getrecentlyaddedlibrarywriter.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetRecentlyAddedLibraryWriter - - -## 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/operations/getrecentlyaddedmediacontainer.md b/docs/models/operations/getrecentlyaddedmediacontainer.md deleted file mode 100644 index 77a49ab..0000000 --- a/docs/models/operations/getrecentlyaddedmediacontainer.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetRecentlyAddedMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `TotalSize` | *int* | :heavy_check_mark: | Total number of media items in the library. | 50 | -| `Offset` | *int64* | :heavy_check_mark: | Offset value for pagination. | 0 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `Meta` | [*operations.Meta](../../models/operations/meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | -| `Metadata` | [][operations.GetRecentlyAddedMetadata](../../models/operations/getrecentlyaddedmetadata.md) | :heavy_minus_sign: | An array of metadata items. | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedmetadata.md b/docs/models/operations/getrecentlyaddedmetadata.md deleted file mode 100644 index fa34213..0000000 --- a/docs/models/operations/getrecentlyaddedmetadata.md +++ /dev/null @@ -1,85 +0,0 @@ -# GetRecentlyAddedMetadata - -Unknown - - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AddedAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `Art` | *string* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright | -| `AudienceRating` | *float64* | :heavy_check_mark: | The audience rating for the media item. | 9.2 | -| `ChapterSource` | **string* | :heavy_minus_sign: | The source from which chapter data is derived. | media | -| `ChildCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 | -| `ContentRating` | **string* | :heavy_minus_sign: | The content rating for the media item. | PG-13 | -| `CreatedAtAccuracy` | **string* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local | -| `CreatedAtTZOffset` | **string* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 | -| `Duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 | -| `GrandparentGUID` | **string* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 | -| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 | -| `GrandparentSlug` | **string* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 | -| `GrandparentTheme` | **string* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica | -| `GUID` | *string* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 | -| `Index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 | -| `Key` | *string* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 | -| `LastRatedAt` | **int64* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 | -| `LeafCount` | **int* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The identifier for the library section. | 1 | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | The key corresponding to the library section. | /library/sections/1 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | Movies | -| `OriginalTitle` | **string* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | The original release date of the media item. | 2022-12-14 | -| `ParentGUID` | **string* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `ParentIndex` | **int* | :heavy_minus_sign: | The index position of the parent media item. | 1 | -| `ParentKey` | **string* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent media item. | 66 | -| `ParentSlug` | **string* | :heavy_minus_sign: | The slug for the parent media item. | alice-in-borderland-2020 | -| `ParentStudio` | *string* | :heavy_check_mark: | The studio of the parent media item. | UCP | -| `ParentTheme` | *string* | :heavy_check_mark: | The theme URL for the parent media item. | /library/metadata/66/theme/1705716261 | -| `ParentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 | -| `ParentTitle` | **string* | :heavy_minus_sign: | The title of the parent media item. | Caprica | -| `ParentYear` | **int* | :heavy_minus_sign: | The release year of the parent media item. | 2010 | -| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 | -| `RatingImage` | **string* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe | -| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 | -| `Rating` | *float32* | :heavy_check_mark: | The critic rating for the media item. | 7.6 | -| `SeasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 | -| `SkipCount` | **int* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 | -| `Slug` | *string* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas | -| `Studio` | **string* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios | -| `Subtype` | **string* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip | -| `Summary` | *string* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.
Once a familiar threat returns to finish what was previously started, Jake must
work with Neytiri and the army of the Na'vi race to protect their home.
| -| `Tagline` | *string* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. | -| `Theme` | *string* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 | -| `Thumb` | *string* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 | -| `TitleSort` | *string* | :heavy_check_mark: | The sort title used for ordering media items. | Whale | -| `Title` | *string* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water | -| `Type` | [operations.GetRecentlyAddedHubsType](../../models/operations/getrecentlyaddedhubstype.md) | :heavy_check_mark: | N/A | movie | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | -| `UserRating` | **float32* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 | -| `ViewCount` | **int* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 | -| `ViewOffset` | **int* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 | -| `Year` | **int* | :heavy_minus_sign: | The release year of the media item. | 2022 | -| `Image` | [][operations.GetRecentlyAddedImage](../../models/operations/getrecentlyaddedimage.md) | :heavy_minus_sign: | N/A | | -| `UltraBlurColors` | [*operations.UltraBlurColors](../../models/operations/ultrablurcolors.md) | :heavy_minus_sign: | N/A | | -| `Guids` | [][operations.Guids](../../models/operations/guids.md) | :heavy_minus_sign: | N/A | | -| `Media` | [][operations.Media](../../models/operations/media.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.Genre](../../models/operations/genre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.Country](../../models/operations/country.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 | | -| `Role` | [][operations.Role](../../models/operations/role.md) | :heavy_minus_sign: | N/A | | -| `Producer` | [][operations.Producer](../../models/operations/producer.md) | :heavy_minus_sign: | N/A | | -| `Rating1` | [][operations.Rating](../../models/operations/rating.md) | :heavy_minus_sign: | N/A | | -| `Similar` | [][operations.Similar](../../models/operations/similar.md) | :heavy_minus_sign: | N/A | | -| `Location` | [][operations.Location](../../models/operations/location.md) | :heavy_minus_sign: | N/A | | -| `Collection` | [][operations.Collection](../../models/operations/collection.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedoperator.md b/docs/models/operations/getrecentlyaddedoperator.md deleted file mode 100644 index 19071c5..0000000 --- a/docs/models/operations/getrecentlyaddedoperator.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetRecentlyAddedOperator - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | = | -| `Title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedoptimizedforstreaming.md b/docs/models/operations/getrecentlyaddedoptimizedforstreaming.md deleted file mode 100644 index 8e88efa..0000000 --- a/docs/models/operations/getrecentlyaddedoptimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetRecentlyAddedOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### GetRecentlyAddedOptimizedForStreaming1 - -```go -getRecentlyAddedOptimizedForStreaming := operations.CreateGetRecentlyAddedOptimizedForStreamingGetRecentlyAddedOptimizedForStreaming1(operations.GetRecentlyAddedOptimizedForStreaming1{/* values here */}) -``` - -### - -```go -getRecentlyAddedOptimizedForStreaming := operations.CreateGetRecentlyAddedOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getrecentlyaddedoptimizedforstreaming1.md b/docs/models/operations/getrecentlyaddedoptimizedforstreaming1.md deleted file mode 100644 index 4bd115a..0000000 --- a/docs/models/operations/getrecentlyaddedoptimizedforstreaming1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetRecentlyAddedOptimizedForStreaming1 - - -## Values - -| Name | Value | -| -------------------------------------------- | -------------------------------------------- | -| `GetRecentlyAddedOptimizedForStreaming1Zero` | 0 | -| `GetRecentlyAddedOptimizedForStreaming1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedrequest.md b/docs/models/operations/getrecentlyaddedrequest.md deleted file mode 100644 index 9911f8d..0000000 --- a/docs/models/operations/getrecentlyaddedrequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetRecentlyAddedRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentDirectoryID` | *int64* | :heavy_check_mark: | The content directory ID. | | -| `PinnedContentDirectoryID` | **string* | :heavy_minus_sign: | Comma-separated list of pinned content directory IDs. | | -| `SectionID` | **int64* | :heavy_minus_sign: | The library section ID for filtering content. | 2 | -| `Type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `IncludeMeta` | [*operations.IncludeMeta](../../models/operations/includemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | -| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | -| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedresponse.md b/docs/models/operations/getrecentlyaddedresponse.md deleted file mode 100644 index c185043..0000000 --- a/docs/models/operations/getrecentlyaddedresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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: | A successful response with recently added content. | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedresponsebody.md b/docs/models/operations/getrecentlyaddedresponsebody.md deleted file mode 100644 index 8868e86..0000000 --- a/docs/models/operations/getrecentlyaddedresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRecentlyAddedResponseBody - -A successful response with 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/getrecentlyaddedsort.md b/docs/models/operations/getrecentlyaddedsort.md deleted file mode 100644 index c191614..0000000 --- a/docs/models/operations/getrecentlyaddedsort.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetRecentlyAddedSort - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `Default` | **string* | :heavy_minus_sign: | N/A | asc | -| `Active` | **bool* | :heavy_minus_sign: | N/A | false | -| `ActiveDirection` | [*operations.GetRecentlyAddedActiveDirection](../../models/operations/getrecentlyaddedactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DefaultDirection` | [*operations.GetRecentlyAddedDefaultDirection](../../models/operations/getrecentlyaddeddefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc | -| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | -| `Key` | *string* | :heavy_check_mark: | N/A | titleSort | -| `Title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedtype.md b/docs/models/operations/getrecentlyaddedtype.md deleted file mode 100644 index 7c13584..0000000 --- a/docs/models/operations/getrecentlyaddedtype.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetRecentlyAddedType - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | -| `Type` | *string* | :heavy_check_mark: | N/A | filter | -| `Subtype` | **string* | :heavy_minus_sign: | N/A | clip | -| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows | -| `Active` | *bool* | :heavy_check_mark: | N/A | false | -| `Filter` | [][operations.GetRecentlyAddedFilter](../../models/operations/getrecentlyaddedfilter.md) | :heavy_minus_sign: | N/A | | -| `Sort` | [][operations.GetRecentlyAddedSort](../../models/operations/getrecentlyaddedsort.md) | :heavy_minus_sign: | N/A | | -| `Field` | [][operations.GetRecentlyAddedField](../../models/operations/getrecentlyaddedfield.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrefreshlibrarymetadatarequest.md b/docs/models/operations/getrefreshlibrarymetadatarequest.md deleted file mode 100644 index 6605721..0000000 --- a/docs/models/operations/getrefreshlibrarymetadatarequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetRefreshLibraryMetadataRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `Force` | [*operations.Force](../../models/operations/force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file diff --git a/docs/models/operations/getrefreshlibrarymetadataresponse.md b/docs/models/operations/getrefreshlibrarymetadataresponse.md deleted file mode 100644 index 1c8e65f..0000000 --- a/docs/models/operations/getrefreshlibrarymetadataresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRefreshLibraryMetadataResponse - - -## 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/getrelatedhubsglobals.md b/docs/models/operations/getrelatedhubsglobals.md new file mode 100644 index 0000000..bb03a34 --- /dev/null +++ b/docs/models/operations/getrelatedhubsglobals.md @@ -0,0 +1,18 @@ +# GetRelatedHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getrelatedhubsrequest.md b/docs/models/operations/getrelatedhubsrequest.md new file mode 100644 index 0000000..0d8c41b --- /dev/null +++ b/docs/models/operations/getrelatedhubsrequest.md @@ -0,0 +1,21 @@ +# GetRelatedHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `MetadataID` | *int64* | :heavy_check_mark: | The metadata ID for the hubs to fetch | | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `OnlyTransient` | [*components.BoolInt](../../models/components/boolint.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) | 1 | \ No newline at end of file diff --git a/docs/models/operations/getrelatedhubsresponse.md b/docs/models/operations/getrelatedhubsresponse.md new file mode 100644 index 0000000..3cb8cd4 --- /dev/null +++ b/docs/models/operations/getrelatedhubsresponse.md @@ -0,0 +1,12 @@ +# GetRelatedHubsResponse + + +## 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 | +| `MediaContainerWithHubs` | [*components.MediaContainerWithHubs](../../models/components/mediacontainerwithhubs.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrelateditemsglobals.md b/docs/models/operations/getrelateditemsglobals.md new file mode 100644 index 0000000..02704b2 --- /dev/null +++ b/docs/models/operations/getrelateditemsglobals.md @@ -0,0 +1,18 @@ +# GetRelatedItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getrelateditemsmediacontainer.md b/docs/models/operations/getrelateditemsmediacontainer.md new file mode 100644 index 0000000..6df6760 --- /dev/null +++ b/docs/models/operations/getrelateditemsmediacontainer.md @@ -0,0 +1,17 @@ +# GetRelatedItemsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrelateditemsrequest.md b/docs/models/operations/getrelateditemsrequest.md new file mode 100644 index 0000000..2061259 --- /dev/null +++ b/docs/models/operations/getrelateditemsrequest.md @@ -0,0 +1,19 @@ +# GetRelatedItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrelateditemsresponse.md b/docs/models/operations/getrelateditemsresponse.md new file mode 100644 index 0000000..83facd2 --- /dev/null +++ b/docs/models/operations/getrelateditemsresponse.md @@ -0,0 +1,11 @@ +# GetRelatedItemsResponse + + +## 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.GetRelatedItemsResponseBody](../../models/operations/getrelateditemsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getrelateditemsresponsebody.md b/docs/models/operations/getrelateditemsresponsebody.md new file mode 100644 index 0000000..0083625 --- /dev/null +++ b/docs/models/operations/getrelateditemsresponsebody.md @@ -0,0 +1,10 @@ +# GetRelatedItemsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetRelatedItemsMediaContainer](../../models/operations/getrelateditemsmediacontainer.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 deleted file mode 100644 index 01f81f1..0000000 --- a/docs/models/operations/getresizedphotorequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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 deleted file mode 100644 index ce8e6dc..0000000 --- a/docs/models/operations/getresizedphotoresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/getresourcesstatisticsmediacontainer.md b/docs/models/operations/getresourcesstatisticsmediacontainer.md deleted file mode 100644 index 7177cf9..0000000 --- a/docs/models/operations/getresourcesstatisticsmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetResourcesStatisticsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 5497 | -| `StatisticsResources` | [][operations.StatisticsResources](../../models/operations/statisticsresources.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getresourcesstatisticsrequest.md b/docs/models/operations/getresourcesstatisticsrequest.md deleted file mode 100644 index 689d41b..0000000 --- a/docs/models/operations/getresourcesstatisticsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetResourcesStatisticsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/getresourcesstatisticsresponse.md b/docs/models/operations/getresourcesstatisticsresponse.md deleted file mode 100644 index 7d0c840..0000000 --- a/docs/models/operations/getresourcesstatisticsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetResourcesStatisticsResponse - - -## 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.GetResourcesStatisticsResponseBody](../../models/operations/getresourcesstatisticsresponsebody.md) | :heavy_minus_sign: | Resource Statistics | \ No newline at end of file diff --git a/docs/models/operations/getresourcesstatisticsresponsebody.md b/docs/models/operations/getresourcesstatisticsresponsebody.md deleted file mode 100644 index a46453d..0000000 --- a/docs/models/operations/getresourcesstatisticsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetResourcesStatisticsResponseBody - -Resource Statistics - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetResourcesStatisticsMediaContainer](../../models/operations/getresourcesstatisticsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getscheduledrecordingsmediacontainer.md b/docs/models/operations/getscheduledrecordingsmediacontainer.md new file mode 100644 index 0000000..e7ca80b --- /dev/null +++ b/docs/models/operations/getscheduledrecordingsmediacontainer.md @@ -0,0 +1,17 @@ +# GetScheduledRecordingsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `MediaGrabOperation` | [][components.MediaGrabOperation](../../models/components/mediagraboperation.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getscheduledrecordingsresponse.md b/docs/models/operations/getscheduledrecordingsresponse.md new file mode 100644 index 0000000..5937d7e --- /dev/null +++ b/docs/models/operations/getscheduledrecordingsresponse.md @@ -0,0 +1,12 @@ +# GetScheduledRecordingsResponse + + +## 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.GetScheduledRecordingsResponseBody](../../models/operations/getscheduledrecordingsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getscheduledrecordingsresponsebody.md b/docs/models/operations/getscheduledrecordingsresponsebody.md new file mode 100644 index 0000000..4578e4a --- /dev/null +++ b/docs/models/operations/getscheduledrecordingsresponsebody.md @@ -0,0 +1,10 @@ +# GetScheduledRecordingsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetScheduledRecordingsMediaContainer](../../models/operations/getscheduledrecordingsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariescountry.md b/docs/models/operations/getsearchalllibrariescountry.md deleted file mode 100644 index 31bb5c7..0000000 --- a/docs/models/operations/getsearchalllibrariescountry.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSearchAllLibrariesCountry - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the country.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesdirector.md b/docs/models/operations/getsearchalllibrariesdirector.md deleted file mode 100644 index c8b19a0..0000000 --- a/docs/models/operations/getsearchalllibrariesdirector.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesDirector - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the director. | 126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the director. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesdirectory.md b/docs/models/operations/getsearchalllibrariesdirectory.md deleted file mode 100644 index 22c78db..0000000 --- a/docs/models/operations/getsearchalllibrariesdirectory.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetSearchAllLibrariesDirectory - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | The unique identifier path for the search result item. | /library/sections/3/all?actor=197429 | -| `LibrarySectionID` | *int64* | :heavy_check_mark: | The identifier for the library section. | 1 | -| `LibrarySectionKey` | *string* | :heavy_check_mark: | The key corresponding to the library section. | /library/sections/1 | -| `LibrarySectionTitle` | *string* | :heavy_check_mark: | The title of the library section. | Movies | -| `LibrarySectionType` | **int64* | :heavy_minus_sign: | N/A | | -| `Type` | *string* | :heavy_check_mark: | The type of the directory. | tag | -| `ID` | *int64* | :heavy_check_mark: | N/A | 197429 | -| `Filter` | **string* | :heavy_minus_sign: | The filter string used to query this specific item in the library. | actor=197429 | -| `Tag` | *string* | :heavy_check_mark: | N/A | Ben Stiller | -| `TagType` | **int64* | :heavy_minus_sign: | The type of tag associated with this search result (e.g., Director, Actor). | | -| `TagKey` | **string* | :heavy_minus_sign: | The unique identifier for the tag associated with this search result. | 5d776826999c64001ec2c606 | -| `Thumb` | **string* | :heavy_minus_sign: | The URL to the thumbnail image associated with this search result. | https://metadata-static.plex.tv/5/people/57bd7c7d6c5c9e2881251b30e5603d3d.jpg | -| `Count` | **int64* | :heavy_minus_sign: | The number of items associated with this search result. | 10 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesflattenseasons.md b/docs/models/operations/getsearchalllibrariesflattenseasons.md deleted file mode 100644 index 042a04c..0000000 --- a/docs/models/operations/getsearchalllibrariesflattenseasons.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetSearchAllLibrariesFlattenSeasons - -Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). - - - -## Values - -| Name | Value | -| --------------------------------------------------- | --------------------------------------------------- | -| `GetSearchAllLibrariesFlattenSeasonsLibraryDefault` | -1 | -| `GetSearchAllLibrariesFlattenSeasonsHide` | 0 | -| `GetSearchAllLibrariesFlattenSeasonsShow` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesgenre.md b/docs/models/operations/getsearchalllibrariesgenre.md deleted file mode 100644 index f7019a9..0000000 --- a/docs/models/operations/getsearchalllibrariesgenre.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSearchAllLibrariesGenre - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the genre.
NOTE: This is different for each Plex server and is not globally unique.
| 259 | -| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item
| Crime | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesguids.md b/docs/models/operations/getsearchalllibrariesguids.md deleted file mode 100644 index e836c27..0000000 --- a/docs/models/operations/getsearchalllibrariesguids.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetSearchAllLibrariesGuids - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
| {
"imdbExample": {
"summary": "IMDB example",
"value": "imdb://tt13015952"
},
"tmdbExample": {
"summary": "TMDB example",
"value": "tmdb://2434012"
},
"tvdbExample": {
"summary": "TVDB example",
"value": "tvdb://7945991"
}
} | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrarieshasthumbnail.md b/docs/models/operations/getsearchalllibrarieshasthumbnail.md deleted file mode 100644 index b3da44f..0000000 --- a/docs/models/operations/getsearchalllibrarieshasthumbnail.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetSearchAllLibrariesHasThumbnail - -Indicates if the part has a thumbnail. - - - -## Values - -| Name | Value | -| ---------------------------------------- | ---------------------------------------- | -| `GetSearchAllLibrariesHasThumbnailFalse` | 0 | -| `GetSearchAllLibrariesHasThumbnailTrue` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesimage.md b/docs/models/operations/getsearchalllibrariesimage.md deleted file mode 100644 index 930a024..0000000 --- a/docs/models/operations/getsearchalllibrariesimage.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesImage - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | -| `Type` | [operations.GetSearchAllLibrariesLibraryType](../../models/operations/getsearchalllibrarieslibrarytype.md) | :heavy_check_mark: | N/A | background | -| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrarieslibraryoptimizedforstreaming.md b/docs/models/operations/getsearchalllibrarieslibraryoptimizedforstreaming.md deleted file mode 100644 index 9942ebc..0000000 --- a/docs/models/operations/getsearchalllibrarieslibraryoptimizedforstreaming.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetSearchAllLibrariesLibraryOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - - -## Supported Types - -### GetSearchAllLibrariesOptimizedForStreamingLibrary1 - -```go -getSearchAllLibrariesLibraryOptimizedForStreaming := operations.CreateGetSearchAllLibrariesLibraryOptimizedForStreamingGetSearchAllLibrariesOptimizedForStreamingLibrary1(operations.GetSearchAllLibrariesOptimizedForStreamingLibrary1{/* values here */}) -``` - -### - -```go -getSearchAllLibrariesLibraryOptimizedForStreaming := operations.CreateGetSearchAllLibrariesLibraryOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getsearchalllibrarieslibrarytype.md b/docs/models/operations/getsearchalllibrarieslibrarytype.md deleted file mode 100644 index 57def26..0000000 --- a/docs/models/operations/getsearchalllibrarieslibrarytype.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesLibraryType - - -## Values - -| Name | Value | -| --------------------------------------------- | --------------------------------------------- | -| `GetSearchAllLibrariesLibraryTypeCoverPoster` | coverPoster | -| `GetSearchAllLibrariesLibraryTypeBackground` | background | -| `GetSearchAllLibrariesLibraryTypeSnapshot` | snapshot | -| `GetSearchAllLibrariesLibraryTypeClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrarieslocation.md b/docs/models/operations/getsearchalllibrarieslocation.md deleted file mode 100644 index 520d682..0000000 --- a/docs/models/operations/getsearchalllibrarieslocation.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesLocation - -The folder path for the media item. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `Path` | *string* | :heavy_check_mark: | N/A | /TV Shows/Clarkson's Farm | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesmedia.md b/docs/models/operations/getsearchalllibrariesmedia.md deleted file mode 100644 index 51bd1ff..0000000 --- a/docs/models/operations/getsearchalllibrariesmedia.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetSearchAllLibrariesMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 | -| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 | -| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 | -| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 | -| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 | -| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 | -| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | aac | -| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc | -| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k | -| `Container` | **string* | :heavy_minus_sign: | Container format of the media. | mp4 | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p
| 24p | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 | -| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | Indicates whether voice activity is detected. | false | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `OptimizedForStreaming` | [*operations.GetSearchAllLibrariesOptimizedForStreaming](../../models/operations/getsearchalllibrariesoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | Indicates whether the media has 64-bit offsets.
This is relevant for media files that may require larger offsets than what 32-bit integers can provide.
| false | -| `Part` | [][operations.GetSearchAllLibrariesPart](../../models/operations/getsearchalllibrariespart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesmediacontainer.md b/docs/models/operations/getsearchalllibrariesmediacontainer.md deleted file mode 100644 index 7df7f99..0000000 --- a/docs/models/operations/getsearchalllibrariesmediacontainer.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetSearchAllLibrariesMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The unique identifier for the library section. | 2 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | TV Series | -| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | The universally unique identifier for the library section. | e69655a2-ef48-4aba-bb19-0cc34d1e7d36 | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `SearchResult` | [][operations.SearchResult](../../models/operations/searchresult.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesmetadata.md b/docs/models/operations/getsearchalllibrariesmetadata.md deleted file mode 100644 index 3aa2522..0000000 --- a/docs/models/operations/getsearchalllibrariesmetadata.md +++ /dev/null @@ -1,82 +0,0 @@ -# GetSearchAllLibrariesMetadata - -Unknown - - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 | -| `Key` | *string* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 | -| `GUID` | *string* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 | -| `Slug` | *string* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas | -| `Studio` | **string* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios | -| `Type` | [operations.GetSearchAllLibrariesType](../../models/operations/getsearchalllibrariestype.md) | :heavy_check_mark: | N/A | movie | -| `Title` | *string* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water | -| `Banner` | *string* | :heavy_check_mark: | The banner image URL for the media item. | /library/metadata/58683/banner/1703239236 | -| `TitleSort` | *string* | :heavy_check_mark: | The sort title used for ordering media items. | Whale | -| `ContentRating` | **string* | :heavy_minus_sign: | The content rating for the media item. | PG-13 | -| `Summary` | *string* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.
Once a familiar threat returns to finish what was previously started, Jake must
work with Neytiri and the army of the Na'vi race to protect their home.
| -| `Rating` | *float32* | :heavy_check_mark: | The critic rating for the media item. | 7.6 | -| `AudienceRating` | *float64* | :heavy_check_mark: | The audience rating for the media item. | 9.2 | -| `Year` | **int* | :heavy_minus_sign: | The release year of the media item. | 2022 | -| `Tagline` | *string* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. | -| `Thumb` | *string* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 | -| `Art` | *string* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 | -| `Theme` | *string* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 | -| `Index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 | -| `LeafCount` | **int* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 | -| `ViewedLeafCount` | **int* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 | -| `ChildCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 | -| `SeasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 | -| `Duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | The original release date of the media item. | 2022-12-14 | -| `AddedAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | -| `ParentYear` | **int* | :heavy_minus_sign: | The release year of the parent media item. | 2010 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright | -| `ChapterSource` | **string* | :heavy_minus_sign: | The source from which chapter data is derived. | media | -| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 | -| `OriginalTitle` | **string* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent media item. | 66 | -| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 | -| `ParentGUID` | **string* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentGUID` | **string* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 | -| `GrandparentSlug` | **string* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 | -| `ParentKey` | **string* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 | -| `GrandparentTheme` | **string* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 | -| `ParentTitle` | **string* | :heavy_minus_sign: | The title of the parent media item. | Caprica | -| `ParentIndex` | **int* | :heavy_minus_sign: | The index position of the parent media item. | 1 | -| `ParentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 | -| `RatingImage` | **string* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe | -| `ViewCount` | **int* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 | -| `ViewOffset` | **int* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 | -| `SkipCount` | **int* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 | -| `Subtype` | **string* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip | -| `LastRatedAt` | **int64* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 | -| `CreatedAtAccuracy` | **string* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local | -| `CreatedAtTZOffset` | **string* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 | -| `LastViewedAt` | **int* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 | -| `UserRating` | **float32* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 | -| `Image` | [][operations.GetSearchAllLibrariesImage](../../models/operations/getsearchalllibrariesimage.md) | :heavy_minus_sign: | N/A | | -| `UltraBlurColors` | [*operations.GetSearchAllLibrariesUltraBlurColors](../../models/operations/getsearchalllibrariesultrablurcolors.md) | :heavy_minus_sign: | N/A | | -| `Guids` | [][operations.GetSearchAllLibrariesGuids](../../models/operations/getsearchalllibrariesguids.md) | :heavy_minus_sign: | N/A | | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The identifier for the library section. | 1 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | The title of the library section. | Movies | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | The key corresponding to the library section. | /library/sections/1 | -| `ShowOrdering` | [*operations.GetSearchAllLibrariesShowOrdering](../../models/operations/getsearchalllibrariesshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show.
Options:
- None = Library default
- tmdbAiring = The Movie Database (Aired)
- aired = TheTVDB (Aired)
- dvd = TheTVDB (DVD)
- absolute = TheTVDB (Absolute)
| absolute | -| `FlattenSeasons` | [*operations.GetSearchAllLibrariesFlattenSeasons](../../models/operations/getsearchalllibrariesflattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
| 1 | -| `SkipChildren` | **bool* | :heavy_minus_sign: | Indicates whether child items should be skipped. | false | -| `Media` | [][operations.GetSearchAllLibrariesMedia](../../models/operations/getsearchalllibrariesmedia.md) | :heavy_minus_sign: | N/A | | -| `Genre` | [][operations.GetSearchAllLibrariesGenre](../../models/operations/getsearchalllibrariesgenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetSearchAllLibrariesCountry](../../models/operations/getsearchalllibrariescountry.md) | :heavy_minus_sign: | N/A | | -| `Director` | [][operations.GetSearchAllLibrariesDirector](../../models/operations/getsearchalllibrariesdirector.md) | :heavy_minus_sign: | N/A | | -| `Writer` | [][operations.GetSearchAllLibrariesWriter](../../models/operations/getsearchalllibrarieswriter.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetSearchAllLibrariesRole](../../models/operations/getsearchalllibrariesrole.md) | :heavy_minus_sign: | N/A | | -| `Location` | [][operations.GetSearchAllLibrariesLocation](../../models/operations/getsearchalllibrarieslocation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesoptimizedforstreaming.md b/docs/models/operations/getsearchalllibrariesoptimizedforstreaming.md deleted file mode 100644 index 75cbc5f..0000000 --- a/docs/models/operations/getsearchalllibrariesoptimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetSearchAllLibrariesOptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### GetSearchAllLibrariesOptimizedForStreaming1 - -```go -getSearchAllLibrariesOptimizedForStreaming := operations.CreateGetSearchAllLibrariesOptimizedForStreamingGetSearchAllLibrariesOptimizedForStreaming1(operations.GetSearchAllLibrariesOptimizedForStreaming1{/* values here */}) -``` - -### - -```go -getSearchAllLibrariesOptimizedForStreaming := operations.CreateGetSearchAllLibrariesOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/getsearchalllibrariesoptimizedforstreaming1.md b/docs/models/operations/getsearchalllibrariesoptimizedforstreaming1.md deleted file mode 100644 index 8a629bd..0000000 --- a/docs/models/operations/getsearchalllibrariesoptimizedforstreaming1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSearchAllLibrariesOptimizedForStreaming1 - - -## Values - -| Name | Value | -| ------------------------------------------------- | ------------------------------------------------- | -| `GetSearchAllLibrariesOptimizedForStreaming1Zero` | 0 | -| `GetSearchAllLibrariesOptimizedForStreaming1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesoptimizedforstreaminglibrary1.md b/docs/models/operations/getsearchalllibrariesoptimizedforstreaminglibrary1.md deleted file mode 100644 index d81ed15..0000000 --- a/docs/models/operations/getsearchalllibrariesoptimizedforstreaminglibrary1.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSearchAllLibrariesOptimizedForStreamingLibrary1 - - -## Values - -| Name | Value | -| -------------------------------------------------------- | -------------------------------------------------------- | -| `GetSearchAllLibrariesOptimizedForStreamingLibrary1Zero` | 0 | -| `GetSearchAllLibrariesOptimizedForStreamingLibrary1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariespart.md b/docs/models/operations/getsearchalllibrariespart.md deleted file mode 100644 index 7b8a0d6..0000000 --- a/docs/models/operations/getsearchalllibrariespart.md +++ /dev/null @@ -1,22 +0,0 @@ -# GetSearchAllLibrariesPart - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true | -| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true | -| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 | -| `Key` | **string* | :heavy_minus_sign: | Key to access this part. | /library/parts/418385/1735864239/file.mkv | -| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 | -| `File` | **string* | :heavy_minus_sign: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv | -| `Size` | **int64* | :heavy_minus_sign: | File size in bytes. | 30649952104 | -| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 | -| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | [*operations.GetSearchAllLibrariesLibraryOptimizedForStreaming](../../models/operations/getsearchalllibrarieslibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
| | -| `HasThumbnail` | [*operations.GetSearchAllLibrariesHasThumbnail](../../models/operations/getsearchalllibrarieshasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesqueryparamincludecollections.md b/docs/models/operations/getsearchalllibrariesqueryparamincludecollections.md deleted file mode 100644 index 6afe2cf..0000000 --- a/docs/models/operations/getsearchalllibrariesqueryparamincludecollections.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesQueryParamIncludeCollections - -Whether to include collections in the search results. - - -## Values - -| Name | Value | -| ---------------------------------------------------------- | ---------------------------------------------------------- | -| `GetSearchAllLibrariesQueryParamIncludeCollectionsDisable` | 0 | -| `GetSearchAllLibrariesQueryParamIncludeCollectionsEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesqueryparamincludeexternalmedia.md b/docs/models/operations/getsearchalllibrariesqueryparamincludeexternalmedia.md deleted file mode 100644 index 86ded0e..0000000 --- a/docs/models/operations/getsearchalllibrariesqueryparamincludeexternalmedia.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesQueryParamIncludeExternalMedia - -Whether to include external media in the search results. - - -## Values - -| Name | Value | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| `GetSearchAllLibrariesQueryParamIncludeExternalMediaDisable` | 0 | -| `GetSearchAllLibrariesQueryParamIncludeExternalMediaEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesrequest.md b/docs/models/operations/getsearchalllibrariesrequest.md deleted file mode 100644 index 3728667..0000000 --- a/docs/models/operations/getsearchalllibrariesrequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetSearchAllLibrariesRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Query` | *string* | :heavy_check_mark: | The search query term. | | -| `ClientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `Limit` | **int64* | :heavy_minus_sign: | Limit the number of results returned. | | -| `SearchTypes` | [][operations.SearchTypes](../../models/operations/searchtypes.md) | :heavy_minus_sign: | A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
| movies,music,otherVideos,people,tv | -| `IncludeCollections` | [*operations.GetSearchAllLibrariesQueryParamIncludeCollections](../../models/operations/getsearchalllibrariesqueryparamincludecollections.md) | :heavy_minus_sign: | Whether to include collections in the search results. | 1 | -| `IncludeExternalMedia` | [*operations.GetSearchAllLibrariesQueryParamIncludeExternalMedia](../../models/operations/getsearchalllibrariesqueryparamincludeexternalmedia.md) | :heavy_minus_sign: | Whether to include external media in the search results. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesresponse.md b/docs/models/operations/getsearchalllibrariesresponse.md deleted file mode 100644 index e33dfc5..0000000 --- a/docs/models/operations/getsearchalllibrariesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesResponse - - -## 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.GetSearchAllLibrariesResponseBody](../../models/operations/getsearchalllibrariesresponsebody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesresponsebody.md b/docs/models/operations/getsearchalllibrariesresponsebody.md deleted file mode 100644 index 53f1d14..0000000 --- a/docs/models/operations/getsearchalllibrariesresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesResponseBody - -The libraries available on the Server - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [operations.GetSearchAllLibrariesMediaContainer](../../models/operations/getsearchalllibrariesmediacontainer.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesrole.md b/docs/models/operations/getsearchalllibrariesrole.md deleted file mode 100644 index 90db51e..0000000 --- a/docs/models/operations/getsearchalllibrariesrole.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the role.
NOTE: This is different for each Plex server and is not globally unique.
| 126522 | -| `Tag` | *string* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller | -| `Role` | **string* | :heavy_minus_sign: | The role played by the actor in the media item. | Self - Judge | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the actor. | https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesshowordering.md b/docs/models/operations/getsearchalllibrariesshowordering.md deleted file mode 100644 index 79f6f07..0000000 --- a/docs/models/operations/getsearchalllibrariesshowordering.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetSearchAllLibrariesShowOrdering - -Setting that indicates the episode ordering for the show. -Options: - - None = Library default - - tmdbAiring = The Movie Database (Aired) - - aired = TheTVDB (Aired) - - dvd = TheTVDB (DVD) - - absolute = TheTVDB (Absolute) - - - -## Values - -| Name | Value | -| ----------------------------------------------- | ----------------------------------------------- | -| `GetSearchAllLibrariesShowOrderingNone` | None | -| `GetSearchAllLibrariesShowOrderingTmdbAiring` | tmdbAiring | -| `GetSearchAllLibrariesShowOrderingTvdbAired` | aired | -| `GetSearchAllLibrariesShowOrderingTvdbDvd` | dvd | -| `GetSearchAllLibrariesShowOrderingTvdbAbsolute` | absolute | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariestype.md b/docs/models/operations/getsearchalllibrariestype.md deleted file mode 100644 index db506e3..0000000 --- a/docs/models/operations/getsearchalllibrariestype.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetSearchAllLibrariesType - -The type of media content in the Plex library. This can represent videos, music, or photos. - - - -## Values - -| Name | Value | -| ------------------------------------- | ------------------------------------- | -| `GetSearchAllLibrariesTypeMovie` | movie | -| `GetSearchAllLibrariesTypeTvShow` | show | -| `GetSearchAllLibrariesTypeSeason` | season | -| `GetSearchAllLibrariesTypeEpisode` | episode | -| `GetSearchAllLibrariesTypeArtist` | artist | -| `GetSearchAllLibrariesTypeAlbum` | album | -| `GetSearchAllLibrariesTypeTrack` | track | -| `GetSearchAllLibrariesTypePhotoAlbum` | photoalbum | -| `GetSearchAllLibrariesTypePhoto` | photo | -| `GetSearchAllLibrariesTypeCollection` | collection | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrariesultrablurcolors.md b/docs/models/operations/getsearchalllibrariesultrablurcolors.md deleted file mode 100644 index 7b4e5d1..0000000 --- a/docs/models/operations/getsearchalllibrariesultrablurcolors.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesUltraBlurColors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `TopLeft` | *string* | :heavy_check_mark: | N/A | 11333b | -| `TopRight` | *string* | :heavy_check_mark: | N/A | 0a232d | -| `BottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | -| `BottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/models/operations/getsearchalllibrarieswriter.md b/docs/models/operations/getsearchalllibrarieswriter.md deleted file mode 100644 index 2069cdd..0000000 --- a/docs/models/operations/getsearchalllibrarieswriter.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesWriter - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the writer. | 126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the writer. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/operations/getsearchlibrarymediacontainer.md b/docs/models/operations/getsearchlibrarymediacontainer.md deleted file mode 100644 index bfa6115..0000000 --- a/docs/models/operations/getsearchlibrarymediacontainer.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetSearchLibraryMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 2 | -| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false | -| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/show-fanart.jpg | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `MediaTagVersion` | **int* | :heavy_minus_sign: | N/A | 1698860922 | -| `Nocache` | **bool* | :heavy_minus_sign: | N/A | true | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/show.png | -| `Title1` | **string* | :heavy_minus_sign: | N/A | TV Shows | -| `Title2` | **string* | :heavy_minus_sign: | N/A | Search for '' | -| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | season | -| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65593 | -| `Metadata` | [][operations.GetSearchLibraryMetadata](../../models/operations/getsearchlibrarymetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchlibrarymetadata.md b/docs/models/operations/getsearchlibrarymetadata.md deleted file mode 100644 index 0d3c187..0000000 --- a/docs/models/operations/getsearchlibrarymetadata.md +++ /dev/null @@ -1,27 +0,0 @@ -# GetSearchLibraryMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 2 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/2/children | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | N/A | 1 | -| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://season/602e67e766dfdb002c0a1b5b | -| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c086c7d06d9001ffd27aa | -| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | Mutant Enemy Productions | -| `Type` | **string* | :heavy_minus_sign: | N/A | season | -| `Title` | **string* | :heavy_minus_sign: | N/A | Season 1 | -| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1 | -| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Firefly | -| `Summary` | **string* | :heavy_minus_sign: | N/A | Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship "Serenity". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government "The Alliance"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space. | -| `Index` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ParentYear` | **int* | :heavy_minus_sign: | N/A | 2002 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/2/thumb/1705636920 | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/art/1705636920 | -| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/thumb/1705636920 | -| `ParentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705636916 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705636920 | \ No newline at end of file diff --git a/docs/models/operations/getsearchlibraryqueryparamtype.md b/docs/models/operations/getsearchlibraryqueryparamtype.md deleted file mode 100644 index 20ab5a5..0000000 --- a/docs/models/operations/getsearchlibraryqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetSearchLibraryQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| ------------------------------------------ | ------------------------------------------ | -| `GetSearchLibraryQueryParamTypeMovie` | 1 | -| `GetSearchLibraryQueryParamTypeTvShow` | 2 | -| `GetSearchLibraryQueryParamTypeSeason` | 3 | -| `GetSearchLibraryQueryParamTypeEpisode` | 4 | -| `GetSearchLibraryQueryParamTypeArtist` | 5 | -| `GetSearchLibraryQueryParamTypeAlbum` | 6 | -| `GetSearchLibraryQueryParamTypeTrack` | 7 | -| `GetSearchLibraryQueryParamTypePhotoAlbum` | 8 | -| `GetSearchLibraryQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/getsearchlibraryrequest.md b/docs/models/operations/getsearchlibraryrequest.md deleted file mode 100644 index 324ffab..0000000 --- a/docs/models/operations/getsearchlibraryrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSearchLibraryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `Type` | [operations.GetSearchLibraryQueryParamType](../../models/operations/getsearchlibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/models/operations/getsearchlibraryresponse.md b/docs/models/operations/getsearchlibraryresponse.md deleted file mode 100644 index 991030e..0000000 --- a/docs/models/operations/getsearchlibraryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchLibraryResponse - - -## 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.GetSearchLibraryResponseBody](../../models/operations/getsearchlibraryresponsebody.md) | :heavy_minus_sign: | The contents of the library by section and type | \ No newline at end of file diff --git a/docs/models/operations/getsearchlibraryresponsebody.md b/docs/models/operations/getsearchlibraryresponsebody.md deleted file mode 100644 index 1093c8a..0000000 --- a/docs/models/operations/getsearchlibraryresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchLibraryResponseBody - -The contents of the library by section and type - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetSearchLibraryMediaContainer](../../models/operations/getsearchlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultscountry.md b/docs/models/operations/getsearchresultscountry.md deleted file mode 100644 index 058a20d..0000000 --- a/docs/models/operations/getsearchresultscountry.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index dbd2668..0000000 --- a/docs/models/operations/getsearchresultsdirector.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index cd364c6..0000000 --- a/docs/models/operations/getsearchresultsgenre.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index 1a15f87..0000000 --- a/docs/models/operations/getsearchresultsmedia.md +++ /dev/null @@ -1,22 +0,0 @@ -# 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 deleted file mode 100644 index 1364cb5..0000000 --- a/docs/models/operations/getsearchresultsmediacontainer.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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 deleted file mode 100644 index 9d49381..0000000 --- a/docs/models/operations/getsearchresultsmetadata.md +++ /dev/null @@ -1,41 +0,0 @@ -# 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 deleted file mode 100644 index bcaf866..0000000 --- a/docs/models/operations/getsearchresultspart.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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 deleted file mode 100644 index 7318f58..0000000 --- a/docs/models/operations/getsearchresultsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index 34dfeec..0000000 --- a/docs/models/operations/getsearchresultsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 39a7a54..0000000 --- a/docs/models/operations/getsearchresultsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 7d66cdf..0000000 --- a/docs/models/operations/getsearchresultsrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index c710954..0000000 --- a/docs/models/operations/getsearchresultswriter.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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/getsectionfiltersglobals.md b/docs/models/operations/getsectionfiltersglobals.md new file mode 100644 index 0000000..5a26e15 --- /dev/null +++ b/docs/models/operations/getsectionfiltersglobals.md @@ -0,0 +1,18 @@ +# GetSectionFiltersGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsectionfiltersmediacontainer.md b/docs/models/operations/getsectionfiltersmediacontainer.md new file mode 100644 index 0000000..eac2fca --- /dev/null +++ b/docs/models/operations/getsectionfiltersmediacontainer.md @@ -0,0 +1,17 @@ +# GetSectionFiltersMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][components.Directory](../../models/components/directory.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsectionfiltersrequest.md b/docs/models/operations/getsectionfiltersrequest.md new file mode 100644 index 0000000..26e18c8 --- /dev/null +++ b/docs/models/operations/getsectionfiltersrequest.md @@ -0,0 +1,19 @@ +# GetSectionFiltersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/getsectionfiltersresponse.md b/docs/models/operations/getsectionfiltersresponse.md new file mode 100644 index 0000000..0fb31f2 --- /dev/null +++ b/docs/models/operations/getsectionfiltersresponse.md @@ -0,0 +1,11 @@ +# GetSectionFiltersResponse + + +## 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.GetSectionFiltersResponseBody](../../models/operations/getsectionfiltersresponsebody.md) | :heavy_minus_sign: | The filters on the section | \ No newline at end of file diff --git a/docs/models/operations/getsectionfiltersresponsebody.md b/docs/models/operations/getsectionfiltersresponsebody.md new file mode 100644 index 0000000..28cb505 --- /dev/null +++ b/docs/models/operations/getsectionfiltersresponsebody.md @@ -0,0 +1,10 @@ +# GetSectionFiltersResponseBody + +The filters on the section + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetSectionFiltersMediaContainer](../../models/operations/getsectionfiltersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsectionhubsglobals.md b/docs/models/operations/getsectionhubsglobals.md new file mode 100644 index 0000000..097a640 --- /dev/null +++ b/docs/models/operations/getsectionhubsglobals.md @@ -0,0 +1,18 @@ +# GetSectionHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsectionhubsmediacontainer.md b/docs/models/operations/getsectionhubsmediacontainer.md new file mode 100644 index 0000000..72d8e60 --- /dev/null +++ b/docs/models/operations/getsectionhubsmediacontainer.md @@ -0,0 +1,17 @@ +# GetSectionHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsectionhubsrequest.md b/docs/models/operations/getsectionhubsrequest.md new file mode 100644 index 0000000..f17b10a --- /dev/null +++ b/docs/models/operations/getsectionhubsrequest.md @@ -0,0 +1,21 @@ +# GetSectionHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to fetch | | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `OnlyTransient` | [*components.BoolInt](../../models/components/boolint.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) | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsectionhubsresponse.md b/docs/models/operations/getsectionhubsresponse.md new file mode 100644 index 0000000..a1a55ec --- /dev/null +++ b/docs/models/operations/getsectionhubsresponse.md @@ -0,0 +1,12 @@ +# GetSectionHubsResponse + + +## 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.GetSectionHubsResponseBody](../../models/operations/getsectionhubsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsectionhubsresponsebody.md b/docs/models/operations/getsectionhubsresponsebody.md new file mode 100644 index 0000000..48019e0 --- /dev/null +++ b/docs/models/operations/getsectionhubsresponsebody.md @@ -0,0 +1,10 @@ +# GetSectionHubsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetSectionHubsMediaContainer](../../models/operations/getsectionhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsectionimageglobals.md b/docs/models/operations/getsectionimageglobals.md new file mode 100644 index 0000000..67abb7b --- /dev/null +++ b/docs/models/operations/getsectionimageglobals.md @@ -0,0 +1,18 @@ +# GetSectionImageGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsectionimagerequest.md b/docs/models/operations/getsectionimagerequest.md new file mode 100644 index 0000000..1c5dcc9 --- /dev/null +++ b/docs/models/operations/getsectionimagerequest.md @@ -0,0 +1,22 @@ +# GetSectionImageRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `UpdatedAt` | *int64* | :heavy_check_mark: | The update time of the image. Used for busting cache. | | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | +| `Composite` | [*components.Composite](../../models/components/composite.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsectionimageresponse.md b/docs/models/operations/getsectionimageresponse.md new file mode 100644 index 0000000..d198305 --- /dev/null +++ b/docs/models/operations/getsectionimageresponse.md @@ -0,0 +1,10 @@ +# GetSectionImageResponse + + +## 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/getsectionpreferencesglobals.md b/docs/models/operations/getsectionpreferencesglobals.md new file mode 100644 index 0000000..fbc9769 --- /dev/null +++ b/docs/models/operations/getsectionpreferencesglobals.md @@ -0,0 +1,18 @@ +# GetSectionPreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsectionpreferencesrequest.md b/docs/models/operations/getsectionpreferencesrequest.md new file mode 100644 index 0000000..9c750e9 --- /dev/null +++ b/docs/models/operations/getsectionpreferencesrequest.md @@ -0,0 +1,20 @@ +# GetSectionPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Agent` | **string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsectionpreferencesresponse.md b/docs/models/operations/getsectionpreferencesresponse.md new file mode 100644 index 0000000..fb9f117 --- /dev/null +++ b/docs/models/operations/getsectionpreferencesresponse.md @@ -0,0 +1,11 @@ +# GetSectionPreferencesResponse + + +## 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 | +| `MediaContainerWithSettings` | [*components.MediaContainerWithSettings](../../models/components/mediacontainerwithsettings.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getsectionsmediacontainer.md b/docs/models/operations/getsectionsmediacontainer.md new file mode 100644 index 0000000..a240b8f --- /dev/null +++ b/docs/models/operations/getsectionsmediacontainer.md @@ -0,0 +1,19 @@ +# GetSectionsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | +| `Directory` | [][components.LibrarySection](../../models/components/librarysection.md) | :heavy_minus_sign: | N/A | +| `Title1` | **string* | :heavy_minus_sign: | Typically just "Plex Library" | \ No newline at end of file diff --git a/docs/models/operations/getsectionsprefsglobals.md b/docs/models/operations/getsectionsprefsglobals.md new file mode 100644 index 0000000..2196c05 --- /dev/null +++ b/docs/models/operations/getsectionsprefsglobals.md @@ -0,0 +1,18 @@ +# GetSectionsPrefsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsectionsprefsrequest.md b/docs/models/operations/getsectionsprefsrequest.md new file mode 100644 index 0000000..d903b09 --- /dev/null +++ b/docs/models/operations/getsectionsprefsrequest.md @@ -0,0 +1,20 @@ +# GetSectionsPrefsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Type` | *int64* | :heavy_check_mark: | The metadata type | | +| `Agent` | **string* | :heavy_minus_sign: | The metadata agent in use | | \ No newline at end of file diff --git a/docs/models/operations/getsectionsprefsresponse.md b/docs/models/operations/getsectionsprefsresponse.md new file mode 100644 index 0000000..3b84b85 --- /dev/null +++ b/docs/models/operations/getsectionsprefsresponse.md @@ -0,0 +1,11 @@ +# GetSectionsPrefsResponse + + +## 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 | +| `RequestHandlerSlashGetResponses200` | [*components.RequestHandlerSlashGetResponses200](../../models/components/requesthandlerslashgetresponses200.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getsectionsresponse.md b/docs/models/operations/getsectionsresponse.md new file mode 100644 index 0000000..113776a --- /dev/null +++ b/docs/models/operations/getsectionsresponse.md @@ -0,0 +1,12 @@ +# GetSectionsResponse + + +## 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.GetSectionsResponseBody](../../models/operations/getsectionsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsectionsresponsebody.md b/docs/models/operations/getsectionsresponsebody.md new file mode 100644 index 0000000..6e1845a --- /dev/null +++ b/docs/models/operations/getsectionsresponsebody.md @@ -0,0 +1,10 @@ +# GetSectionsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetSectionsMediaContainer](../../models/operations/getsectionsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserveractivitiesmediacontainer.md b/docs/models/operations/getserveractivitiesmediacontainer.md deleted file mode 100644 index eb6b965..0000000 --- a/docs/models/operations/getserveractivitiesmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index 00c9121..0000000 --- a/docs/models/operations/getserveractivitiesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 292690e..0000000 --- a/docs/models/operations/getserveractivitiesresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 72b5bae..0000000 --- a/docs/models/operations/getservercapabilitiesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 6f47930..0000000 --- a/docs/models/operations/getservercapabilitiesresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index e78030c..0000000 --- a/docs/models/operations/getserveridentitymediacontainer.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index a172f0f..0000000 --- a/docs/models/operations/getserveridentityresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 Server Identity information | \ No newline at end of file diff --git a/docs/models/operations/getserveridentityresponsebody.md b/docs/models/operations/getserveridentityresponsebody.md deleted file mode 100644 index 0ffb02a..0000000 --- a/docs/models/operations/getserveridentityresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerIdentityResponseBody - -The Server Identity information - - -## 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/getserverinfoglobals.md b/docs/models/operations/getserverinfoglobals.md new file mode 100644 index 0000000..3c6deb0 --- /dev/null +++ b/docs/models/operations/getserverinfoglobals.md @@ -0,0 +1,18 @@ +# GetServerInfoGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getserverinforequest.md b/docs/models/operations/getserverinforequest.md new file mode 100644 index 0000000..bde10ff --- /dev/null +++ b/docs/models/operations/getserverinforequest.md @@ -0,0 +1,18 @@ +# GetServerInfoRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getserverinforesponse.md b/docs/models/operations/getserverinforesponse.md new file mode 100644 index 0000000..5d43ca4 --- /dev/null +++ b/docs/models/operations/getserverinforesponse.md @@ -0,0 +1,11 @@ +# GetServerInfoResponse + + +## 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 | +| `MediaContainerWithDirectory` | [*components.MediaContainerWithDirectory](../../models/components/mediacontainerwithdirectory.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getserverlistmediacontainer.md b/docs/models/operations/getserverlistmediacontainer.md deleted file mode 100644 index d405779..0000000 --- a/docs/models/operations/getserverlistmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index 8bfdbb9..0000000 --- a/docs/models/operations/getserverlistresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 1dd4f09..0000000 --- a/docs/models/operations/getserverlistresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 9a00599..0000000 --- a/docs/models/operations/getserverlistserver.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/getserverpreferencesmediacontainer.md b/docs/models/operations/getserverpreferencesmediacontainer.md deleted file mode 100644 index 9e99137..0000000 --- a/docs/models/operations/getserverpreferencesmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetServerPreferencesMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 161 | -| `Setting` | [][operations.Setting](../../models/operations/setting.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getserverpreferencesresponse.md b/docs/models/operations/getserverpreferencesresponse.md deleted file mode 100644 index 749fc7d..0000000 --- a/docs/models/operations/getserverpreferencesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetServerPreferencesResponseBody](../../models/operations/getserverpreferencesresponsebody.md) | :heavy_minus_sign: | Server Preferences | \ No newline at end of file diff --git a/docs/models/operations/getserverpreferencesresponsebody.md b/docs/models/operations/getserverpreferencesresponsebody.md deleted file mode 100644 index 4bf2ad9..0000000 --- a/docs/models/operations/getserverpreferencesresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerPreferencesResponseBody - -Server Preferences - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetServerPreferencesMediaContainer](../../models/operations/getserverpreferencesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserverresourcesrequest.md b/docs/models/operations/getserverresourcesrequest.md deleted file mode 100644 index daf0301..0000000 --- a/docs/models/operations/getserverresourcesrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerResourcesRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `IncludeHTTPS` | [*operations.IncludeHTTPS](../../models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | -| `IncludeRelay` | [*operations.IncludeRelay](../../models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | -| `IncludeIPv6` | [*operations.IncludeIPv6](../../models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | -| `ClientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | \ No newline at end of file diff --git a/docs/models/operations/getserverresourcesresponse.md b/docs/models/operations/getserverresourcesresponse.md deleted file mode 100644 index 5c6e8fb..0000000 --- a/docs/models/operations/getserverresourcesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerResourcesResponse - - -## 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 | -| `PlexDevices` | [][operations.PlexDevice](../../models/operations/plexdevice.md) | :heavy_minus_sign: | List of Plex Devices. This includes Plex hosted servers and clients | \ No newline at end of file diff --git a/docs/models/operations/getsessionhistorymediacontainer.md b/docs/models/operations/getsessionhistorymediacontainer.md deleted file mode 100644 index d803d3f..0000000 --- a/docs/models/operations/getsessionhistorymediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSessionHistoryMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 10855 | -| `Metadata` | [][operations.GetSessionHistoryMetadata](../../models/operations/getsessionhistorymetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsessionhistorymetadata.md b/docs/models/operations/getsessionhistorymetadata.md deleted file mode 100644 index 64e8608..0000000 --- a/docs/models/operations/getsessionhistorymetadata.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetSessionHistoryMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `HistoryKey` | **string* | :heavy_minus_sign: | N/A | /status/sessions/history/1 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32171 | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 32171 | -| `LibrarySectionID` | **string* | :heavy_minus_sign: | N/A | 2 | -| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32170 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32132 | -| `Title` | **string* | :heavy_minus_sign: | N/A | The Noise That Blue Makes | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | N/A | Taskmaster | -| `Type` | **string* | :heavy_minus_sign: | N/A | episode | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32171/thumb/-1 | -| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32170/thumb/1654134301 | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32132/thumb/1703933346 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | N/A | /library/metadata/32132/art/1703933346 | -| `Index` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 13 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2022-04-14 00:00:00 +0000 UTC | -| `ViewedAt` | **int* | :heavy_minus_sign: | N/A | 1654139223 | -| `AccountID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `DeviceID` | **int* | :heavy_minus_sign: | N/A | 5 | \ No newline at end of file diff --git a/docs/models/operations/getsessionhistoryrequest.md b/docs/models/operations/getsessionhistoryrequest.md deleted file mode 100644 index 83566f4..0000000 --- a/docs/models/operations/getsessionhistoryrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSessionHistoryRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Sort` | **string* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | -| `AccountID` | **int64* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| 1 | -| `Filter` | [*operations.QueryParamFilter](../../models/operations/queryparamfilter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | -| `LibrarySectionID` | **int64* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| 12 | \ No newline at end of file diff --git a/docs/models/operations/getsessionhistoryresponse.md b/docs/models/operations/getsessionhistoryresponse.md deleted file mode 100644 index 40fe57a..0000000 --- a/docs/models/operations/getsessionhistoryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetSessionHistoryResponseBody](../../models/operations/getsessionhistoryresponsebody.md) | :heavy_minus_sign: | List of Plex Sessions | \ No newline at end of file diff --git a/docs/models/operations/getsessionhistoryresponsebody.md b/docs/models/operations/getsessionhistoryresponsebody.md deleted file mode 100644 index f91794c..0000000 --- a/docs/models/operations/getsessionhistoryresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionHistoryResponseBody - -List of Plex Sessions - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetSessionHistoryMediaContainer](../../models/operations/getsessionhistorymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsessionplaylistindexglobals.md b/docs/models/operations/getsessionplaylistindexglobals.md new file mode 100644 index 0000000..354ec22 --- /dev/null +++ b/docs/models/operations/getsessionplaylistindexglobals.md @@ -0,0 +1,18 @@ +# GetSessionPlaylistIndexGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsessionplaylistindexrequest.md b/docs/models/operations/getsessionplaylistindexrequest.md new file mode 100644 index 0000000..a6c321a --- /dev/null +++ b/docs/models/operations/getsessionplaylistindexrequest.md @@ -0,0 +1,20 @@ +# GetSessionPlaylistIndexRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SessionID` | *string* | :heavy_check_mark: | The session id | | +| `ConsumerID` | *string* | :heavy_check_mark: | The consumer id | | \ No newline at end of file diff --git a/docs/models/operations/getsessionplaylistindexresponse.md b/docs/models/operations/getsessionplaylistindexresponse.md new file mode 100644 index 0000000..6e837ec --- /dev/null +++ b/docs/models/operations/getsessionplaylistindexresponse.md @@ -0,0 +1,10 @@ +# GetSessionPlaylistIndexResponse + + +## 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/getsessionsegmentglobals.md b/docs/models/operations/getsessionsegmentglobals.md new file mode 100644 index 0000000..3c97759 --- /dev/null +++ b/docs/models/operations/getsessionsegmentglobals.md @@ -0,0 +1,18 @@ +# GetSessionSegmentGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsessionsegmentrequest.md b/docs/models/operations/getsessionsegmentrequest.md new file mode 100644 index 0000000..5b9bf34 --- /dev/null +++ b/docs/models/operations/getsessionsegmentrequest.md @@ -0,0 +1,21 @@ +# GetSessionSegmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SessionID` | *string* | :heavy_check_mark: | The session id | | +| `ConsumerID` | *string* | :heavy_check_mark: | The consumer id | | +| `SegmentID` | *string* | :heavy_check_mark: | The segment id | | \ No newline at end of file diff --git a/docs/models/operations/getsessionsegmentresponse.md b/docs/models/operations/getsessionsegmentresponse.md new file mode 100644 index 0000000..6ad4b20 --- /dev/null +++ b/docs/models/operations/getsessionsegmentresponse.md @@ -0,0 +1,10 @@ +# GetSessionSegmentResponse + + +## 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/getsessionsmedia.md b/docs/models/operations/getsessionsmedia.md deleted file mode 100644 index 294bdb9..0000000 --- a/docs/models/operations/getsessionsmedia.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetSessionsMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `AudioChannels` | **int* | :heavy_minus_sign: | N/A | 2 | -| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | flac | -| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 1014 | -| `Container` | **string* | :heavy_minus_sign: | N/A | flac | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 186240 | -| `ID` | **string* | :heavy_minus_sign: | N/A | 130355 | -| `Selected` | **bool* | :heavy_minus_sign: | N/A | true | -| `Part` | [][operations.GetSessionsPart](../../models/operations/getsessionspart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsessionsmediacontainer.md b/docs/models/operations/getsessionsmediacontainer.md deleted file mode 100644 index 4d9f313..0000000 --- a/docs/models/operations/getsessionsmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetSessionsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Metadata` | [][operations.GetSessionsMetadata](../../models/operations/getsessionsmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsessionsmetadata.md b/docs/models/operations/getsessionsmetadata.md deleted file mode 100644 index ccd28f2..0000000 --- a/docs/models/operations/getsessionsmetadata.md +++ /dev/null @@ -1,45 +0,0 @@ -# GetSessionsMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705543312 | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 186240 | -| `GrandparentArt` | **string* | :heavy_minus_sign: | N/A | /library/metadata/39904/art/1705310687 | -| `GrandparentGUID` | **string* | :heavy_minus_sign: | N/A | plex://artist/5d07bbfd403c6402904a6480 | -| `GrandparentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/39904 | -| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | N/A | 39904 | -| `GrandparentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/39904/thumb/1705310687 | -| `GrandparentTitle` | **string* | :heavy_minus_sign: | N/A | Green Day | -| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://track/6535834f71f22f36f71a8e8f | -| `Index` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/67085 | -| `LibrarySectionID` | **string* | :heavy_minus_sign: | N/A | 3 | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/3 | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Music | -| `MusicAnalysisVersion` | **string* | :heavy_minus_sign: | N/A | 1 | -| `OriginalTitle` | **string* | :heavy_minus_sign: | The original untranslated name of the media item when non-english, or the track artist if an audio Item has an album artist | The American Dream Is Killing Me | -| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://album/65394d6d472b8ab03ef47f12 | -| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 1 | -| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/67084 | -| `ParentRatingKey` | **string* | :heavy_minus_sign: | N/A | 67084 | -| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | Reprise Records | -| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | -| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Saviors | -| `ParentYear` | **int* | :heavy_minus_sign: | N/A | 2024 | -| `RatingCount` | **int* | :heavy_minus_sign: | N/A | 45885 | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 67085 | -| `SessionKey` | **string* | :heavy_minus_sign: | N/A | 203 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/67084/thumb/1705543314 | -| `Title` | **string* | :heavy_minus_sign: | N/A | The American Dream Is Killing Me | -| `TitleSort` | **string* | :heavy_minus_sign: | N/A | American Dream Is Killing Me | -| `Type` | **string* | :heavy_minus_sign: | N/A | track | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705543314 | -| `ViewOffset` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Media` | [][operations.GetSessionsMedia](../../models/operations/getsessionsmedia.md) | :heavy_minus_sign: | N/A | | -| `User` | [*operations.GetSessionsUser](../../models/operations/getsessionsuser.md) | :heavy_minus_sign: | N/A | | -| `Player` | [*operations.Player](../../models/operations/player.md) | :heavy_minus_sign: | N/A | | -| `Session` | [*operations.Session](../../models/operations/session.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsessionspart.md b/docs/models/operations/getsessionspart.md deleted file mode 100644 index 8f7e15d..0000000 --- a/docs/models/operations/getsessionspart.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetSessionsPart - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Container` | **string* | :heavy_minus_sign: | N/A | flac | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 186240 | -| `File` | **string* | :heavy_minus_sign: | N/A | /music/Green Day/Saviors (2024)/Green Day - Saviors - 01 - The American Dream Is Killing Me.flac | -| `HasThumbnail` | **string* | :heavy_minus_sign: | N/A | 1 | -| `ID` | **string* | :heavy_minus_sign: | N/A | 130625 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/130625/1705543268/file.flac | -| `Size` | **int* | :heavy_minus_sign: | N/A | 23644000 | -| `Decision` | **string* | :heavy_minus_sign: | N/A | directplay | -| `Selected` | **bool* | :heavy_minus_sign: | N/A | true | -| `Stream` | [][operations.GetSessionsStream](../../models/operations/getsessionsstream.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsessionsresponse.md b/docs/models/operations/getsessionsresponse.md index 61e4b6a..62914f2 100644 --- a/docs/models/operations/getsessionsresponse.md +++ b/docs/models/operations/getsessionsresponse.md @@ -3,9 +3,10 @@ ## 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.GetSessionsResponseBody](../../models/operations/getsessionsresponsebody.md) | :heavy_minus_sign: | List of Active Plex Sessions | \ No newline at end of file +| 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsessionsresponsebody.md b/docs/models/operations/getsessionsresponsebody.md deleted file mode 100644 index 165bf3c..0000000 --- a/docs/models/operations/getsessionsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionsResponseBody - -List of Active Plex Sessions - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetSessionsMediaContainer](../../models/operations/getsessionsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsessionsstream.md b/docs/models/operations/getsessionsstream.md deleted file mode 100644 index 1156282..0000000 --- a/docs/models/operations/getsessionsstream.md +++ /dev/null @@ -1,27 +0,0 @@ -# GetSessionsStream - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| `AlbumGain` | **string* | :heavy_minus_sign: | N/A | -12.94 | -| `AlbumPeak` | **string* | :heavy_minus_sign: | N/A | 1.000000 | -| `AlbumRange` | **string* | :heavy_minus_sign: | N/A | 4.751014 | -| `AudioChannelLayout` | **string* | :heavy_minus_sign: | N/A | stereo | -| `BitDepth` | **int* | :heavy_minus_sign: | N/A | 16 | -| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 1014 | -| `Channels` | **int* | :heavy_minus_sign: | N/A | 2 | -| `Codec` | **string* | :heavy_minus_sign: | N/A | flac | -| `DisplayTitle` | **string* | :heavy_minus_sign: | N/A | FLAC (Stereo) | -| `ExtendedDisplayTitle` | **string* | :heavy_minus_sign: | N/A | FLAC (Stereo) | -| `Gain` | **string* | :heavy_minus_sign: | N/A | -12.94 | -| `ID` | **string* | :heavy_minus_sign: | N/A | 352487 | -| `Index` | **int* | :heavy_minus_sign: | N/A | 0 | -| `Loudness` | **string* | :heavy_minus_sign: | N/A | -5.94 | -| `Lra` | **string* | :heavy_minus_sign: | N/A | 1.74 | -| `Peak` | **string* | :heavy_minus_sign: | N/A | 1.000000 | -| `SamplingRate` | **int* | :heavy_minus_sign: | N/A | 44100 | -| `Selected` | **bool* | :heavy_minus_sign: | N/A | true | -| `StreamType` | **int* | :heavy_minus_sign: | N/A | 2 | -| `Location` | **string* | :heavy_minus_sign: | N/A | direct | \ No newline at end of file diff --git a/docs/models/operations/getsessionsuser.md b/docs/models/operations/getsessionsuser.md deleted file mode 100644 index 84fed00..0000000 --- a/docs/models/operations/getsessionsuser.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionsUser - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | 1 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661 | -| `Title` | **string* | :heavy_minus_sign: | N/A | Blindkitty38 | \ No newline at end of file diff --git a/docs/models/operations/getsonicallysimilarglobals.md b/docs/models/operations/getsonicallysimilarglobals.md new file mode 100644 index 0000000..d31bba5 --- /dev/null +++ b/docs/models/operations/getsonicallysimilarglobals.md @@ -0,0 +1,18 @@ +# GetSonicallySimilarGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsonicallysimilarrequest.md b/docs/models/operations/getsonicallysimilarrequest.md new file mode 100644 index 0000000..835b4ca --- /dev/null +++ b/docs/models/operations/getsonicallysimilarrequest.md @@ -0,0 +1,23 @@ +# GetSonicallySimilarRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type to fetch (should be 10 for audio track) | | +| `Values` | []*int64* | :heavy_check_mark: | The music analysis to center the search. Typically obtained from the `musicAnalysis` of a track | | +| `Limit` | **int64* | :heavy_minus_sign: | The limit of the number of items to fetch; defaults to 50 | | +| `MaxDistance` | **float64* | :heavy_minus_sign: | The maximum distance to search, defaults to 0.25 | | \ No newline at end of file diff --git a/docs/models/operations/getsonicallysimilarresponse.md b/docs/models/operations/getsonicallysimilarresponse.md new file mode 100644 index 0000000..1fd650e --- /dev/null +++ b/docs/models/operations/getsonicallysimilarresponse.md @@ -0,0 +1,11 @@ +# GetSonicallySimilarResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getsonicpathglobals.md b/docs/models/operations/getsonicpathglobals.md new file mode 100644 index 0000000..eed19af --- /dev/null +++ b/docs/models/operations/getsonicpathglobals.md @@ -0,0 +1,18 @@ +# GetSonicPathGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsonicpathrequest.md b/docs/models/operations/getsonicpathrequest.md new file mode 100644 index 0000000..967b598 --- /dev/null +++ b/docs/models/operations/getsonicpathrequest.md @@ -0,0 +1,23 @@ +# GetSonicPathRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `StartID` | *int64* | :heavy_check_mark: | The starting metadata item id | | +| `EndID` | *int64* | :heavy_check_mark: | The ending metadata item id | | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | +| `MaxDistance` | **float64* | :heavy_minus_sign: | The maximum distance allowed along the path; defaults to 0.25 | | \ No newline at end of file diff --git a/docs/models/operations/getsonicpathresponse.md b/docs/models/operations/getsonicpathresponse.md new file mode 100644 index 0000000..736db01 --- /dev/null +++ b/docs/models/operations/getsonicpathresponse.md @@ -0,0 +1,11 @@ +# GetSonicPathResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationglobals.md b/docs/models/operations/getsourceconnectioninformationglobals.md new file mode 100644 index 0000000..1c02287 --- /dev/null +++ b/docs/models/operations/getsourceconnectioninformationglobals.md @@ -0,0 +1,18 @@ +# GetSourceConnectionInformationGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationmediacontainer.md b/docs/models/operations/getsourceconnectioninformationmediacontainer.md new file mode 100644 index 0000000..50d6648 --- /dev/null +++ b/docs/models/operations/getsourceconnectioninformationmediacontainer.md @@ -0,0 +1,17 @@ +# GetSourceConnectionInformationMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Device` | [*operations.Device](../../models/operations/device.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationrequest.md b/docs/models/operations/getsourceconnectioninformationrequest.md index e5439ac..e80d9a5 100644 --- a/docs/models/operations/getsourceconnectioninformationrequest.md +++ b/docs/models/operations/getsourceconnectioninformationrequest.md @@ -3,6 +3,18 @@ ## 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 +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Source` | *string* | :heavy_check_mark: | The source identifier with an included prefix. | | +| `Refresh` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Force refresh | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationresponse.md b/docs/models/operations/getsourceconnectioninformationresponse.md index 17e0fc7..d2e9ba7 100644 --- a/docs/models/operations/getsourceconnectioninformationresponse.md +++ b/docs/models/operations/getsourceconnectioninformationresponse.md @@ -3,8 +3,9 @@ ## 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 +| 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.GetSourceConnectionInformationResponseBody](../../models/operations/getsourceconnectioninformationresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationresponsebody.md b/docs/models/operations/getsourceconnectioninformationresponsebody.md new file mode 100644 index 0000000..b5da469 --- /dev/null +++ b/docs/models/operations/getsourceconnectioninformationresponsebody.md @@ -0,0 +1,10 @@ +# GetSourceConnectionInformationResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetSourceConnectionInformationMediaContainer](../../models/operations/getsourceconnectioninformationmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getstatisticsdevice.md b/docs/models/operations/getstatisticsdevice.md deleted file mode 100644 index 839f5ae..0000000 --- a/docs/models/operations/getstatisticsdevice.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetStatisticsDevice - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 208 | -| `Name` | **string* | :heavy_minus_sign: | N/A | Roku Express | -| `Platform` | **string* | :heavy_minus_sign: | N/A | Roku | -| `ClientIdentifier` | **string* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 | -| `CreatedAt` | **int* | :heavy_minus_sign: | N/A | 1706470556 | \ No newline at end of file diff --git a/docs/models/operations/getstatisticsmediacontainer.md b/docs/models/operations/getstatisticsmediacontainer.md deleted file mode 100644 index 4fcefb5..0000000 --- a/docs/models/operations/getstatisticsmediacontainer.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetStatisticsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 5497 | -| `Device` | [][operations.GetStatisticsDevice](../../models/operations/getstatisticsdevice.md) | :heavy_minus_sign: | N/A | | -| `Account` | [][operations.Account](../../models/operations/account.md) | :heavy_minus_sign: | N/A | | -| `StatisticsMedia` | [][operations.StatisticsMedia](../../models/operations/statisticsmedia.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getstatisticsrequest.md b/docs/models/operations/getstatisticsrequest.md deleted file mode 100644 index 73aa9da..0000000 --- a/docs/models/operations/getstatisticsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetStatisticsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/getstatisticsresponse.md b/docs/models/operations/getstatisticsresponse.md deleted file mode 100644 index 2d108e2..0000000 --- a/docs/models/operations/getstatisticsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetStatisticsResponse - - -## 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.GetStatisticsResponseBody](../../models/operations/getstatisticsresponsebody.md) | :heavy_minus_sign: | Media Statistics | \ No newline at end of file diff --git a/docs/models/operations/getstatisticsresponsebody.md b/docs/models/operations/getstatisticsresponsebody.md deleted file mode 100644 index be81584..0000000 --- a/docs/models/operations/getstatisticsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetStatisticsResponseBody - -Media Statistics - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetStatisticsMediaContainer](../../models/operations/getstatisticsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getstreamglobals.md b/docs/models/operations/getstreamglobals.md new file mode 100644 index 0000000..06932f4 --- /dev/null +++ b/docs/models/operations/getstreamglobals.md @@ -0,0 +1,18 @@ +# GetStreamGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getstreamlevelsglobals.md b/docs/models/operations/getstreamlevelsglobals.md new file mode 100644 index 0000000..88cf95e --- /dev/null +++ b/docs/models/operations/getstreamlevelsglobals.md @@ -0,0 +1,18 @@ +# GetStreamLevelsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getstreamlevelslevel.md b/docs/models/operations/getstreamlevelslevel.md new file mode 100644 index 0000000..bda38a9 --- /dev/null +++ b/docs/models/operations/getstreamlevelslevel.md @@ -0,0 +1,8 @@ +# GetStreamLevelsLevel + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `V` | **float64* | :heavy_minus_sign: | The level in db. | \ No newline at end of file diff --git a/docs/models/operations/getstreamlevelsmediacontainer.md b/docs/models/operations/getstreamlevelsmediacontainer.md new file mode 100644 index 0000000..ddf1c9d --- /dev/null +++ b/docs/models/operations/getstreamlevelsmediacontainer.md @@ -0,0 +1,18 @@ +# GetStreamLevelsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Level` | [][operations.GetStreamLevelsLevel](../../models/operations/getstreamlevelslevel.md) | :heavy_minus_sign: | N/A | +| `TotalSamples` | **string* | :heavy_minus_sign: | The total number of samples (as a string) | \ No newline at end of file diff --git a/docs/models/operations/getstreamlevelsrequest.md b/docs/models/operations/getstreamlevelsrequest.md new file mode 100644 index 0000000..ce0c42a --- /dev/null +++ b/docs/models/operations/getstreamlevelsrequest.md @@ -0,0 +1,20 @@ +# GetStreamLevelsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `StreamID` | *int64* | :heavy_check_mark: | The id of the stream | | +| `Subsample` | **int64* | :heavy_minus_sign: | Subsample result down to return only the provided number of samples | | \ No newline at end of file diff --git a/docs/models/operations/getstreamlevelsresponse.md b/docs/models/operations/getstreamlevelsresponse.md new file mode 100644 index 0000000..74097a2 --- /dev/null +++ b/docs/models/operations/getstreamlevelsresponse.md @@ -0,0 +1,11 @@ +# GetStreamLevelsResponse + + +## 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.GetStreamLevelsResponseBody](../../models/operations/getstreamlevelsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getstreamlevelsresponsebody.md b/docs/models/operations/getstreamlevelsresponsebody.md new file mode 100644 index 0000000..a96818f --- /dev/null +++ b/docs/models/operations/getstreamlevelsresponsebody.md @@ -0,0 +1,10 @@ +# GetStreamLevelsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetStreamLevelsMediaContainer](../../models/operations/getstreamlevelsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getstreamloudnessglobals.md b/docs/models/operations/getstreamloudnessglobals.md new file mode 100644 index 0000000..3932b0c --- /dev/null +++ b/docs/models/operations/getstreamloudnessglobals.md @@ -0,0 +1,18 @@ +# GetStreamLoudnessGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getstreamloudnessrequest.md b/docs/models/operations/getstreamloudnessrequest.md new file mode 100644 index 0000000..2b34b48 --- /dev/null +++ b/docs/models/operations/getstreamloudnessrequest.md @@ -0,0 +1,20 @@ +# GetStreamLoudnessRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `StreamID` | *int64* | :heavy_check_mark: | The id of the stream | | +| `Subsample` | **int64* | :heavy_minus_sign: | Subsample result down to return only the provided number of samples | | \ No newline at end of file diff --git a/docs/models/operations/getstreamloudnessresponse.md b/docs/models/operations/getstreamloudnessresponse.md new file mode 100644 index 0000000..4ddcfb1 --- /dev/null +++ b/docs/models/operations/getstreamloudnessresponse.md @@ -0,0 +1,11 @@ +# GetStreamLoudnessResponse + + +## 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 | +| `Res` | **string* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getstreamrequest.md b/docs/models/operations/getstreamrequest.md new file mode 100644 index 0000000..691235e --- /dev/null +++ b/docs/models/operations/getstreamrequest.md @@ -0,0 +1,23 @@ +# GetStreamRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `StreamID` | *int64* | :heavy_check_mark: | The id of the stream | | +| `Ext` | *string* | :heavy_check_mark: | The extension of the stream. Required to fetch the `sub` portion of `idx`/`sub` subtitles | | +| `Encoding` | **string* | :heavy_minus_sign: | The requested encoding for the subtitle (only used for text subtitles) | | +| `Format` | **string* | :heavy_minus_sign: | The requested format for the subtitle to convert the subtitles to (only used for text subtitles) | | +| `AutoAdjustSubtitle` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether the server should attempt to automatically adjust the subtitle timestamps to match the media | 1 | \ No newline at end of file diff --git a/docs/models/operations/getstreamresponse.md b/docs/models/operations/getstreamresponse.md new file mode 100644 index 0000000..4ddec10 --- /dev/null +++ b/docs/models/operations/getstreamresponse.md @@ -0,0 +1,10 @@ +# GetStreamResponse + + +## 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/getsubscriptionglobals.md b/docs/models/operations/getsubscriptionglobals.md new file mode 100644 index 0000000..7ff00fc --- /dev/null +++ b/docs/models/operations/getsubscriptionglobals.md @@ -0,0 +1,18 @@ +# GetSubscriptionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getsubscriptionrequest.md b/docs/models/operations/getsubscriptionrequest.md new file mode 100644 index 0000000..f612a36 --- /dev/null +++ b/docs/models/operations/getsubscriptionrequest.md @@ -0,0 +1,21 @@ +# GetSubscriptionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SubscriptionID` | *int64* | :heavy_check_mark: | N/A | | +| `IncludeGrabs` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates whether the active grabs should be included as well | 1 | +| `IncludeStorage` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Compute the storage of recorded items desired by this subscription | 1 | \ No newline at end of file diff --git a/docs/models/operations/getsubscriptionresponse.md b/docs/models/operations/getsubscriptionresponse.md new file mode 100644 index 0000000..a667118 --- /dev/null +++ b/docs/models/operations/getsubscriptionresponse.md @@ -0,0 +1,11 @@ +# GetSubscriptionResponse + + +## 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 | +| `MediaContainerWithSubscription` | [*components.MediaContainerWithSubscription](../../models/components/mediacontainerwithsubscription.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/gettagsglobals.md b/docs/models/operations/gettagsglobals.md new file mode 100644 index 0000000..65f48d0 --- /dev/null +++ b/docs/models/operations/gettagsglobals.md @@ -0,0 +1,18 @@ +# GetTagsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/gettagsmediacontainer.md b/docs/models/operations/gettagsmediacontainer.md new file mode 100644 index 0000000..f9f01e1 --- /dev/null +++ b/docs/models/operations/gettagsmediacontainer.md @@ -0,0 +1,17 @@ +# GetTagsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Directory` | [][operations.Directory](../../models/operations/directory.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettagsrequest.md b/docs/models/operations/gettagsrequest.md new file mode 100644 index 0000000..cc3996b --- /dev/null +++ b/docs/models/operations/gettagsrequest.md @@ -0,0 +1,19 @@ +# GetTagsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type to filter by | | \ No newline at end of file diff --git a/docs/models/operations/gettagsresponse.md b/docs/models/operations/gettagsresponse.md new file mode 100644 index 0000000..f0f7617 --- /dev/null +++ b/docs/models/operations/gettagsresponse.md @@ -0,0 +1,11 @@ +# GetTagsResponse + + +## 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.GetTagsResponseBody](../../models/operations/gettagsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/gettagsresponsebody.md b/docs/models/operations/gettagsresponsebody.md new file mode 100644 index 0000000..d08f093 --- /dev/null +++ b/docs/models/operations/gettagsresponsebody.md @@ -0,0 +1,10 @@ +# GetTagsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetTagsMediaContainer](../../models/operations/gettagsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettasksresponse.md b/docs/models/operations/gettasksresponse.md new file mode 100644 index 0000000..32c2307 --- /dev/null +++ b/docs/models/operations/gettasksresponse.md @@ -0,0 +1,11 @@ +# GetTasksResponse + + +## 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.GetTasksResponseBody](../../models/operations/gettasksresponsebody.md) | :heavy_minus_sign: | Butler tasks | \ No newline at end of file diff --git a/docs/models/operations/gettasksresponsebody.md b/docs/models/operations/gettasksresponsebody.md new file mode 100644 index 0000000..2cce2ce --- /dev/null +++ b/docs/models/operations/gettasksresponsebody.md @@ -0,0 +1,10 @@ +# GetTasksResponseBody + +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/gettemplateglobals.md b/docs/models/operations/gettemplateglobals.md new file mode 100644 index 0000000..a8b9f19 --- /dev/null +++ b/docs/models/operations/gettemplateglobals.md @@ -0,0 +1,18 @@ +# GetTemplateGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/gettemplatemediacontainer.md b/docs/models/operations/gettemplatemediacontainer.md new file mode 100644 index 0000000..51fc721 --- /dev/null +++ b/docs/models/operations/gettemplatemediacontainer.md @@ -0,0 +1,17 @@ +# GetTemplateMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `SubscriptionTemplate` | [][operations.SubscriptionTemplate](../../models/operations/subscriptiontemplate.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettemplaterequest.md b/docs/models/operations/gettemplaterequest.md new file mode 100644 index 0000000..7cd3822 --- /dev/null +++ b/docs/models/operations/gettemplaterequest.md @@ -0,0 +1,19 @@ +# GetTemplateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `GUID` | **string* | :heavy_minus_sign: | The guid of the item for which to get the template | plex://episode/5fc70265c40548002d539d23 | \ No newline at end of file diff --git a/docs/models/operations/gettemplateresponse.md b/docs/models/operations/gettemplateresponse.md new file mode 100644 index 0000000..6d99c9b --- /dev/null +++ b/docs/models/operations/gettemplateresponse.md @@ -0,0 +1,12 @@ +# GetTemplateResponse + + +## 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.GetTemplateResponseBody](../../models/operations/gettemplateresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettemplateresponsebody.md b/docs/models/operations/gettemplateresponsebody.md new file mode 100644 index 0000000..431bf62 --- /dev/null +++ b/docs/models/operations/gettemplateresponsebody.md @@ -0,0 +1,10 @@ +# GetTemplateResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetTemplateMediaContainer](../../models/operations/gettemplatemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getthumbglobals.md b/docs/models/operations/getthumbglobals.md new file mode 100644 index 0000000..bce2e68 --- /dev/null +++ b/docs/models/operations/getthumbglobals.md @@ -0,0 +1,18 @@ +# GetThumbGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/getthumbimagerequest.md b/docs/models/operations/getthumbimagerequest.md deleted file mode 100644 index 4500cfe..0000000 --- a/docs/models/operations/getthumbimagerequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetThumbImageRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the children of. | 9518 | -| `Width` | *int64* | :heavy_check_mark: | N/A | 396 | -| `Height` | *int64* | :heavy_check_mark: | N/A | 396 | -| `MinSize` | *int64* | :heavy_check_mark: | N/A | 1 | -| `Upscale` | *int64* | :heavy_check_mark: | N/A | 1 | -| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/getthumbimageresponse.md b/docs/models/operations/getthumbimageresponse.md deleted file mode 100644 index 00eac04..0000000 --- a/docs/models/operations/getthumbimageresponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetThumbImageResponse - - -## 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 | -| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | Successful response returning an image | -| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getthumbrequest.md b/docs/models/operations/getthumbrequest.md new file mode 100644 index 0000000..2bc9b9a --- /dev/null +++ b/docs/models/operations/getthumbrequest.md @@ -0,0 +1,20 @@ +# GetThumbRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | +| `VersionPathParameter` | *int64* | :heavy_check_mark: | A version number of the thumb used for busting cache | | \ No newline at end of file diff --git a/docs/models/operations/getthumbresponse.md b/docs/models/operations/getthumbresponse.md new file mode 100644 index 0000000..0233f6e --- /dev/null +++ b/docs/models/operations/getthumbresponse.md @@ -0,0 +1,10 @@ +# GetThumbResponse + + +## 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 deleted file mode 100644 index b98d9b2..0000000 --- a/docs/models/operations/gettimelinerequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetTimelineRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `RatingKey` | *float64* | :heavy_check_mark: | The rating key of the media item | 23409 | -| `Key` | *string* | :heavy_check_mark: | The key of the media item to get the timeline for | /library/metadata/23409 | -| `State` | [operations.State](../../models/operations/state.md) | :heavy_check_mark: | The state of the media item | playing | -| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | 1 | -| `Time` | *float64* | :heavy_check_mark: | The time of the media item | 2000 | -| `Duration` | *float64* | :heavy_check_mark: | The duration of the media item | 10000 | -| `Context` | *string* | :heavy_check_mark: | The context of the media item | home:hub.continueWatching | -| `PlayQueueItemID` | *float64* | :heavy_check_mark: | The play queue item ID of the media item | 1 | -| `PlayBackTime` | *float64* | :heavy_check_mark: | The playback time of the media item | 2000 | -| `Row` | *float64* | :heavy_check_mark: | The row of the media item | 1 | \ No newline at end of file diff --git a/docs/models/operations/gettimelineresponse.md b/docs/models/operations/gettimelineresponse.md deleted file mode 100644 index 1e7bd7b..0000000 --- a/docs/models/operations/gettimelineresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/gettokenbypinidauthpincontainer.md b/docs/models/operations/gettokenbypinidauthpincontainer.md deleted file mode 100644 index 9ae2d32..0000000 --- a/docs/models/operations/gettokenbypinidauthpincontainer.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetTokenByPinIDAuthPinContainer - -The Pin with a non-null authToken when it has been verified by the user - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | N/A | 308667304 | -| `Code` | *string* | :heavy_check_mark: | N/A | 7RQZ | -| `Product` | *string* | :heavy_check_mark: | N/A | Tautulli | -| `Trusted` | **bool* | :heavy_minus_sign: | N/A | | -| `Qr` | *string* | :heavy_check_mark: | N/A | https://plex.tv/api/v2/pins/qr/7RQZ | -| `ClientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | Tautulli | -| `Location` | [operations.GetTokenByPinIDGeoData](../../models/operations/gettokenbypinidgeodata.md) | :heavy_check_mark: | Geo location data | {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
} | -| `ExpiresIn` | **int64* | :heavy_minus_sign: | The number of seconds this pin expires, by default 900 seconds | 876 | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2024-07-16T17:03:05Z | -| `ExpiresAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2024-07-16T17:18:05Z | -| `AuthToken` | **string* | :heavy_minus_sign: | N/A | gcgzw5rz2xovp84b4vha3a40 | -| `NewRegistration` | *any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/gettokenbypinidgeodata.md b/docs/models/operations/gettokenbypinidgeodata.md deleted file mode 100644 index 08d1980..0000000 --- a/docs/models/operations/gettokenbypinidgeodata.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetTokenByPinIDGeoData - -Geo location data - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `Code` | *string* | :heavy_check_mark: | The ISO 3166-1 alpha-2 code of the country. | VI | -| `ContinentCode` | *string* | :heavy_check_mark: | The continent code where the country is located. | NA | -| `Country` | *string* | :heavy_check_mark: | The official name of the country. | United States Virgin Islands | -| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam | -| `EuropeanUnionMember` | **bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true | -| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas | -| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 | -| `InPrivacyRestrictedCountry` | **bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true | -| `InPrivacyRestrictedRegion` | **bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true | -| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas | -| `Coordinates` | *string* | :heavy_check_mark: | The geographical coordinates (latitude, longitude) of the location. | 18.3381, -64.8941 | \ No newline at end of file diff --git a/docs/models/operations/gettokenbypinidrequest.md b/docs/models/operations/gettokenbypinidrequest.md deleted file mode 100644 index d4ccbc7..0000000 --- a/docs/models/operations/gettokenbypinidrequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetTokenByPinIDRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `PinID` | *int64* | :heavy_check_mark: | The PinID to retrieve an access token for | | -| `ClientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `ClientName` | **string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `DeviceNickname` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `ClientVersion` | **string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `Platform` | **string* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/models/operations/gettokenbypinidresponse.md b/docs/models/operations/gettokenbypinidresponse.md deleted file mode 100644 index ec75b46..0000000 --- a/docs/models/operations/gettokenbypinidresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenByPinIDResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 | | -| `AuthPinContainer` | [*operations.GetTokenByPinIDAuthPinContainer](../../models/operations/gettokenbypinidauthpincontainer.md) | :heavy_minus_sign: | The Pin with a non-null authToken when it has been verified by the user | {
"id": 308667304,
"code": "7RQZ",
"product": "0",
"trusted": false,
"qr": "https://plex.tv/api/v2/pins/qr/7RQZ",
"clientIdentifier": "string",
"location": {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
},
"expiresIn": 876,
"createdAt": "2024-07-16T17:03:05Z",
"expiresAt": "2024-07-16T17:18:05Z",
"authToken": null,
"newRegistration": null
} | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsauthenticationresponsestatus.md b/docs/models/operations/gettokendetailsauthenticationresponsestatus.md deleted file mode 100644 index 126ca4e..0000000 --- a/docs/models/operations/gettokendetailsauthenticationresponsestatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenDetailsAuthenticationResponseStatus - -String representation of subscriptionActive - - -## Values - -| Name | Value | -| ----------------------------------------------------- | ----------------------------------------------------- | -| `GetTokenDetailsAuthenticationResponseStatusInactive` | Inactive | -| `GetTokenDetailsAuthenticationResponseStatusActive` | Active | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsauthenticationstatus.md b/docs/models/operations/gettokendetailsauthenticationstatus.md deleted file mode 100644 index 32c252c..0000000 --- a/docs/models/operations/gettokendetailsauthenticationstatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenDetailsAuthenticationStatus - -String representation of subscriptionActive - - -## Values - -| Name | Value | -| --------------------------------------------- | --------------------------------------------- | -| `GetTokenDetailsAuthenticationStatusInactive` | Inactive | -| `GetTokenDetailsAuthenticationStatusActive` | Active | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsresponse.md b/docs/models/operations/gettokendetailsresponse.md deleted file mode 100644 index 8f92b6d..0000000 --- a/docs/models/operations/gettokendetailsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenDetailsResponse - - -## 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 | -| `UserPlexAccount` | [*operations.GetTokenDetailsUserPlexAccount](../../models/operations/gettokendetailsuserplexaccount.md) | :heavy_minus_sign: | Logged in user details | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsstatus.md b/docs/models/operations/gettokendetailsstatus.md deleted file mode 100644 index 829eaf3..0000000 --- a/docs/models/operations/gettokendetailsstatus.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetTokenDetailsStatus - - -## Values - -| Name | Value | -| ------------------------------ | ------------------------------ | -| `GetTokenDetailsStatusOnline` | online | -| `GetTokenDetailsStatusOffline` | offline | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailssubscription.md b/docs/models/operations/gettokendetailssubscription.md deleted file mode 100644 index 99f579c..0000000 --- a/docs/models/operations/gettokendetailssubscription.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetTokenDetailsSubscription - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `Features` | []*string* | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `Active` | **bool* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `SubscribedAt` | **string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `Status` | [*operations.GetTokenDetailsAuthenticationResponseStatus](../../models/operations/gettokendetailsauthenticationresponsestatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `PaymentService` | **string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `Plan` | **string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsuserplexaccount.md b/docs/models/operations/gettokendetailsuserplexaccount.md deleted file mode 100644 index d5ec028..0000000 --- a/docs/models/operations/gettokendetailsuserplexaccount.md +++ /dev/null @@ -1,50 +0,0 @@ -# GetTokenDetailsUserPlexAccount - -Logged in user details - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdsConsent` | *bool* | :heavy_check_mark: | Unknown | | -| `AdsConsentReminderAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `AdsConsentSetAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `Anonymous` | **bool* | :heavy_minus_sign: | Unknown | | -| `AuthToken` | *string* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf | -| `BackupCodesCreated` | **bool* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | | -| `Confirmed` | **bool* | :heavy_minus_sign: | If the account has been confirmed | | -| `Country` | *string* | :heavy_check_mark: | The account country | US | -| `Email` | *string* | :heavy_check_mark: | The account email address | username@email.com | -| `EmailOnlyAuth` | **bool* | :heavy_minus_sign: | If login with email only is enabled | | -| `ExperimentalFeatures` | **bool* | :heavy_minus_sign: | If experimental features are enabled | | -| `FriendlyName` | *string* | :heavy_check_mark: | Your account full name | friendlyUsername | -| `Entitlements` | []*string* | :heavy_check_mark: | List of devices your allowed to use with this account | | -| `Guest` | **bool* | :heavy_minus_sign: | If the account is a Plex Home guest user | | -| `HasPassword` | **bool* | :heavy_minus_sign: | If the account has a password | | -| `Home` | **bool* | :heavy_minus_sign: | If the account is a Plex Home user | | -| `HomeAdmin` | **bool* | :heavy_minus_sign: | If the account is the Plex Home admin | | -| `HomeSize` | *int* | :heavy_check_mark: | The number of accounts in the Plex Home | 1 | -| `ID` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 | -| `JoinedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `Locale` | *string* | :heavy_check_mark: | The account locale | | -| `MailingListActive` | **bool* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | -| `MailingListStatus` | [operations.MailingListStatus](../../models/operations/mailingliststatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active | -| `MaxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 | -| ~~`Pin`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[Might be removed] The hashed Plex Home PIN | | -| `Profile` | [operations.UserProfile](../../models/operations/userprofile.md) | :heavy_check_mark: | N/A | | -| `Protected` | **bool* | :heavy_minus_sign: | If the account has a Plex Home PIN enabled | | -| `RememberExpiresAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `Restricted` | **bool* | :heavy_minus_sign: | If the account is a Plex Home managed user | | -| `Roles` | []*string* | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | | -| `ScrobbleTypes` | *string* | :heavy_check_mark: | Unknown | | -| `Services` | [][operations.Services](../../models/operations/services.md) | :heavy_check_mark: | N/A | | -| `Subscription` | [operations.Subscription](../../models/operations/subscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | | -| `SubscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | | -| `Subscriptions` | [][operations.GetTokenDetailsSubscription](../../models/operations/gettokendetailssubscription.md) | :heavy_minus_sign: | N/A | | -| `Thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 | -| `Title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle | -| `TwoFactorEnabled` | **bool* | :heavy_minus_sign: | If two-factor authentication is enabled | | -| `Username` | *string* | :heavy_check_mark: | The account username | Username | -| `UUID` | *string* | :heavy_check_mark: | The account UUID | dae343c1f45beb4f | -| `AttributionPartner` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentcountry.md b/docs/models/operations/gettopwatchedcontentcountry.md deleted file mode 100644 index 54a9d3c..0000000 --- a/docs/models/operations/gettopwatchedcontentcountry.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTopWatchedContentCountry - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | -| `ID` | **int* | :heavy_minus_sign: | N/A | 116 | -| `Filter` | **string* | :heavy_minus_sign: | N/A | country=116 | -| `Tag` | **string* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentgenre.md b/docs/models/operations/gettopwatchedcontentgenre.md deleted file mode 100644 index 743c518..0000000 --- a/docs/models/operations/gettopwatchedcontentgenre.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTopWatchedContentGenre - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | **int* | :heavy_minus_sign: | N/A | 184 | -| `Filter` | **string* | :heavy_minus_sign: | N/A | genre=184 | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Thriller | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentguids.md b/docs/models/operations/gettopwatchedcontentguids.md deleted file mode 100644 index 0a6c61a..0000000 --- a/docs/models/operations/gettopwatchedcontentguids.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetTopWatchedContentGuids - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | **string* | :heavy_minus_sign: | N/A | tvdb://2337 | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentmediacontainer.md b/docs/models/operations/gettopwatchedcontentmediacontainer.md deleted file mode 100644 index b4ff91a..0000000 --- a/docs/models/operations/gettopwatchedcontentmediacontainer.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetTopWatchedContentMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library | -| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ | -| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 | -| `Metadata` | [][operations.GetTopWatchedContentMetadata](../../models/operations/gettopwatchedcontentmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentmetadata.md b/docs/models/operations/gettopwatchedcontentmetadata.md deleted file mode 100644 index e37274b..0000000 --- a/docs/models/operations/gettopwatchedcontentmetadata.md +++ /dev/null @@ -1,39 +0,0 @@ -# GetTopWatchedContentMetadata - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 17 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/17 | -| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | -| `Slug` | **string* | :heavy_minus_sign: | N/A | waterloo-road | -| `Studio` | **string* | :heavy_minus_sign: | N/A | Universal Pictures | -| `Type` | **string* | :heavy_minus_sign: | N/A | movie | -| `Title` | **string* | :heavy_minus_sign: | N/A | Serenity | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Movies | -| `LibrarySectionID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `LibrarySectionKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1 | -| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 | -| `Summary` | **string* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | -| `Index` | **int64* | :heavy_minus_sign: | N/A | 1 | -| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 9.1 | -| `Year` | **int* | :heavy_minus_sign: | N/A | 2005 | -| `Tagline` | **string* | :heavy_minus_sign: | N/A | They aim to misbehave. | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | -| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 141417 | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | -| `LeafCount` | **int64* | :heavy_minus_sign: | N/A | 222 | -| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | N/A | 100 | -| `ChildCount` | **int64* | :heavy_minus_sign: | N/A | 13 | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705637164 | -| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705637165 | -| `GlobalViewCount` | **int64* | :heavy_minus_sign: | N/A | 80 | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `Genre` | [][operations.GetTopWatchedContentGenre](../../models/operations/gettopwatchedcontentgenre.md) | :heavy_minus_sign: | N/A | | -| `Country` | [][operations.GetTopWatchedContentCountry](../../models/operations/gettopwatchedcontentcountry.md) | :heavy_minus_sign: | N/A | | -| `Guids` | [][operations.GetTopWatchedContentGuids](../../models/operations/gettopwatchedcontentguids.md) | :heavy_minus_sign: | N/A | | -| `Role` | [][operations.GetTopWatchedContentRole](../../models/operations/gettopwatchedcontentrole.md) | :heavy_minus_sign: | N/A | | -| `User` | [][operations.GetTopWatchedContentUser](../../models/operations/gettopwatchedcontentuser.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentqueryparamincludeguids.md b/docs/models/operations/gettopwatchedcontentqueryparamincludeguids.md deleted file mode 100644 index 964c3e6..0000000 --- a/docs/models/operations/gettopwatchedcontentqueryparamincludeguids.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetTopWatchedContentQueryParamIncludeGuids - -Adds the Guid object to the response - - - -## Values - -| Name | Value | -| --------------------------------------------------- | --------------------------------------------------- | -| `GetTopWatchedContentQueryParamIncludeGuidsDisable` | 0 | -| `GetTopWatchedContentQueryParamIncludeGuidsEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentqueryparamtype.md b/docs/models/operations/gettopwatchedcontentqueryparamtype.md deleted file mode 100644 index b068549..0000000 --- a/docs/models/operations/gettopwatchedcontentqueryparamtype.md +++ /dev/null @@ -1,24 +0,0 @@ -# GetTopWatchedContentQueryParamType - -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - - - -## Values - -| Name | Value | -| ---------------------------------------------- | ---------------------------------------------- | -| `GetTopWatchedContentQueryParamTypeMovie` | 1 | -| `GetTopWatchedContentQueryParamTypeTvShow` | 2 | -| `GetTopWatchedContentQueryParamTypeSeason` | 3 | -| `GetTopWatchedContentQueryParamTypeEpisode` | 4 | -| `GetTopWatchedContentQueryParamTypeArtist` | 5 | -| `GetTopWatchedContentQueryParamTypeAlbum` | 6 | -| `GetTopWatchedContentQueryParamTypeTrack` | 7 | -| `GetTopWatchedContentQueryParamTypePhotoAlbum` | 8 | -| `GetTopWatchedContentQueryParamTypePhoto` | 9 | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentrequest.md b/docs/models/operations/gettopwatchedcontentrequest.md deleted file mode 100644 index 9c26fb2..0000000 --- a/docs/models/operations/gettopwatchedcontentrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetTopWatchedContentRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Type` | [operations.GetTopWatchedContentQueryParamType](../../models/operations/gettopwatchedcontentqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `IncludeGuids` | [*operations.GetTopWatchedContentQueryParamIncludeGuids](../../models/operations/gettopwatchedcontentqueryparamincludeguids.md) | :heavy_minus_sign: | Adds the Guid object to the response
| 1 | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentresponse.md b/docs/models/operations/gettopwatchedcontentresponse.md deleted file mode 100644 index 2d2cbb2..0000000 --- a/docs/models/operations/gettopwatchedcontentresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTopWatchedContentResponse - - -## 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.GetTopWatchedContentResponseBody](../../models/operations/gettopwatchedcontentresponsebody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentresponsebody.md b/docs/models/operations/gettopwatchedcontentresponsebody.md deleted file mode 100644 index 898c0be..0000000 --- a/docs/models/operations/gettopwatchedcontentresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTopWatchedContentResponseBody - -The metadata of the library item. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetTopWatchedContentMediaContainer](../../models/operations/gettopwatchedcontentmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentrole.md b/docs/models/operations/gettopwatchedcontentrole.md deleted file mode 100644 index 4f5fbb2..0000000 --- a/docs/models/operations/gettopwatchedcontentrole.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetTopWatchedContentRole - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | **int* | :heavy_minus_sign: | N/A | 220 | -| `Filter` | **string* | :heavy_minus_sign: | N/A | actor=220 | -| `Tag` | **string* | :heavy_minus_sign: | N/A | Dennis Keiffer | -| `TagKey` | **string* | :heavy_minus_sign: | N/A | 5d77683554f42c001f8c4708 | -| `Role` | **string* | :heavy_minus_sign: | N/A | Bar Guy (uncredited) | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | https://metadata-static.plex.tv/6/people/648e9a7ea1d537bccfcd7615134b78ce.jpg | \ No newline at end of file diff --git a/docs/models/operations/gettopwatchedcontentuser.md b/docs/models/operations/gettopwatchedcontentuser.md deleted file mode 100644 index 9dda37e..0000000 --- a/docs/models/operations/gettopwatchedcontentuser.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetTopWatchedContentUser - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | **int* | :heavy_minus_sign: | N/A | 220 | \ No newline at end of file diff --git a/docs/models/operations/gettranscodesessionsmediacontainer.md b/docs/models/operations/gettranscodesessionsmediacontainer.md deleted file mode 100644 index 78bd72d..0000000 --- a/docs/models/operations/gettranscodesessionsmediacontainer.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetTranscodeSessionsMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Size` | **int* | :heavy_minus_sign: | N/A | 1 | -| `TranscodeSession` | [][operations.TranscodeSession](../../models/operations/transcodesession.md) | :heavy_minus_sign: | N/A | [
{
"key": "vv3i2q2lax92qlzul1hbd4bx",
"throttled": false,
"complete": false,
"progress": 1.7999999523162842,
"size": -22,
"speed": 25.100000381469727,
"error": false,
"duration": 1445695,
"remaining": 53,
"context": "streaming",
"sourceVideoCodec": "h264",
"sourceAudioCodec": "aac",
"videoDecision": "transcode",
"audioDecision": "transcode",
"subtitleDecision": "burn",
"protocol": "http",
"container": "mkv",
"videoCodec": "h264",
"audioCodec": "opus",
"audioChannels": 1,
"transcodeHwRequested": true,
"timeStamp": 1705895805.4919229,
"maxOffsetAvailable": 29.53,
"minOffsetAvailable": 3.003000020980835
}
] | \ No newline at end of file diff --git a/docs/models/operations/gettranscodesessionsresponse.md b/docs/models/operations/gettranscodesessionsresponse.md deleted file mode 100644 index 9fbca5a..0000000 --- a/docs/models/operations/gettranscodesessionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 deleted file mode 100644 index 3207969..0000000 --- a/docs/models/operations/gettranscodesessionsresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/gettransienttokenglobals.md b/docs/models/operations/gettransienttokenglobals.md new file mode 100644 index 0000000..3a9131b --- /dev/null +++ b/docs/models/operations/gettransienttokenglobals.md @@ -0,0 +1,18 @@ +# GetTransientTokenGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenmediacontainer.md b/docs/models/operations/gettransienttokenmediacontainer.md new file mode 100644 index 0000000..42286f9 --- /dev/null +++ b/docs/models/operations/gettransienttokenmediacontainer.md @@ -0,0 +1,17 @@ +# GetTransientTokenMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Token` | **string* | :heavy_minus_sign: | The transient token | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenqueryparamtype.md b/docs/models/operations/gettransienttokenqueryparamtype.md deleted file mode 100644 index 51acb40..0000000 --- a/docs/models/operations/gettransienttokenqueryparamtype.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTransientTokenQueryParamType - -`delegation` - This is the only supported `type` parameter. - - -## Values - -| Name | Value | -| ------------------------------------------- | ------------------------------------------- | -| `GetTransientTokenQueryParamTypeDelegation` | delegation | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenrequest.md b/docs/models/operations/gettransienttokenrequest.md index bab3e19..e1192ff 100644 --- a/docs/models/operations/gettransienttokenrequest.md +++ b/docs/models/operations/gettransienttokenrequest.md @@ -3,7 +3,18 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `Type` | [operations.GetTransientTokenQueryParamType](../../models/operations/gettransienttokenqueryparamtype.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 +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Type` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | The value `delegation` is the only supported `type` parameter. | | +| `Scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | The value `all` 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 index 5bad74c..30ec1d0 100644 --- a/docs/models/operations/gettransienttokenresponse.md +++ b/docs/models/operations/gettransienttokenresponse.md @@ -3,8 +3,9 @@ ## 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 +| 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.GetTransientTokenResponseBody](../../models/operations/gettransienttokenresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenresponsebody.md b/docs/models/operations/gettransienttokenresponsebody.md new file mode 100644 index 0000000..9873707 --- /dev/null +++ b/docs/models/operations/gettransienttokenresponsebody.md @@ -0,0 +1,10 @@ +# GetTransientTokenResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetTransientTokenMediaContainer](../../models/operations/gettransienttokenmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getupdatesstatusmediacontainer.md b/docs/models/operations/getupdatesstatusmediacontainer.md new file mode 100644 index 0000000..5377f97 --- /dev/null +++ b/docs/models/operations/getupdatesstatusmediacontainer.md @@ -0,0 +1,13 @@ +# GetUpdatesStatusMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `AutoUpdateVersion` | **int64* | :heavy_minus_sign: | The version of the updater (currently `1`) | +| `CanInstall` | **bool* | :heavy_minus_sign: | Indicates whether this install can be updated through these endpoints (typically only on MacOS and Windows) | +| `CheckedAt` | **int64* | :heavy_minus_sign: | The last time a check for updates was performed | +| `DownloadURL` | **string* | :heavy_minus_sign: | The URL where the update is available | +| `Release` | [][operations.Release](../../models/operations/release.md) | :heavy_minus_sign: | N/A | +| `Status` | **int64* | :heavy_minus_sign: | The current error code (`0` means no error) | \ No newline at end of file diff --git a/docs/models/operations/getupdatesstatusresponse.md b/docs/models/operations/getupdatesstatusresponse.md new file mode 100644 index 0000000..adf865e --- /dev/null +++ b/docs/models/operations/getupdatesstatusresponse.md @@ -0,0 +1,11 @@ +# GetUpdatesStatusResponse + + +## 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.GetUpdatesStatusResponseBody](../../models/operations/getupdatesstatusresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getupdatesstatusresponsebody.md b/docs/models/operations/getupdatesstatusresponsebody.md new file mode 100644 index 0000000..7c136d2 --- /dev/null +++ b/docs/models/operations/getupdatesstatusresponsebody.md @@ -0,0 +1,10 @@ +# GetUpdatesStatusResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetUpdatesStatusMediaContainer](../../models/operations/getupdatesstatusmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getupdatesstatusstate.md b/docs/models/operations/getupdatesstatusstate.md new file mode 100644 index 0000000..9f4afe7 --- /dev/null +++ b/docs/models/operations/getupdatesstatusstate.md @@ -0,0 +1,29 @@ +# GetUpdatesStatusState + +The status of this update. + +- available - This release is available +- downloading - This release is downloading +- downloaded - This release has been downloaded +- installing - This release is installing +- tonight - This release will be installed tonight +- skipped - This release has been skipped +- error - This release has an error +- notify - This release is only notifying it is available (typically because it cannot be installed on this setup) +- done - This release is complete + + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `GetUpdatesStatusStateAvailable` | available | +| `GetUpdatesStatusStateDownloading` | downloading | +| `GetUpdatesStatusStateDownloaded` | downloaded | +| `GetUpdatesStatusStateInstalling` | installing | +| `GetUpdatesStatusStateTonight` | tonight | +| `GetUpdatesStatusStateSkipped` | skipped | +| `GetUpdatesStatusStateError` | error | +| `GetUpdatesStatusStateNotify` | notify | +| `GetUpdatesStatusStateDone` | done | \ No newline at end of file diff --git a/docs/models/operations/getupdatestatusmediacontainer.md b/docs/models/operations/getupdatestatusmediacontainer.md deleted file mode 100644 index 848bdc0..0000000 --- a/docs/models/operations/getupdatestatusmediacontainer.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetUpdateStatusMediaContainer - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 1 | -| `CanInstall` | **bool* | :heavy_minus_sign: | N/A | false | -| `CheckedAt` | **int* | :heavy_minus_sign: | N/A | 1705801232 | -| `DownloadURL` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx | -| `Status` | **int* | :heavy_minus_sign: | N/A | 0 | -| `Release` | [][operations.Release](../../models/operations/release.md) | :heavy_minus_sign: | N/A | [
{
"key": "https://plex.tv/updater/releases/5136",
"version": "1.40.0.7775-456fbaf97",
"added": "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.\n(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)\n(Music) Store track genres and add filtering options (#14653)\n(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)\n(View History) No longer create a view history entry for items marked as played (#10888)\n(Web) Updated to 4.118.0",
"fixed": "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)\n(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)\n(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)\n(Collection) Server could become unresponsive when collection membership changes (#14612)\n(DVR) Previously watched recordings could be deleted without being watched again (#13779)\n(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)\n(Library) The Content Rating not equal to None filter does not work (#14620)\n(Search) Album search results could contain all the album's tracks too (#14486)\n(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)\n(Transcoder) HW encoding would fail on devices with no rate control (#14222)\n(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)",
"downloadURL": "https://plex.tv/downloads/latest/5?channel=8\u0026build=linux-x86_64\u0026distro=redhat\u0026X-Plex-Token=xxxxxxxxxxxxxxxxxxxx",
"state": "notify"
}
] | \ No newline at end of file diff --git a/docs/models/operations/getupdatestatusresponse.md b/docs/models/operations/getupdatestatusresponse.md deleted file mode 100644 index 054310c..0000000 --- a/docs/models/operations/getupdatestatusresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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 | -| `Object` | [*operations.GetUpdateStatusResponseBody](../../models/operations/getupdatestatusresponsebody.md) | :heavy_minus_sign: | The Server Updates | \ No newline at end of file diff --git a/docs/models/operations/getupdatestatusresponsebody.md b/docs/models/operations/getupdatestatusresponsebody.md deleted file mode 100644 index a18bfc4..0000000 --- a/docs/models/operations/getupdatestatusresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUpdateStatusResponseBody - -The Server Updates - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetUpdateStatusMediaContainer](../../models/operations/getupdatestatusmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getuserfriendsresponse.md b/docs/models/operations/getuserfriendsresponse.md deleted file mode 100644 index 9f4ecd9..0000000 --- a/docs/models/operations/getuserfriendsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserFriendsResponse - - -## 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 | -| `Friends` | [][operations.Friend](../../models/operations/friend.md) | :heavy_minus_sign: | Friends Data | \ No newline at end of file diff --git a/docs/models/operations/getusersmediacontainer.md b/docs/models/operations/getusersmediacontainer.md deleted file mode 100644 index 625d8b9..0000000 --- a/docs/models/operations/getusersmediacontainer.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetUsersMediaContainer - -Container holding user and server details. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `FriendlyName` | *string* | :heavy_check_mark: | The friendly name of the Plex instance. | myPlex | -| `Identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.myplex | -| `MachineIdentifier` | *string* | :heavy_check_mark: | Unique Machine identifier of the Plex server. | 3dff4c4da3b1229a649aa574a9e2b419a684a20e | -| `TotalSize` | *int64* | :heavy_check_mark: | Total number of users. | 30 | -| `Size` | *int64* | :heavy_check_mark: | Number of users in the current response. | 30 | -| `User` | [][operations.User](../../models/operations/user.md) | :heavy_check_mark: | List of users with access to the Plex server. | | \ No newline at end of file diff --git a/docs/models/operations/getusersrequest.md b/docs/models/operations/getusersrequest.md deleted file mode 100644 index cc529c0..0000000 --- a/docs/models/operations/getusersrequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetUsersRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `ClientName` | **string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `DeviceNickname` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `DeviceName` | **string* | :heavy_minus_sign: | The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.) | Chrome | -| `DeviceScreenResolution` | **string* | :heavy_minus_sign: | The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440) | 1487x1165,2560x1440 | -| `ClientVersion` | **string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `Platform` | **string* | :heavy_minus_sign: | The platform of the client application. | Roku | -| `ClientFeatures` | **string* | :heavy_minus_sign: | The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list) | external-media,indirect-media,hub-style-list | -| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | -| `XPlexSessionID` | **string* | :heavy_minus_sign: | The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca) | 97e136ef-4ddd-4ff3-89a7-a5820c96c2ca | -| `XPlexLanguage` | **string* | :heavy_minus_sign: | The language of the client application. | en | -| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | -| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/getusersresponse.md b/docs/models/operations/getusersresponse.md deleted file mode 100644 index 0d9d0fe..0000000 --- a/docs/models/operations/getusersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUsersResponse - - -## 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 | -| `Body` | *[]byte* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getusersresponsebody.md b/docs/models/operations/getusersresponsebody.md deleted file mode 100644 index 2a7b98b..0000000 --- a/docs/models/operations/getusersresponsebody.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUsersResponseBody - -Successful response with media container data in XML - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `MediaContainer` | [*operations.GetUsersMediaContainer](../../models/operations/getusersmediacontainer.md) | :heavy_minus_sign: | Container holding user and server details. | \ No newline at end of file diff --git a/docs/models/operations/getusersserver.md b/docs/models/operations/getusersserver.md deleted file mode 100644 index a7b3ec3..0000000 --- a/docs/models/operations/getusersserver.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetUsersServer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique ID of the server of the connected user | 907759180 | -| `ServerID` | *int64* | :heavy_check_mark: | ID of the actual Plex server. | 9999999 | -| `MachineIdentifier` | *string* | :heavy_check_mark: | Machine identifier of the Plex server. | fbb8aa6be6e0c997c6268bc2b4431c8807f70a3 | -| `Name` | *string* | :heavy_check_mark: | Name of the Plex server of the connected user. | ConnectedUserFlix | -| `LastSeenAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `NumLibraries` | *int64* | :heavy_check_mark: | Number of libraries in the server this user has access to. | 16 | -| `AllLibraries` | [*operations.AllLibraries](../../models/operations/alllibraries.md) | :heavy_minus_sign: | N/A | 1 | -| `Owned` | [*operations.Owned](../../models/operations/owned.md) | :heavy_minus_sign: | N/A | 1 | -| `Pending` | [*operations.Pending](../../models/operations/pending.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/getwatchlistrequest.md b/docs/models/operations/getwatchlistrequest.md deleted file mode 100644 index 6ea21db..0000000 --- a/docs/models/operations/getwatchlistrequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetWatchListRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Filter` | [operations.Filter](../../models/operations/filter.md) | :heavy_check_mark: | Filter | | -| `Sort` | **string* | :heavy_minus_sign: | In the format "field:dir". Available fields are "watchlistedAt" (Added At),
"titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
"dir" can be "asc" or "desc"
| | -| `Libtype` | [*operations.Libtype](../../models/operations/libtype.md) | :heavy_minus_sign: | The type of library to filter. Can be "movie" or "show", or all if not present.
| | -| `Maxresults` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
| | -| `IncludeCollections` | [*operations.IncludeCollections](../../models/operations/includecollections.md) | :heavy_minus_sign: | include collections in the results
| | -| `IncludeExternalMedia` | [*operations.IncludeExternalMedia](../../models/operations/includeexternalmedia.md) | :heavy_minus_sign: | include external media in the results
| | -| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | -| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | -| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/getwatchlistresponse.md b/docs/models/operations/getwatchlistresponse.md deleted file mode 100644 index 4953e5a..0000000 --- a/docs/models/operations/getwatchlistresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetWatchListResponse - - -## 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.GetWatchListResponseBody](../../models/operations/getwatchlistresponsebody.md) | :heavy_minus_sign: | Watchlist Data | \ No newline at end of file diff --git a/docs/models/operations/getwatchlistresponsebody.md b/docs/models/operations/getwatchlistresponsebody.md deleted file mode 100644 index 1196c47..0000000 --- a/docs/models/operations/getwatchlistresponsebody.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetWatchListResponseBody - -Watchlist Data - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `LibrarySectionID` | **string* | :heavy_minus_sign: | N/A | -| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | -| `Offset` | **int* | :heavy_minus_sign: | N/A | -| `TotalSize` | **int* | :heavy_minus_sign: | N/A | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | -| `Size` | **int* | :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/guids.md b/docs/models/operations/guids.md deleted file mode 100644 index 00d6170..0000000 --- a/docs/models/operations/guids.md +++ /dev/null @@ -1,8 +0,0 @@ -# Guids - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
| {
"imdbExample": {
"summary": "IMDB example",
"value": "imdb://tt13015952"
},
"tmdbExample": {
"summary": "TMDB example",
"value": "tmdb://2434012"
},
"tvdbExample": {
"summary": "TVDB example",
"value": "tvdb://7945991"
}
} | \ No newline at end of file diff --git a/docs/models/operations/hasthumbnail.md b/docs/models/operations/hasthumbnail.md deleted file mode 100644 index 52406a1..0000000 --- a/docs/models/operations/hasthumbnail.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasThumbnail - -Indicates if the part has a thumbnail. - - -## Values - -| Name | Value | -| ------------------- | ------------------- | -| `HasThumbnailFalse` | 0 | -| `HasThumbnailTrue` | 1 | \ No newline at end of file diff --git a/docs/models/operations/hidden.md b/docs/models/operations/hidden.md deleted file mode 100644 index 803084c..0000000 --- a/docs/models/operations/hidden.md +++ /dev/null @@ -1,12 +0,0 @@ -# Hidden - -The Plex library visibility setting - - -## Values - -| Name | Value | -| ---------------------------------------- | ---------------------------------------- | -| `HiddenVisible` | 0 | -| `HiddenExcludeHomeScreen` | 1 | -| `HiddenExcludeHomeScreenAndGlobalSearch` | 2 | \ No newline at end of file diff --git a/docs/models/operations/hints.md b/docs/models/operations/hints.md new file mode 100644 index 0000000..baedb29 --- /dev/null +++ b/docs/models/operations/hints.md @@ -0,0 +1,9 @@ +# Hints + +Hints describing what we're looking for. Note: The hint `ratingKey` is required for downloading from a PMS remote. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/home.md b/docs/models/operations/home.md deleted file mode 100644 index d5a389b..0000000 --- a/docs/models/operations/home.md +++ /dev/null @@ -1,11 +0,0 @@ -# Home - -Indicates if the user is part of a home group. - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `HomeDisable` | 0 | -| `HomeEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/homevisibility.md b/docs/models/operations/homevisibility.md new file mode 100644 index 0000000..f276624 --- /dev/null +++ b/docs/models/operations/homevisibility.md @@ -0,0 +1,18 @@ +# HomeVisibility + +Whether this hub is visible on the home screen + - all: Visible to all users + - none: Visible to no users + - admin: Visible to only admin users + - shared: Visible to shared users + + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `HomeVisibilityAll` | all | +| `HomeVisibilityNone` | none | +| `HomeVisibilityAdmin` | admin | +| `HomeVisibilityShared` | shared | \ No newline at end of file diff --git a/docs/models/operations/hub.md b/docs/models/operations/hub.md index e5762b6..5dc672e 100644 --- a/docs/models/operations/hub.md +++ b/docs/models/operations/hub.md @@ -3,16 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `HubKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/50768,65523,58188,57341,57302,57070 | -| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/all?type=15&sort=lastViewedAt:desc&playlistType=video,audio | -| `Title` | **string* | :heavy_minus_sign: | N/A | Recent Playlists | -| `Type` | **string* | :heavy_minus_sign: | N/A | playlist | -| `HubIdentifier` | **string* | :heavy_minus_sign: | N/A | home.playlists | -| `Context` | **string* | :heavy_minus_sign: | N/A | hub.home.playlists | -| `Size` | **int* | :heavy_minus_sign: | N/A | 6 | -| `More` | **bool* | :heavy_minus_sign: | N/A | true | -| `Style` | **string* | :heavy_minus_sign: | N/A | shelf | -| `Promoted` | **bool* | :heavy_minus_sign: | N/A | true | -| `Metadata` | [][operations.GetGlobalHubsMetadata](../../models/operations/getglobalhubsmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `HomeVisibility` | [*operations.HomeVisibility](../../models/operations/homevisibility.md) | :heavy_minus_sign: | Whether this hub is visible on the home screen
- all: Visible to all users
- none: Visible to no users
- admin: Visible to only admin users
- shared: Visible to shared users
| +| `Identifier` | **string* | :heavy_minus_sign: | The identifier for this hub | +| `PromotedToOwnHome` | **bool* | :heavy_minus_sign: | Whether this hub is visible to admin user home | +| `PromotedToRecommended` | **bool* | :heavy_minus_sign: | Whether this hub is promoted to all for recommendations | +| `PromotedToSharedHome` | **bool* | :heavy_minus_sign: | Whether this hub is visible to shared user's home | +| `RecommendationsVisibility` | [*operations.RecommendationsVisibility](../../models/operations/recommendationsvisibility.md) | :heavy_minus_sign: | The visibility of this hub in recommendations:
- all: Visible to all users
- none: Visible to no users
- admin: Visible to only admin users
- shared: Visible to shared users
| +| `Title` | **string* | :heavy_minus_sign: | The title of this hub | \ No newline at end of file diff --git a/docs/models/operations/image.md b/docs/models/operations/image.md deleted file mode 100644 index 38ea6c5..0000000 --- a/docs/models/operations/image.md +++ /dev/null @@ -1,10 +0,0 @@ -# Image - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Alt` | **string* | :heavy_minus_sign: | N/A | -| `Type` | **string* | :heavy_minus_sign: | N/A | -| `URL` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/includeadvanced.md b/docs/models/operations/includeadvanced.md deleted file mode 100644 index fab0e97..0000000 --- a/docs/models/operations/includeadvanced.md +++ /dev/null @@ -1,9 +0,0 @@ -# IncludeAdvanced - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `IncludeAdvancedDisable` | 0 | -| `IncludeAdvancedEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/includecollections.md b/docs/models/operations/includecollections.md deleted file mode 100644 index 849b586..0000000 --- a/docs/models/operations/includecollections.md +++ /dev/null @@ -1,12 +0,0 @@ -# IncludeCollections - -include collections in the results - - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `IncludeCollectionsOne` | 1 | -| `IncludeCollectionsZero` | 0 | \ No newline at end of file diff --git a/docs/models/operations/includedetails.md b/docs/models/operations/includedetails.md deleted file mode 100644 index 8552d99..0000000 --- a/docs/models/operations/includedetails.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/includeexternalmedia.md b/docs/models/operations/includeexternalmedia.md deleted file mode 100644 index 8153426..0000000 --- a/docs/models/operations/includeexternalmedia.md +++ /dev/null @@ -1,12 +0,0 @@ -# IncludeExternalMedia - -include external media in the results - - - -## Values - -| Name | Value | -| -------------------------- | -------------------------- | -| `IncludeExternalMediaOne` | 1 | -| `IncludeExternalMediaZero` | 0 | \ No newline at end of file diff --git a/docs/models/operations/includeguids.md b/docs/models/operations/includeguids.md deleted file mode 100644 index da76a94..0000000 --- a/docs/models/operations/includeguids.md +++ /dev/null @@ -1,12 +0,0 @@ -# IncludeGuids - -Adds the Guids object to the response - - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `IncludeGuidsDisable` | 0 | -| `IncludeGuidsEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/includehttps.md b/docs/models/operations/includehttps.md deleted file mode 100644 index 8b633bc..0000000 --- a/docs/models/operations/includehttps.md +++ /dev/null @@ -1,11 +0,0 @@ -# IncludeHTTPS - -Include Https entries in the results - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `IncludeHTTPSDisable` | 0 | -| `IncludeHTTPSEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/includeipv6.md b/docs/models/operations/includeipv6.md deleted file mode 100644 index 4a684d0..0000000 --- a/docs/models/operations/includeipv6.md +++ /dev/null @@ -1,11 +0,0 @@ -# IncludeIPv6 - -Include IPv6 entries in the results - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `IncludeIPv6Disable` | 0 | -| `IncludeIPv6Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/includemeta.md b/docs/models/operations/includemeta.md deleted file mode 100644 index 7d36eef..0000000 --- a/docs/models/operations/includemeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# IncludeMeta - -Adds the Meta object to the response - - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `IncludeMetaDisable` | 0 | -| `IncludeMetaEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/includerelay.md b/docs/models/operations/includerelay.md deleted file mode 100644 index 8271a3c..0000000 --- a/docs/models/operations/includerelay.md +++ /dev/null @@ -1,13 +0,0 @@ -# IncludeRelay - -Include Relay addresses in the results -E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 - - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `IncludeRelayDisable` | 0 | -| `IncludeRelayEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/index.md b/docs/models/operations/index.md new file mode 100644 index 0000000..85a01ea --- /dev/null +++ b/docs/models/operations/index.md @@ -0,0 +1,10 @@ +# Index + +The type of index to grab. + + +## Values + +| Name | Value | +| --------- | --------- | +| `IndexSd` | sd | \ No newline at end of file diff --git a/docs/models/operations/ingesttransientitemglobals.md b/docs/models/operations/ingesttransientitemglobals.md new file mode 100644 index 0000000..c76039b --- /dev/null +++ b/docs/models/operations/ingesttransientitemglobals.md @@ -0,0 +1,18 @@ +# IngestTransientItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/ingesttransientitemrequest.md b/docs/models/operations/ingesttransientitemrequest.md new file mode 100644 index 0000000..0ebfd66 --- /dev/null +++ b/docs/models/operations/ingesttransientitemrequest.md @@ -0,0 +1,22 @@ +# IngestTransientItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URL` | **string* | :heavy_minus_sign: | The file of the file to ingest. | file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv | +| `VirtualFilePath` | **string* | :heavy_minus_sign: | A virtual path to use when the url is opaque. | /Avatar.mkv | +| `ComputeHashes` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether or not to compute Plex and OpenSubtitle hashes for the file. Defaults to 0. | 1 | +| `IngestNonMatches` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether or not non matching media should be stored. Defaults to 0. | 1 | \ No newline at end of file diff --git a/docs/models/operations/ingesttransientitemresponse.md b/docs/models/operations/ingesttransientitemresponse.md new file mode 100644 index 0000000..e170907 --- /dev/null +++ b/docs/models/operations/ingesttransientitemresponse.md @@ -0,0 +1,12 @@ +# IngestTransientItemResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/internalpaymentmethod.md b/docs/models/operations/internalpaymentmethod.md deleted file mode 100644 index f1103c2..0000000 --- a/docs/models/operations/internalpaymentmethod.md +++ /dev/null @@ -1,7 +0,0 @@ -# InternalPaymentMethod - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/item.md b/docs/models/operations/item.md new file mode 100644 index 0000000..36038da --- /dev/null +++ b/docs/models/operations/item.md @@ -0,0 +1,19 @@ +# Item + +Note: OpenAPI cannot properly render this query parameter example ([See GHI](https://github.com/OAI/OpenAPI-Specification/issues/1706)). It should be rendered as: + +Item[type]=42&Item[title]=Jack-Jack Attack&Item[target]=&Item[targetTagID]=1&Item[locationID]=-1&Item[Location][uri]=library://82503060-0d68-4603-b594-8b071d54819e/item//library/metadata/146&Item[Policy][scope]=all&Item[Policy][value]=&Item[Policy][unwatched]=0 + + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `Location` | [*operations.ModifyPlaylistGeneratorQueryParamLocation](../../models/operations/modifyplaylistgeneratorqueryparamlocation.md) | :heavy_minus_sign: | N/A | +| `LocationID` | **int64* | :heavy_minus_sign: | N/A | +| `Policy` | [*operations.Policy](../../models/operations/policy.md) | :heavy_minus_sign: | N/A | +| `Target` | **string* | :heavy_minus_sign: | N/A | +| `TargetTagID` | **int64* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/language.md b/docs/models/operations/language.md new file mode 100644 index 0000000..be3ef8c --- /dev/null +++ b/docs/models/operations/language.md @@ -0,0 +1,9 @@ +# Language + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `Code` | **string* | :heavy_minus_sign: | 3 letter language code | +| `Title` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/level.md b/docs/models/operations/level.md index 5a34011..3217cd6 100644 --- a/docs/models/operations/level.md +++ b/docs/models/operations/level.md @@ -1,11 +1,11 @@ # Level An integer log level to write to the PMS log with. -0: Error -1: Warning -2: Info -3: Debug -4: Verbose + - 0: Error + - 1: Warning + - 2: Info + - 3: Debug + - 4: Verbose diff --git a/docs/models/operations/libtype.md b/docs/models/operations/libtype.md deleted file mode 100644 index bc69dfc..0000000 --- a/docs/models/operations/libtype.md +++ /dev/null @@ -1,12 +0,0 @@ -# Libtype - -The type of library to filter. Can be "movie" or "show", or all if not present. - - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `LibtypeMovie` | movie | -| `LibtypeShow` | show | \ No newline at end of file diff --git a/docs/models/operations/lineup.md b/docs/models/operations/lineup.md new file mode 100644 index 0000000..9f4ea58 --- /dev/null +++ b/docs/models/operations/lineup.md @@ -0,0 +1,13 @@ +# Lineup + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | The type of this object (`lineup` in this case) | +| `LineupType` | [*operations.LineupType](../../models/operations/lineuptype.md) | :heavy_minus_sign: | - `-1`: N/A
- `0`: Over the air
- `1`: Cable
- `2`: Satellite
- `3`: IPTV
- `4`: Virtual
| +| `Location` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | The uuid of this lineup | +| `Channel` | [][components.Channel](../../models/components/channel.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/lineuptype.md b/docs/models/operations/lineuptype.md new file mode 100644 index 0000000..aeb9daa --- /dev/null +++ b/docs/models/operations/lineuptype.md @@ -0,0 +1,21 @@ +# LineupType + +- `-1`: N/A +- `0`: Over the air +- `1`: Cable +- `2`: Satellite +- `3`: IPTV +- `4`: Virtual + + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `LineupTypeMinus1` | -1 | +| `LineupTypeZero` | 0 | +| `LineupTypeOne` | 1 | +| `LineupTypeTwo` | 2 | +| `LineupTypeThree` | 3 | +| `LineupTypeFour` | 4 | \ No newline at end of file diff --git a/docs/models/operations/listactivitiesmediacontainer.md b/docs/models/operations/listactivitiesmediacontainer.md new file mode 100644 index 0000000..960ce9a --- /dev/null +++ b/docs/models/operations/listactivitiesmediacontainer.md @@ -0,0 +1,8 @@ +# ListActivitiesMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `Activity` | [][operations.Activity](../../models/operations/activity.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listactivitiesresponse.md b/docs/models/operations/listactivitiesresponse.md new file mode 100644 index 0000000..6cd285f --- /dev/null +++ b/docs/models/operations/listactivitiesresponse.md @@ -0,0 +1,11 @@ +# ListActivitiesResponse + + +## 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.ListActivitiesResponseBody](../../models/operations/listactivitiesresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listactivitiesresponsebody.md b/docs/models/operations/listactivitiesresponsebody.md new file mode 100644 index 0000000..ca9514b --- /dev/null +++ b/docs/models/operations/listactivitiesresponsebody.md @@ -0,0 +1,10 @@ +# ListActivitiesResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListActivitiesMediaContainer](../../models/operations/listactivitiesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listcontentglobals.md b/docs/models/operations/listcontentglobals.md new file mode 100644 index 0000000..1fb3bf2 --- /dev/null +++ b/docs/models/operations/listcontentglobals.md @@ -0,0 +1,18 @@ +# ListContentGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listcontentrequest.md b/docs/models/operations/listcontentrequest.md new file mode 100644 index 0000000..dd6e68c --- /dev/null +++ b/docs/models/operations/listcontentrequest.md @@ -0,0 +1,20 @@ +# ListContentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `MediaQuery` | [*components.MediaQuery](../../models/components/mediaquery.md) | :heavy_minus_sign: | This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries | | +| `SectionID` | *string* | :heavy_check_mark: | The id of the section | | \ No newline at end of file diff --git a/docs/models/operations/listcontentresponse.md b/docs/models/operations/listcontentresponse.md new file mode 100644 index 0000000..6839409 --- /dev/null +++ b/docs/models/operations/listcontentresponse.md @@ -0,0 +1,12 @@ +# ListContentResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdevicesresponse.md b/docs/models/operations/listdevicesresponse.md new file mode 100644 index 0000000..73cb72e --- /dev/null +++ b/docs/models/operations/listdevicesresponse.md @@ -0,0 +1,12 @@ +# ListDevicesResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdownloadqueueitemsglobals.md b/docs/models/operations/listdownloadqueueitemsglobals.md new file mode 100644 index 0000000..91f75e2 --- /dev/null +++ b/docs/models/operations/listdownloadqueueitemsglobals.md @@ -0,0 +1,18 @@ +# ListDownloadQueueItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listdownloadqueueitemsmediacontainer.md b/docs/models/operations/listdownloadqueueitemsmediacontainer.md new file mode 100644 index 0000000..58cd456 --- /dev/null +++ b/docs/models/operations/listdownloadqueueitemsmediacontainer.md @@ -0,0 +1,17 @@ +# ListDownloadQueueItemsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `DownloadQueueItem` | [][operations.DownloadQueueItem](../../models/operations/downloadqueueitem.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdownloadqueueitemsrequest.md b/docs/models/operations/listdownloadqueueitemsrequest.md new file mode 100644 index 0000000..fe31d94 --- /dev/null +++ b/docs/models/operations/listdownloadqueueitemsrequest.md @@ -0,0 +1,19 @@ +# ListDownloadQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | \ No newline at end of file diff --git a/docs/models/operations/listdownloadqueueitemsresponse.md b/docs/models/operations/listdownloadqueueitemsresponse.md new file mode 100644 index 0000000..aafc288 --- /dev/null +++ b/docs/models/operations/listdownloadqueueitemsresponse.md @@ -0,0 +1,11 @@ +# ListDownloadQueueItemsResponse + + +## 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.ListDownloadQueueItemsResponseBody](../../models/operations/listdownloadqueueitemsresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listdownloadqueueitemsresponsebody.md b/docs/models/operations/listdownloadqueueitemsresponsebody.md new file mode 100644 index 0000000..55d44d4 --- /dev/null +++ b/docs/models/operations/listdownloadqueueitemsresponsebody.md @@ -0,0 +1,10 @@ +# ListDownloadQueueItemsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListDownloadQueueItemsMediaContainer](../../models/operations/listdownloadqueueitemsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdownloadqueueitemsstatus.md b/docs/models/operations/listdownloadqueueitemsstatus.md new file mode 100644 index 0000000..9fc6114 --- /dev/null +++ b/docs/models/operations/listdownloadqueueitemsstatus.md @@ -0,0 +1,22 @@ +# ListDownloadQueueItemsStatus + +The state of the item: + - deciding: The item decision is pending + - waiting: The item is waiting for transcode + - processing: The item is being transcoded + - available: The item is available for download + - error: The item encountered an error in the decision or transcode + - expired: The transcoded item has timed out and is no longer available + + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ListDownloadQueueItemsStatusDeciding` | deciding | +| `ListDownloadQueueItemsStatusWaiting` | waiting | +| `ListDownloadQueueItemsStatusProcessing` | processing | +| `ListDownloadQueueItemsStatusAvailable` | available | +| `ListDownloadQueueItemsStatusError` | error | +| `ListDownloadQueueItemsStatusExpired` | expired | \ No newline at end of file diff --git a/docs/models/operations/listdvrsdvrsmediacontainer.md b/docs/models/operations/listdvrsdvrsmediacontainer.md new file mode 100644 index 0000000..c11ef3c --- /dev/null +++ b/docs/models/operations/listdvrsdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# ListDVRsDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/listdvrsmediacontainer.md b/docs/models/operations/listdvrsmediacontainer.md new file mode 100644 index 0000000..85a41b1 --- /dev/null +++ b/docs/models/operations/listdvrsmediacontainer.md @@ -0,0 +1,9 @@ +# ListDVRsMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListDVRsDVRsMediaContainer](../../models/operations/listdvrsdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.Dvr](../../models/operations/dvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdvrsresponse.md b/docs/models/operations/listdvrsresponse.md new file mode 100644 index 0000000..c1570f6 --- /dev/null +++ b/docs/models/operations/listdvrsresponse.md @@ -0,0 +1,12 @@ +# ListDVRsResponse + + +## 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.ListDVRsResponseBody](../../models/operations/listdvrsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdvrsresponsebody.md b/docs/models/operations/listdvrsresponsebody.md new file mode 100644 index 0000000..236eff8 --- /dev/null +++ b/docs/models/operations/listdvrsresponsebody.md @@ -0,0 +1,10 @@ +# ListDVRsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListDVRsMediaContainer](../../models/operations/listdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listhubsglobals.md b/docs/models/operations/listhubsglobals.md new file mode 100644 index 0000000..a728442 --- /dev/null +++ b/docs/models/operations/listhubsglobals.md @@ -0,0 +1,18 @@ +# ListHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listhubsmediacontainer.md b/docs/models/operations/listhubsmediacontainer.md new file mode 100644 index 0000000..4fac17a --- /dev/null +++ b/docs/models/operations/listhubsmediacontainer.md @@ -0,0 +1,17 @@ +# ListHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][operations.Hub](../../models/operations/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listhubsrequest.md b/docs/models/operations/listhubsrequest.md new file mode 100644 index 0000000..93821a2 --- /dev/null +++ b/docs/models/operations/listhubsrequest.md @@ -0,0 +1,20 @@ +# ListHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to reorder | | +| `MetadataItemID` | **int64* | :heavy_minus_sign: | Restrict hubs to ones relevant to the provided metadata item | | \ No newline at end of file diff --git a/docs/models/operations/listhubsresponse.md b/docs/models/operations/listhubsresponse.md new file mode 100644 index 0000000..cca20bc --- /dev/null +++ b/docs/models/operations/listhubsresponse.md @@ -0,0 +1,12 @@ +# ListHubsResponse + + +## 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.ListHubsResponseBody](../../models/operations/listhubsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listhubsresponsebody.md b/docs/models/operations/listhubsresponsebody.md new file mode 100644 index 0000000..9aa09b7 --- /dev/null +++ b/docs/models/operations/listhubsresponsebody.md @@ -0,0 +1,10 @@ +# ListHubsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListHubsMediaContainer](../../models/operations/listhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listlineupsglobals.md b/docs/models/operations/listlineupsglobals.md new file mode 100644 index 0000000..71d505e --- /dev/null +++ b/docs/models/operations/listlineupsglobals.md @@ -0,0 +1,18 @@ +# ListLineupsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listlineupsrequest.md b/docs/models/operations/listlineupsrequest.md new file mode 100644 index 0000000..0875712 --- /dev/null +++ b/docs/models/operations/listlineupsrequest.md @@ -0,0 +1,21 @@ +# ListLineupsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Country` | *string* | :heavy_check_mark: | 3 letter country code | | +| `EpgID` | *string* | :heavy_check_mark: | The `providerIdentifier` of the provider | | +| `Region` | *string* | :heavy_check_mark: | The region for the lineup | | \ No newline at end of file diff --git a/docs/models/operations/listlineupsresponse.md b/docs/models/operations/listlineupsresponse.md new file mode 100644 index 0000000..3a1004f --- /dev/null +++ b/docs/models/operations/listlineupsresponse.md @@ -0,0 +1,12 @@ +# ListLineupsResponse + + +## 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 | +| `MediaContainerWithLineup` | [*components.MediaContainerWithLineup](../../models/components/mediacontainerwithlineup.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listmatchesglobals.md b/docs/models/operations/listmatchesglobals.md new file mode 100644 index 0000000..a96bd68 --- /dev/null +++ b/docs/models/operations/listmatchesglobals.md @@ -0,0 +1,18 @@ +# ListMatchesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listmatchesrequest.md b/docs/models/operations/listmatchesrequest.md new file mode 100644 index 0000000..7555857 --- /dev/null +++ b/docs/models/operations/listmatchesrequest.md @@ -0,0 +1,25 @@ +# ListMatchesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Title` | **string* | :heavy_minus_sign: | N/A | | +| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | | +| `Agent` | **string* | :heavy_minus_sign: | N/A | | +| `Language` | **string* | :heavy_minus_sign: | N/A | | +| `Year` | **int64* | :heavy_minus_sign: | N/A | | +| `Manual` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/listmatchesresponse.md b/docs/models/operations/listmatchesresponse.md new file mode 100644 index 0000000..b180db7 --- /dev/null +++ b/docs/models/operations/listmatchesresponse.md @@ -0,0 +1,11 @@ +# ListMatchesResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listmomentsglobals.md b/docs/models/operations/listmomentsglobals.md new file mode 100644 index 0000000..d82d57b --- /dev/null +++ b/docs/models/operations/listmomentsglobals.md @@ -0,0 +1,18 @@ +# ListMomentsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listmomentsrequest.md b/docs/models/operations/listmomentsrequest.md new file mode 100644 index 0000000..ff958b6 --- /dev/null +++ b/docs/models/operations/listmomentsrequest.md @@ -0,0 +1,19 @@ +# ListMomentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/listmomentsresponse.md b/docs/models/operations/listmomentsresponse.md new file mode 100644 index 0000000..4a6f7b2 --- /dev/null +++ b/docs/models/operations/listmomentsresponse.md @@ -0,0 +1,11 @@ +# ListMomentsResponse + + +## 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 | +| `MediaContainerWithArtwork` | [*components.MediaContainerWithArtwork](../../models/components/mediacontainerwithartwork.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listpersonmediaglobals.md b/docs/models/operations/listpersonmediaglobals.md new file mode 100644 index 0000000..b7ec6a5 --- /dev/null +++ b/docs/models/operations/listpersonmediaglobals.md @@ -0,0 +1,18 @@ +# ListPersonMediaGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listpersonmediarequest.md b/docs/models/operations/listpersonmediarequest.md new file mode 100644 index 0000000..5105f92 --- /dev/null +++ b/docs/models/operations/listpersonmediarequest.md @@ -0,0 +1,19 @@ +# ListPersonMediaRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PersonID` | *string* | :heavy_check_mark: | Either the PMS tag `id` of the person or `tagKey` of the actor. Note the `tagKey` is the hex portion of the plex guid for the actor | | \ No newline at end of file diff --git a/docs/models/operations/listpersonmediaresponse.md b/docs/models/operations/listpersonmediaresponse.md new file mode 100644 index 0000000..1a550a0 --- /dev/null +++ b/docs/models/operations/listpersonmediaresponse.md @@ -0,0 +1,11 @@ +# ListPersonMediaResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listplaybackhistoryglobals.md b/docs/models/operations/listplaybackhistoryglobals.md new file mode 100644 index 0000000..2b11966 --- /dev/null +++ b/docs/models/operations/listplaybackhistoryglobals.md @@ -0,0 +1,18 @@ +# ListPlaybackHistoryGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listplaybackhistorymediacontainer.md b/docs/models/operations/listplaybackhistorymediacontainer.md new file mode 100644 index 0000000..3ee3208 --- /dev/null +++ b/docs/models/operations/listplaybackhistorymediacontainer.md @@ -0,0 +1,17 @@ +# ListPlaybackHistoryMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [][operations.ListPlaybackHistoryMetadata](../../models/operations/listplaybackhistorymetadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listplaybackhistorymetadata.md b/docs/models/operations/listplaybackhistorymetadata.md new file mode 100644 index 0000000..228f568 --- /dev/null +++ b/docs/models/operations/listplaybackhistorymetadata.md @@ -0,0 +1,18 @@ +# ListPlaybackHistoryMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `AccountID` | **int64* | :heavy_minus_sign: | The account id of this playback | +| `DeviceID` | **int64* | :heavy_minus_sign: | The device id which played the item | +| `HistoryKey` | **string* | :heavy_minus_sign: | The key for this individual history item | +| `Key` | **string* | :heavy_minus_sign: | The metadata key for the item played | +| `LibrarySectionID` | **string* | :heavy_minus_sign: | The library section id containing the item played | +| `OriginallyAvailableAt` | **string* | :heavy_minus_sign: | The originally available at of the item played | +| `RatingKey` | **string* | :heavy_minus_sign: | The rating key for the item played | +| `Thumb` | **string* | :heavy_minus_sign: | The thumb of the item played | +| `Title` | **string* | :heavy_minus_sign: | The title of the item played | +| `Type` | **string* | :heavy_minus_sign: | The metadata type of the item played | +| `ViewedAt` | **int64* | :heavy_minus_sign: | The time when the item was played | \ No newline at end of file diff --git a/docs/models/operations/listplaybackhistoryrequest.md b/docs/models/operations/listplaybackhistoryrequest.md new file mode 100644 index 0000000..7f7e590 --- /dev/null +++ b/docs/models/operations/listplaybackhistoryrequest.md @@ -0,0 +1,23 @@ +# ListPlaybackHistoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `AccountID` | **int64* | :heavy_minus_sign: | The account id to restrict view history | | +| `ViewedAt` | **int64* | :heavy_minus_sign: | The time period to restrict history (typically of the form `viewedAt>=12456789`) | | +| `LibrarySectionID` | **int64* | :heavy_minus_sign: | The library section id to restrict view history | | +| `MetadataItemID` | **int64* | :heavy_minus_sign: | The metadata item to restrict view history (can provide the id for a show to see all of that show's view history). Note this is translated to `metadata_items.id`, `parents.id`, or `grandparents.id` internally depending on the metadata type. | | +| `Sort` | []*string* | :heavy_minus_sign: | The field on which to sort. Multiple orderings can be specified separated by `,` and the direction specified following a `:` (`desc` or `asc`; `asc` is assumed if not provided). Note `metadataItemID` may not be used here. | viewedAt:desc,accountID | \ No newline at end of file diff --git a/docs/models/operations/listplaybackhistoryresponse.md b/docs/models/operations/listplaybackhistoryresponse.md new file mode 100644 index 0000000..8ea0a4f --- /dev/null +++ b/docs/models/operations/listplaybackhistoryresponse.md @@ -0,0 +1,12 @@ +# ListPlaybackHistoryResponse + + +## 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.ListPlaybackHistoryResponseBody](../../models/operations/listplaybackhistoryresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listplaybackhistoryresponsebody.md b/docs/models/operations/listplaybackhistoryresponsebody.md new file mode 100644 index 0000000..0e217a2 --- /dev/null +++ b/docs/models/operations/listplaybackhistoryresponsebody.md @@ -0,0 +1,10 @@ +# ListPlaybackHistoryResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListPlaybackHistoryMediaContainer](../../models/operations/listplaybackhistorymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listplaylistsglobals.md b/docs/models/operations/listplaylistsglobals.md new file mode 100644 index 0000000..0e98ec5 --- /dev/null +++ b/docs/models/operations/listplaylistsglobals.md @@ -0,0 +1,18 @@ +# ListPlaylistsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listplaylistsrequest.md b/docs/models/operations/listplaylistsrequest.md new file mode 100644 index 0000000..0b33b58 --- /dev/null +++ b/docs/models/operations/listplaylistsrequest.md @@ -0,0 +1,20 @@ +# ListPlaylistsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistType` | [*operations.PlaylistType](../../models/operations/playlisttype.md) | :heavy_minus_sign: | Limit to a type of playlist | | +| `Smart` | **bool* | :heavy_minus_sign: | Whether this is a smart collection/playlist | | \ No newline at end of file diff --git a/docs/models/operations/listplaylistsresponse.md b/docs/models/operations/listplaylistsresponse.md new file mode 100644 index 0000000..e72f121 --- /dev/null +++ b/docs/models/operations/listplaylistsresponse.md @@ -0,0 +1,12 @@ +# ListPlaylistsResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listprovidersmediacontainer.md b/docs/models/operations/listprovidersmediacontainer.md new file mode 100644 index 0000000..4e52541 --- /dev/null +++ b/docs/models/operations/listprovidersmediacontainer.md @@ -0,0 +1,68 @@ +# ListProvidersMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | A unique identifier for the provider, e.g. `com.plexapp.plugins.library`. | | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| | +| `Size` | **int64* | :heavy_minus_sign: | N/A | | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| | +| `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` | **int64* | :heavy_minus_sign: | N/A | 7 | +| `MachineIdentifier` | *any* | :heavy_minus_sign: | N/A | 0123456789abcdef0123456789abcdef012345678 | +| `MediaProviders` | **bool* | :heavy_minus_sign: | N/A | | +| `Multiuser` | **bool* | :heavy_minus_sign: | N/A | | +| `MusicAnalysis` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `MyPlex` | **bool* | :heavy_minus_sign: | N/A | | +| `MyPlexMappingState` | *any* | :heavy_minus_sign: | N/A | mapped | +| `MyPlexSigninState` | *any* | :heavy_minus_sign: | N/A | ok | +| `MyPlexSubscription` | **bool* | :heavy_minus_sign: | N/A | | +| `MyPlexUsername` | **string* | :heavy_minus_sign: | N/A | | +| `OfflineTranscode` | *any* | :heavy_minus_sign: | N/A | 1 | +| `OwnerFeatures` | **string* | :heavy_minus_sign: | A comma-separated list of features which are enabled for the server owner | | +| `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` | **int64* | :heavy_minus_sign: | N/A | | +| `StreamingBrainVersion` | **int64* | :heavy_minus_sign: | N/A | | +| `Sync` | **bool* | :heavy_minus_sign: | N/A | | +| `TranscoderActiveVideoSessions` | **int64* | :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` | *any* | :heavy_minus_sign: | The suggested video quality bitrates to present to the user | | +| `TranscoderVideoQualities` | **string* | :heavy_minus_sign: | N/A | | +| `TranscoderVideoResolutions` | *any* | :heavy_minus_sign: | The suggested video resolutions to the above quality bitrates | | +| `UpdatedAt` | **int64* | :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 | | +| `Feature` | [][operations.Feature](../../models/operations/feature.md) | :heavy_minus_sign: | N/A | | +| `Protocols` | **string* | :heavy_minus_sign: | A comma-separated list of default protocols for the provider, which can be:
- `stream`: The provider allows streaming media directly from the provider (e.g. for Vimeo). - `download`: The provider allows downloading media for offline storage, sync, etc. (e.g. Podcasts). - `livetv`: The provider provides live content which is only available on a schedule basis. | | +| `Title` | **string* | :heavy_minus_sign: | The title of the provider. | | +| `Types` | **string* | :heavy_minus_sign: | This attribute contains a comma-separated list of the media types exposed by the provider (e.g. `video, audio`). | | \ No newline at end of file diff --git a/docs/models/operations/listprovidersresponse.md b/docs/models/operations/listprovidersresponse.md new file mode 100644 index 0000000..59aba69 --- /dev/null +++ b/docs/models/operations/listprovidersresponse.md @@ -0,0 +1,11 @@ +# ListProvidersResponse + + +## 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.ListProvidersResponseBody](../../models/operations/listprovidersresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listprovidersresponsebody.md b/docs/models/operations/listprovidersresponsebody.md new file mode 100644 index 0000000..9a6bb0a --- /dev/null +++ b/docs/models/operations/listprovidersresponsebody.md @@ -0,0 +1,10 @@ +# ListProvidersResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListProvidersMediaContainer](../../models/operations/listprovidersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listsessionsmediacontainer.md b/docs/models/operations/listsessionsmediacontainer.md new file mode 100644 index 0000000..77dd97d --- /dev/null +++ b/docs/models/operations/listsessionsmediacontainer.md @@ -0,0 +1,17 @@ +# ListSessionsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Metadata` | [][operations.Metadata](../../models/operations/metadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listsessionsresponse.md b/docs/models/operations/listsessionsresponse.md new file mode 100644 index 0000000..8180549 --- /dev/null +++ b/docs/models/operations/listsessionsresponse.md @@ -0,0 +1,12 @@ +# ListSessionsResponse + + +## 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.ListSessionsResponseBody](../../models/operations/listsessionsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listsessionsresponsebody.md b/docs/models/operations/listsessionsresponsebody.md new file mode 100644 index 0000000..d9ee35d --- /dev/null +++ b/docs/models/operations/listsessionsresponsebody.md @@ -0,0 +1,10 @@ +# ListSessionsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListSessionsMediaContainer](../../models/operations/listsessionsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listsimilarglobals.md b/docs/models/operations/listsimilarglobals.md new file mode 100644 index 0000000..91d0c22 --- /dev/null +++ b/docs/models/operations/listsimilarglobals.md @@ -0,0 +1,18 @@ +# ListSimilarGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listsimilarrequest.md b/docs/models/operations/listsimilarrequest.md new file mode 100644 index 0000000..dc7be24 --- /dev/null +++ b/docs/models/operations/listsimilarrequest.md @@ -0,0 +1,20 @@ +# ListSimilarRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Count` | **int64* | :heavy_minus_sign: | Limit results to count items | | \ No newline at end of file diff --git a/docs/models/operations/listsimilarresponse.md b/docs/models/operations/listsimilarresponse.md new file mode 100644 index 0000000..5ba777c --- /dev/null +++ b/docs/models/operations/listsimilarresponse.md @@ -0,0 +1,11 @@ +# ListSimilarResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listsonicallysimilarglobals.md b/docs/models/operations/listsonicallysimilarglobals.md new file mode 100644 index 0000000..ddbdc89 --- /dev/null +++ b/docs/models/operations/listsonicallysimilarglobals.md @@ -0,0 +1,18 @@ +# ListSonicallySimilarGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listsonicallysimilarrequest.md b/docs/models/operations/listsonicallysimilarrequest.md new file mode 100644 index 0000000..f4246d3 --- /dev/null +++ b/docs/models/operations/listsonicallysimilarrequest.md @@ -0,0 +1,23 @@ +# ListSonicallySimilarRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `ExcludeParentID` | **int64* | :heavy_minus_sign: | N/A | | +| `ExcludeGrandparentID` | **int64* | :heavy_minus_sign: | N/A | | +| `Limit` | **int64* | :heavy_minus_sign: | N/A | | +| `MaxDistance` | **float64* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/listsonicallysimilarresponse.md b/docs/models/operations/listsonicallysimilarresponse.md new file mode 100644 index 0000000..00ee9e2 --- /dev/null +++ b/docs/models/operations/listsonicallysimilarresponse.md @@ -0,0 +1,11 @@ +# ListSonicallySimilarResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listtopusersglobals.md b/docs/models/operations/listtopusersglobals.md new file mode 100644 index 0000000..50576db --- /dev/null +++ b/docs/models/operations/listtopusersglobals.md @@ -0,0 +1,18 @@ +# ListTopUsersGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/listtopusersmediacontainer.md b/docs/models/operations/listtopusersmediacontainer.md new file mode 100644 index 0000000..b071355 --- /dev/null +++ b/docs/models/operations/listtopusersmediacontainer.md @@ -0,0 +1,17 @@ +# ListTopUsersMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Account` | [][operations.Account](../../models/operations/account.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listtopusersrequest.md b/docs/models/operations/listtopusersrequest.md new file mode 100644 index 0000000..7555b25 --- /dev/null +++ b/docs/models/operations/listtopusersrequest.md @@ -0,0 +1,19 @@ +# ListTopUsersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/listtopusersresponse.md b/docs/models/operations/listtopusersresponse.md new file mode 100644 index 0000000..ac9d742 --- /dev/null +++ b/docs/models/operations/listtopusersresponse.md @@ -0,0 +1,11 @@ +# ListTopUsersResponse + + +## 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.ListTopUsersResponseBody](../../models/operations/listtopusersresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listtopusersresponsebody.md b/docs/models/operations/listtopusersresponsebody.md new file mode 100644 index 0000000..be8b402 --- /dev/null +++ b/docs/models/operations/listtopusersresponsebody.md @@ -0,0 +1,10 @@ +# ListTopUsersResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ListTopUsersMediaContainer](../../models/operations/listtopusersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/location.md b/docs/models/operations/location.md index d8aa98a..259c895 100644 --- a/docs/models/operations/location.md +++ b/docs/models/operations/location.md @@ -1,10 +1,12 @@ # Location -The folder path for the media item. +Network type of the client, can be used to help determine target bitrate. -## Fields +## Values -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `Path` | *string* | :heavy_check_mark: | N/A | /TV Shows/Clarkson's Farm | \ No newline at end of file +| Name | Value | +| ------------------ | ------------------ | +| `LocationLan` | lan | +| `LocationWan` | wan | +| `LocationCellular` | cellular | \ No newline at end of file diff --git a/docs/models/operations/loglinerequest.md b/docs/models/operations/loglinerequest.md deleted file mode 100644 index 567bf1e..0000000 --- a/docs/models/operations/loglinerequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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. | Test log message | -| `Source` | *string* | :heavy_check_mark: | a string indicating the source of the message. | Postman | \ No newline at end of file diff --git a/docs/models/operations/loglineresponse.md b/docs/models/operations/loglineresponse.md deleted file mode 100644 index d2b0d39..0000000 --- a/docs/models/operations/loglineresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index cfab4ae..0000000 --- a/docs/models/operations/logmultilineresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/mailingliststatus.md b/docs/models/operations/mailingliststatus.md deleted file mode 100644 index 762ca3e..0000000 --- a/docs/models/operations/mailingliststatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# MailingListStatus - -Your current mailing list status (active or unsubscribed) - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `MailingListStatusActive` | active | -| `MailingListStatusUnsubscribed` | unsubscribed | \ No newline at end of file diff --git a/docs/models/operations/makedecisionglobals.md b/docs/models/operations/makedecisionglobals.md new file mode 100644 index 0000000..6e3af14 --- /dev/null +++ b/docs/models/operations/makedecisionglobals.md @@ -0,0 +1,18 @@ +# MakeDecisionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/makedecisionrequest.md b/docs/models/operations/makedecisionrequest.md new file mode 100644 index 0000000..6f9f8b3 --- /dev/null +++ b/docs/models/operations/makedecisionrequest.md @@ -0,0 +1,49 @@ +# MakeDecisionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `TranscodeType` | [components.TranscodeType](../../models/components/transcodetype.md) | :heavy_check_mark: | Type of transcode media | | +| `TranscodeSessionID` | **string* | :heavy_minus_sign: | Transcode session UUID | | +| `AdvancedSubtitles` | [*components.AdvancedSubtitles](../../models/components/advancedsubtitles.md) | :heavy_minus_sign: | Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost
| burn | +| `AudioBoost` | **int64* | :heavy_minus_sign: | Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) | 50 | +| `AudioChannelCount` | **int64* | :heavy_minus_sign: | Target video number of audio channels. | 5 | +| `AutoAdjustQuality` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports ABR. | 1 | +| `AutoAdjustSubtitle` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if the server should adjust subtitles based on Voice Activity Data. | 1 | +| `DirectPlay` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct playing the indicated content. | 1 | +| `DirectStream` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the video of the indicated content. | 1 | +| `DirectStreamAudio` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the audio of the indicated content. | 1 | +| `DisableResolutionRotation` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if resolution should be adjusted for orientation. | 1 | +| `HasMDE` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 | 1 | +| `Location` | [*operations.Location](../../models/operations/location.md) | :heavy_minus_sign: | Network type of the client, can be used to help determine target bitrate. | wan | +| `MediaBufferSize` | **int64* | :heavy_minus_sign: | Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. | 102400 | +| `MediaIndex` | **int64* | :heavy_minus_sign: | Index of the media to transcode. -1 or not specified indicates let the server choose. | 0 | +| `MusicBitrate` | **int64* | :heavy_minus_sign: | Target bitrate for audio only files (in kbps, used to transcode). | 5000 | +| `Offset` | **float64* | :heavy_minus_sign: | Offset from the start of the media (in seconds). | 90.5 | +| `PartIndex` | **int64* | :heavy_minus_sign: | Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode | 0 | +| `Path` | **string* | :heavy_minus_sign: | Internal PMS path of the media to transcode. | /library/metadata/151671 | +| `PeakBitrate` | **int64* | :heavy_minus_sign: | Maximum bitrate (in kbps) to use in ABR. | 12000 | +| `PhotoResolution` | **string* | :heavy_minus_sign: | Target photo resolution. | 1080x1080 | +| `Protocol` | [*operations.Protocol](../../models/operations/protocol.md) | :heavy_minus_sign: | Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022)
| dash | +| `SecondsPerSegment` | **int64* | :heavy_minus_sign: | Number of seconds to include in each transcoded segment | 5 | +| `SubtitleSize` | **int64* | :heavy_minus_sign: | Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) | 50 | +| `Subtitles` | [*operations.Subtitles](../../models/operations/subtitles.md) | :heavy_minus_sign: | Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream
| Burn | +| `VideoBitrate` | **int64* | :heavy_minus_sign: | Target video bitrate (in kbps). | 12000 | +| `VideoQuality` | **int64* | :heavy_minus_sign: | Target photo quality. | 50 | +| `VideoResolution` | **string* | :heavy_minus_sign: | Target maximum video resolution. | 1080x1080 | +| `XPlexClientProfileExtra` | **string* | :heavy_minus_sign: | See [Profile Augmentations](#section/API-Info/Profile-Augmentations) . | add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash) | +| `XPlexClientProfileName` | **string* | :heavy_minus_sign: | Which built in Client Profile to use in the decision. Generally should only be used to specify the Generic profile. | generic | +| `XPlexSessionIdentifier` | **string* | :heavy_minus_sign: | Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) | | \ No newline at end of file diff --git a/docs/models/operations/makedecisionresponse.md b/docs/models/operations/makedecisionresponse.md new file mode 100644 index 0000000..ac0be25 --- /dev/null +++ b/docs/models/operations/makedecisionresponse.md @@ -0,0 +1,11 @@ +# MakeDecisionResponse + + +## 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 | +| `MediaContainerWithDecision` | [*components.MediaContainerWithDecision](../../models/components/mediacontainerwithdecision.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/marker.md b/docs/models/operations/marker.md deleted file mode 100644 index 5d6404c..0000000 --- a/docs/models/operations/marker.md +++ /dev/null @@ -1,15 +0,0 @@ -# Marker - -The final status of the marker - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | N/A | 306970 | -| `Type` | *string* | :heavy_check_mark: | N/A | credits | -| `StartTimeOffset` | *int64* | :heavy_check_mark: | N/A | 4176050 | -| `EndTimeOffset` | *int64* | :heavy_check_mark: | N/A | 4393389 | -| `Final` | **bool* | :heavy_minus_sign: | N/A | true | -| `Attributes` | [*operations.Attributes](../../models/operations/attributes.md) | :heavy_minus_sign: | Attributes associated with the marker. | | \ No newline at end of file diff --git a/docs/models/operations/markplayedglobals.md b/docs/models/operations/markplayedglobals.md new file mode 100644 index 0000000..9a82b1b --- /dev/null +++ b/docs/models/operations/markplayedglobals.md @@ -0,0 +1,18 @@ +# MarkPlayedGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/markplayedrequest.md b/docs/models/operations/markplayedrequest.md index f4b1048..22cdc12 100644 --- a/docs/models/operations/markplayedrequest.md +++ b/docs/models/operations/markplayedrequest.md @@ -3,6 +3,19 @@ ## 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 +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Identifier` | *string* | :heavy_check_mark: | The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library` | | +| `Key` | **string* | :heavy_minus_sign: | The key of the item to rate. This is the `ratingKey` found in metadata items | | +| `URI` | **string* | :heavy_minus_sign: | The URI of the item to mark as played. See intro for description of the URIs | | \ No newline at end of file diff --git a/docs/models/operations/markunplayedrequest.md b/docs/models/operations/markunplayedrequest.md deleted file mode 100644 index fe10f9a..0000000 --- a/docs/models/operations/markunplayedrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index b9ef2f4..0000000 --- a/docs/models/operations/markunplayedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/matchitemglobals.md b/docs/models/operations/matchitemglobals.md new file mode 100644 index 0000000..2912505 --- /dev/null +++ b/docs/models/operations/matchitemglobals.md @@ -0,0 +1,18 @@ +# MatchItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/matchitemrequest.md b/docs/models/operations/matchitemrequest.md new file mode 100644 index 0000000..aced6e0 --- /dev/null +++ b/docs/models/operations/matchitemrequest.md @@ -0,0 +1,22 @@ +# MatchItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `GUID` | **string* | :heavy_minus_sign: | N/A | | +| `Name` | **string* | :heavy_minus_sign: | N/A | | +| `Year` | **int64* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/matchitemresponse.md b/docs/models/operations/matchitemresponse.md new file mode 100644 index 0000000..296cea8 --- /dev/null +++ b/docs/models/operations/matchitemresponse.md @@ -0,0 +1,10 @@ +# MatchItemResponse + + +## 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 deleted file mode 100644 index 7ba1a29..0000000 --- a/docs/models/operations/media.md +++ /dev/null @@ -1,26 +0,0 @@ -# Media - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 | -| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 | -| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 | -| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 | -| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 | -| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 | -| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | eac3 | -| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc | -| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k | -| `Container` | **string* | :heavy_minus_sign: | File container type. | mkv | -| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p
| 24p | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 | -| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | Indicates whether voice activity is detected. | false | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `OptimizedForStreaming` | [*operations.OptimizedForStreaming](../../models/operations/optimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `Part` | [][operations.Part](../../models/operations/part.md) | :heavy_minus_sign: | An array of parts for this media item. | | \ No newline at end of file diff --git a/docs/models/operations/mediacontainer.md b/docs/models/operations/mediacontainer.md index feaf0f8..76a85a9 100644 --- a/docs/models/operations/mediacontainer.md +++ b/docs/models/operations/mediacontainer.md @@ -1,58 +1,67 @@ # MediaContainer +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + ## 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 +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| | +| `Size` | **int64* | :heavy_minus_sign: | N/A | | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| | +| `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` | **int64* | :heavy_minus_sign: | N/A | 7 | +| `MachineIdentifier` | *any* | :heavy_minus_sign: | N/A | 0123456789abcdef0123456789abcdef012345678 | +| `MediaProviders` | **bool* | :heavy_minus_sign: | N/A | | +| `Multiuser` | **bool* | :heavy_minus_sign: | N/A | | +| `MusicAnalysis` | **int64* | :heavy_minus_sign: | N/A | 2 | +| `MyPlex` | **bool* | :heavy_minus_sign: | N/A | | +| `MyPlexMappingState` | *any* | :heavy_minus_sign: | N/A | mapped | +| `MyPlexSigninState` | *any* | :heavy_minus_sign: | N/A | ok | +| `MyPlexSubscription` | **bool* | :heavy_minus_sign: | N/A | | +| `MyPlexUsername` | **string* | :heavy_minus_sign: | N/A | | +| `OfflineTranscode` | *any* | :heavy_minus_sign: | N/A | 1 | +| `OwnerFeatures` | **string* | :heavy_minus_sign: | A comma-separated list of features which are enabled for the server owner | | +| `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` | **int64* | :heavy_minus_sign: | N/A | | +| `StreamingBrainVersion` | **int64* | :heavy_minus_sign: | N/A | | +| `Sync` | **bool* | :heavy_minus_sign: | N/A | | +| `TranscoderActiveVideoSessions` | **int64* | :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` | *any* | :heavy_minus_sign: | The suggested video quality bitrates to present to the user | | +| `TranscoderVideoQualities` | **string* | :heavy_minus_sign: | N/A | | +| `TranscoderVideoResolutions` | *any* | :heavy_minus_sign: | The suggested video resolutions to the above quality bitrates | | +| `UpdatedAt` | **int64* | :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 | | +| `Bandwidths` | [*operations.Bandwidths](../../models/operations/bandwidths.md) | :heavy_minus_sign: | A list of media times and bandwidths when trascoding is using with auto adjustment of bandwidth | | +| `TerminationCode` | **int64* | :heavy_minus_sign: | A code describing why the session was terminated by the server. | | +| `TerminationText` | **string* | :heavy_minus_sign: | A user friendly and localized text describing why the session was terminated by the server. | | \ No newline at end of file diff --git a/docs/models/operations/mediagrabber.md b/docs/models/operations/mediagrabber.md new file mode 100644 index 0000000..596db6c --- /dev/null +++ b/docs/models/operations/mediagrabber.md @@ -0,0 +1,10 @@ +# MediaGrabber + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Protocol` | **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/mediaprovider.md b/docs/models/operations/mediaprovider.md deleted file mode 100644 index 7cbe99e..0000000 --- a/docs/models/operations/mediaprovider.md +++ /dev/null @@ -1,12 +0,0 @@ -# MediaProvider - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | -| `Title` | **string* | :heavy_minus_sign: | N/A | -| `Types` | **string* | :heavy_minus_sign: | N/A | -| `Protocols` | **string* | :heavy_minus_sign: | N/A | -| `Feature` | [][operations.Feature](../../models/operations/feature.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/mediareviewsvisibility.md b/docs/models/operations/mediareviewsvisibility.md deleted file mode 100644 index 5a82305..0000000 --- a/docs/models/operations/mediareviewsvisibility.md +++ /dev/null @@ -1,11 +0,0 @@ -# MediaReviewsVisibility - -Whether or not the account has media reviews visibility enabled - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `MediaReviewsVisibilityDisable` | 0 | -| `MediaReviewsVisibilityEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/mediasettings.md b/docs/models/operations/mediasettings.md new file mode 100644 index 0000000..4c2ad27 --- /dev/null +++ b/docs/models/operations/mediasettings.md @@ -0,0 +1,27 @@ +# MediaSettings + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `AdvancedSubtitles` | [*operations.AdvancedSubtitles](../../models/operations/advancedsubtitles.md) | :heavy_minus_sign: | N/A | +| `AudioBoost` | **int64* | :heavy_minus_sign: | N/A | +| `AudioChannelCount` | **int64* | :heavy_minus_sign: | N/A | +| `AutoAdjustQuality` | **bool* | :heavy_minus_sign: | N/A | +| `AutoAdjustSubtitle` | **bool* | :heavy_minus_sign: | N/A | +| `DirectPlay` | **bool* | :heavy_minus_sign: | N/A | +| `DirectStream` | **bool* | :heavy_minus_sign: | N/A | +| `DirectStreamAudio` | **bool* | :heavy_minus_sign: | N/A | +| `DisableResolutionRotation` | **bool* | :heavy_minus_sign: | N/A | +| `MaxVideoBitrate` | **int64* | :heavy_minus_sign: | N/A | +| `MusicBitrate` | **int64* | :heavy_minus_sign: | N/A | +| `PeakBitrate` | **int64* | :heavy_minus_sign: | N/A | +| `PhotoQuality` | **int64* | :heavy_minus_sign: | N/A | +| `PhotoResolution` | **string* | :heavy_minus_sign: | N/A | +| `SecondsPerSegment` | **int64* | :heavy_minus_sign: | N/A | +| `Subtitles` | [*operations.GetPlaylistGeneratorSubtitles](../../models/operations/getplaylistgeneratorsubtitles.md) | :heavy_minus_sign: | N/A | +| `SubtitleSize` | **int64* | :heavy_minus_sign: | N/A | +| `VideoBitrate` | **int64* | :heavy_minus_sign: | N/A | +| `VideoQuality` | **int64* | :heavy_minus_sign: | N/A | +| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/mediasubscription.md b/docs/models/operations/mediasubscription.md new file mode 100644 index 0000000..3bd0b33 --- /dev/null +++ b/docs/models/operations/mediasubscription.md @@ -0,0 +1,28 @@ +# MediaSubscription + +A media subscription contains a representation of metadata desired to be recorded + + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Title` | **string* | :heavy_minus_sign: | The title of this subscription type | This Episode | +| `Type` | **int64* | :heavy_minus_sign: | Metadata type number | | +| `AiringsType` | **string* | :heavy_minus_sign: | N/A | | +| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | | +| `Directory` | map[string]*any* | :heavy_minus_sign: | Media Matching Hints | | +| `DurationTotal` | **int64* | :heavy_minus_sign: | Only included if `includeStorage` is specified | | +| `Key` | **string* | :heavy_minus_sign: | N/A | | +| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | | +| `LocationPath` | **string* | :heavy_minus_sign: | N/A | | +| `MediaGrabOperation` | [][components.MediaGrabOperation](../../models/components/mediagraboperation.md) | :heavy_minus_sign: | N/A | | +| `Playlist` | map[string]*any* | :heavy_minus_sign: | Media Matching Hints | | +| `Setting` | [][components.Setting](../../models/components/setting.md) | :heavy_minus_sign: | N/A | | +| `StorageTotal` | **int64* | :heavy_minus_sign: | Only included if `includeStorage` is specified | | +| `TargetLibrarySectionID` | **int64* | :heavy_minus_sign: | Where this subscription will record to | | +| `TargetSectionLocationID` | **int64* | :heavy_minus_sign: | The library section location id for where the item is to be recorded | | +| `Video` | map[string]*any* | :heavy_minus_sign: | Media Matching Hints | | +| `Parameters` | **string* | :heavy_minus_sign: | Parameter string for creating this subscription | | +| `Selected` | **bool* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/mergeitemsglobals.md b/docs/models/operations/mergeitemsglobals.md new file mode 100644 index 0000000..3bce377 --- /dev/null +++ b/docs/models/operations/mergeitemsglobals.md @@ -0,0 +1,18 @@ +# MergeItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/mergeitemsrequest.md b/docs/models/operations/mergeitemsrequest.md new file mode 100644 index 0000000..15898d6 --- /dev/null +++ b/docs/models/operations/mergeitemsrequest.md @@ -0,0 +1,20 @@ +# MergeItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `IdsPathParameter` | *string* | :heavy_check_mark: | N/A | | +| `IdsQueryParameter` | []*string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/mergeitemsresponse.md b/docs/models/operations/mergeitemsresponse.md new file mode 100644 index 0000000..d33dd96 --- /dev/null +++ b/docs/models/operations/mergeitemsresponse.md @@ -0,0 +1,10 @@ +# MergeItemsResponse + + +## 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/meta.md b/docs/models/operations/meta.md deleted file mode 100644 index a0f211b..0000000 --- a/docs/models/operations/meta.md +++ /dev/null @@ -1,12 +0,0 @@ -# Meta - -The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Type` | [][operations.GetRecentlyAddedType](../../models/operations/getrecentlyaddedtype.md) | :heavy_minus_sign: | N/A | -| `FieldType` | [][operations.GetRecentlyAddedFieldType](../../models/operations/getrecentlyaddedfieldtype.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 index 705d9b5..9bb8e5c 100644 --- a/docs/models/operations/metadata.md +++ b/docs/models/operations/metadata.md @@ -1,42 +1,85 @@ # Metadata +Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + +Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + +Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + + ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `Art` | **string* | :heavy_minus_sign: | N/A | -| `GUID` | **string* | :heavy_minus_sign: | N/A | -| `Key` | **string* | :heavy_minus_sign: | N/A | -| `RatingKey` | **string* | :heavy_minus_sign: | N/A | -| `Studio` | **string* | :heavy_minus_sign: | N/A | -| `Tagline` | **string* | :heavy_minus_sign: | N/A | -| `Type` | **string* | :heavy_minus_sign: | N/A | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | -| `AddedAt` | **int* | :heavy_minus_sign: | N/A | -| `Duration` | **int* | :heavy_minus_sign: | N/A | -| `PublicPagesURL` | **string* | :heavy_minus_sign: | N/A | -| `Slug` | **string* | :heavy_minus_sign: | N/A | -| `UserState` | **bool* | :heavy_minus_sign: | N/A | -| `Title` | **string* | :heavy_minus_sign: | N/A | -| `ContentRating` | **string* | :heavy_minus_sign: | N/A | -| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | -| `Year` | **int* | :heavy_minus_sign: | N/A | -| `Image` | [][operations.Image](../../models/operations/image.md) | :heavy_minus_sign: | N/A | -| `Banner` | **string* | :heavy_minus_sign: | N/A | -| `Rating` | **float64* | :heavy_minus_sign: | N/A | -| `ExpiresAt` | **int* | :heavy_minus_sign: | N/A | -| `OriginalTitle` | **string* | :heavy_minus_sign: | N/A | -| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | -| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | -| `RatingImage` | **string* | :heavy_minus_sign: | N/A | -| `ImdbRatingCount` | **int* | :heavy_minus_sign: | N/A | -| `Subtype` | **string* | :heavy_minus_sign: | N/A | -| `Theme` | **string* | :heavy_minus_sign: | N/A | -| `LeafCount` | **int* | :heavy_minus_sign: | N/A | -| `ChildCount` | **int* | :heavy_minus_sign: | N/A | -| `IsContinuingSeries` | **bool* | :heavy_minus_sign: | N/A | -| `SkipChildren` | **bool* | :heavy_minus_sign: | N/A | -| `AvailabilityID` | **string* | :heavy_minus_sign: | N/A | -| `StreamingMediaID` | **string* | :heavy_minus_sign: | N/A | -| `PlayableKey` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Player` | [*components.Player](../../models/components/player.md) | :heavy_minus_sign: | Information about the player being used for playback | +| `Session` | [*components.Session](../../models/components/session.md) | :heavy_minus_sign: | Information about the playback session | +| `User` | [*components.User](../../models/components/user.md) | :heavy_minus_sign: | The user playing the content | +| `Title` | *any* | :heavy_minus_sign: | The title of the item (e.g. “300” or “The Simpsons”) | +| `Type` | *any* | :heavy_minus_sign: | The type of the video item, such as `movie`, `episode`, or `clip`. | +| `AbsoluteIndex` | **int64* | :heavy_minus_sign: | When present, contains the disc number for a track on multi-disc albums. | +| `AddedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was added to the library. | +| `Art` | *any* | :heavy_minus_sign: | When present, the URL for the background artwork for the item. | +| `AudienceRating` | **float64* | :heavy_minus_sign: | Some rating systems separate reviewer ratings from audience ratings | +| `AudienceRatingImage` | *any* | :heavy_minus_sign: | A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). | +| `Autotag` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Banner` | *any* | :heavy_minus_sign: | When present, the URL for a banner graphic for the item. | +| `ChapterSource` | *any* | :heavy_minus_sign: | When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). | +| `Composite` | *any* | :heavy_minus_sign: | When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). | +| `ContentRating` | *any* | :heavy_minus_sign: | If known, the content rating (e.g. MPAA) for an item. | +| `Country` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Director` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Duration` | **int64* | :heavy_minus_sign: | When present, the duration for the item, in units of milliseconds. | +| `Filter` | [][components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Genre` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `GrandparentArt` | **string* | :heavy_minus_sign: | The `art` of the grandparent | +| `GrandparentHero` | **string* | :heavy_minus_sign: | The `hero` of the grandparent | +| `GrandparentKey` | **string* | :heavy_minus_sign: | The `key` of the grandparent | +| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the grandparent | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | The `theme` of the grandparent | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the grandparent | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | The `title` of the grandparent | +| `GUID` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Hero` | *any* | :heavy_minus_sign: | When present, the URL for a hero image for the item. | +| `Image` | [][components.Image](../../models/components/image.md) | :heavy_minus_sign: | N/A | +| `Index` | **int64* | :heavy_minus_sign: | When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. | +| `Key` | *any* | :heavy_minus_sign: | The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. | +| `LastViewedAt` | **int64* | :heavy_minus_sign: | When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. | +| `LeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of total episodes. | +| `Media` | [][components.Media](../../models/components/media.md) | :heavy_minus_sign: | N/A | +| `OriginallyAvailableAt` | *any* | :heavy_minus_sign: | When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. | +| `OriginalTitle` | *any* | :heavy_minus_sign: | When present, used to indicate an item's original title, e.g. a movie's foreign title. | +| `ParentHero` | **string* | :heavy_minus_sign: | The `hero` of the parent | +| `ParentIndex` | **int64* | :heavy_minus_sign: | The `index` of the parent | +| `ParentKey` | **string* | :heavy_minus_sign: | The `key` of the parent | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | The `ratingKey` of the parent | +| `ParentThumb` | **string* | :heavy_minus_sign: | The `thumb` of the parent | +| `ParentTitle` | **string* | :heavy_minus_sign: | The `title` of the parent | +| `PrimaryExtraKey` | *any* | :heavy_minus_sign: | Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. | +| `Prompt` | **string* | :heavy_minus_sign: | Prompt to give the user for this directory (such as `Search Movies`) | +| `Rating` | **float64* | :heavy_minus_sign: | When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. | +| `RatingArray` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `RatingCount` | **int64* | :heavy_minus_sign: | Number of ratings under this metadata | +| `RatingImage` | *any* | :heavy_minus_sign: | When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. | +| `RatingKey` | *any* | :heavy_minus_sign: | This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. | +| `Role` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Search` | **bool* | :heavy_minus_sign: | Indicates this is a search directory | +| `Secondary` | **bool* | :heavy_minus_sign: | Used by old clients to provide nested menus allowing for primative (but structured) navigation. | +| `SkipChildren` | **bool* | :heavy_minus_sign: | When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. | +| `SkipParent` | **bool* | :heavy_minus_sign: | When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). | +| `Sort` | [][components.Sort](../../models/components/sort.md) | :heavy_minus_sign: | Typically only seen in metadata at a library's top level | +| `Studio` | *any* | :heavy_minus_sign: | When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). | +| `Subtype` | *any* | :heavy_minus_sign: | The subtype of the video item, such as `photo` when the video item is in a photo library | +| `Summary` | *any* | :heavy_minus_sign: | When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). | +| `Tagline` | *any* | :heavy_minus_sign: | When present, a pithy one-liner about the item (usually only seen for movies). | +| `Theme` | *any* | :heavy_minus_sign: | When present, the URL for theme music for the item (usually only for TV shows). | +| `Thumb` | *any* | :heavy_minus_sign: | When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. | +| `TitleSort` | *any* | :heavy_minus_sign: | Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). | +| `UpdatedAt` | **int64* | :heavy_minus_sign: | In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). | +| `UserRating` | **float64* | :heavy_minus_sign: | When the user has rated an item, this contains the user rating | +| `ViewCount` | **int64* | :heavy_minus_sign: | When a users has completed watched or listened to an item, this attribute contains the number of consumptions. | +| `ViewedLeafCount` | **int64* | :heavy_minus_sign: | For shows and seasons, contains the number of viewed episodes. | +| `ViewOffset` | **int64* | :heavy_minus_sign: | When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. | +| `Writer` | [][components.Tag](../../models/components/tag.md) | :heavy_minus_sign: | N/A | +| `Year` | **int64* | :heavy_minus_sign: | When present, the year associated with the item's release (e.g. release year for a movie). | +| `AdditionalProperties` | map[string]*any* | :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 deleted file mode 100644 index c34949d..0000000 --- a/docs/models/operations/minsize.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/modifydeviceglobals.md b/docs/models/operations/modifydeviceglobals.md new file mode 100644 index 0000000..fffd8cb --- /dev/null +++ b/docs/models/operations/modifydeviceglobals.md @@ -0,0 +1,18 @@ +# ModifyDeviceGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/modifydevicemediacontainer.md b/docs/models/operations/modifydevicemediacontainer.md new file mode 100644 index 0000000..be8e359 --- /dev/null +++ b/docs/models/operations/modifydevicemediacontainer.md @@ -0,0 +1,18 @@ +# ModifyDeviceMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Message` | **string* | :heavy_minus_sign: | N/A | +| `Status` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/modifydevicerequest.md b/docs/models/operations/modifydevicerequest.md new file mode 100644 index 0000000..f4b4bc3 --- /dev/null +++ b/docs/models/operations/modifydevicerequest.md @@ -0,0 +1,20 @@ +# ModifyDeviceRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | +| `Enabled` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether to enable the device | 1 | \ No newline at end of file diff --git a/docs/models/operations/modifydeviceresponse.md b/docs/models/operations/modifydeviceresponse.md new file mode 100644 index 0000000..f3f53be --- /dev/null +++ b/docs/models/operations/modifydeviceresponse.md @@ -0,0 +1,12 @@ +# ModifyDeviceResponse + + +## 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.ModifyDeviceResponseBody](../../models/operations/modifydeviceresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/modifydeviceresponsebody.md b/docs/models/operations/modifydeviceresponsebody.md new file mode 100644 index 0000000..e7f8064 --- /dev/null +++ b/docs/models/operations/modifydeviceresponsebody.md @@ -0,0 +1,10 @@ +# ModifyDeviceResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.ModifyDeviceMediaContainer](../../models/operations/modifydevicemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/modifyplaylistgeneratorglobals.md b/docs/models/operations/modifyplaylistgeneratorglobals.md new file mode 100644 index 0000000..29c985b --- /dev/null +++ b/docs/models/operations/modifyplaylistgeneratorglobals.md @@ -0,0 +1,18 @@ +# ModifyPlaylistGeneratorGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/modifyplaylistgeneratorqueryparamlocation.md b/docs/models/operations/modifyplaylistgeneratorqueryparamlocation.md new file mode 100644 index 0000000..867c4c7 --- /dev/null +++ b/docs/models/operations/modifyplaylistgeneratorqueryparamlocation.md @@ -0,0 +1,8 @@ +# ModifyPlaylistGeneratorQueryParamLocation + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `URI` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/modifyplaylistgeneratorrequest.md b/docs/models/operations/modifyplaylistgeneratorrequest.md new file mode 100644 index 0000000..9a685b9 --- /dev/null +++ b/docs/models/operations/modifyplaylistgeneratorrequest.md @@ -0,0 +1,21 @@ +# ModifyPlaylistGeneratorRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `GeneratorID` | *int64* | :heavy_check_mark: | The generator item ID to modify. | | +| `Item` | [*operations.Item](../../models/operations/item.md) | :heavy_minus_sign: | Note: OpenAPI cannot properly render this query parameter example ([See GHI](https://github.com/OAI/OpenAPI-Specification/issues/1706)). It should be rendered as:

Item[type]=42&Item[title]=Jack-Jack Attack&Item[target]=&Item[targetTagID]=1&Item[locationID]=-1&Item[Location][uri]=library://82503060-0d68-4603-b594-8b071d54819e/item//library/metadata/146&Item[Policy][scope]=all&Item[Policy][value]=&Item[Policy][unwatched]=0
| {
"Location": {
"uri": "library://82503060-0d68-4603-b594-8b071d54819e/item/%2Flibrary%2Fmetadata%2F146"
},
"locationID": -1,
"Policy": {
"value": "",
"scope": "all",
"unwatched": 0
},
"target": "",
"targetTagID": 1,
"title": "Jack-Jack Attack",
"type": 42
} | \ No newline at end of file diff --git a/docs/models/operations/modifyplaylistgeneratorresponse.md b/docs/models/operations/modifyplaylistgeneratorresponse.md new file mode 100644 index 0000000..3e158d9 --- /dev/null +++ b/docs/models/operations/modifyplaylistgeneratorresponse.md @@ -0,0 +1,11 @@ +# ModifyPlaylistGeneratorResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/movecollectionitemglobals.md b/docs/models/operations/movecollectionitemglobals.md new file mode 100644 index 0000000..a534669 --- /dev/null +++ b/docs/models/operations/movecollectionitemglobals.md @@ -0,0 +1,18 @@ +# MoveCollectionItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/movecollectionitemrequest.md b/docs/models/operations/movecollectionitemrequest.md new file mode 100644 index 0000000..63de4ba --- /dev/null +++ b/docs/models/operations/movecollectionitemrequest.md @@ -0,0 +1,21 @@ +# MoveCollectionItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `CollectionID` | *int64* | :heavy_check_mark: | The collection id | | +| `ItemID` | *int64* | :heavy_check_mark: | The item to move | | +| `After` | **int64* | :heavy_minus_sign: | The item to move this item after. If not provided, this item will be moved to the beginning | | \ No newline at end of file diff --git a/docs/models/operations/movecollectionitemresponse.md b/docs/models/operations/movecollectionitemresponse.md new file mode 100644 index 0000000..0463dc4 --- /dev/null +++ b/docs/models/operations/movecollectionitemresponse.md @@ -0,0 +1,11 @@ +# MoveCollectionItemResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/movehubglobals.md b/docs/models/operations/movehubglobals.md new file mode 100644 index 0000000..55981c0 --- /dev/null +++ b/docs/models/operations/movehubglobals.md @@ -0,0 +1,18 @@ +# MoveHubGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/movehubrequest.md b/docs/models/operations/movehubrequest.md new file mode 100644 index 0000000..95c0efc --- /dev/null +++ b/docs/models/operations/movehubrequest.md @@ -0,0 +1,21 @@ +# MoveHubRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to reorder | | +| `Identifier` | *string* | :heavy_check_mark: | The identifier of the hub to move | | +| `After` | **string* | :heavy_minus_sign: | The identifier of the hub to order this hub after (or empty/missing to put this hub first) | | \ No newline at end of file diff --git a/docs/models/operations/movehubresponse.md b/docs/models/operations/movehubresponse.md new file mode 100644 index 0000000..696faf2 --- /dev/null +++ b/docs/models/operations/movehubresponse.md @@ -0,0 +1,12 @@ +# MoveHubResponse + + +## 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 | +| `GetResponses200` | [*components.GetResponses200](../../models/components/getresponses200.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/moveplaylistitemglobals.md b/docs/models/operations/moveplaylistitemglobals.md new file mode 100644 index 0000000..3e7b82c --- /dev/null +++ b/docs/models/operations/moveplaylistitemglobals.md @@ -0,0 +1,18 @@ +# MovePlaylistItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/moveplaylistitemrequest.md b/docs/models/operations/moveplaylistitemrequest.md new file mode 100644 index 0000000..393ef02 --- /dev/null +++ b/docs/models/operations/moveplaylistitemrequest.md @@ -0,0 +1,21 @@ +# MovePlaylistItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `PlaylistItemID` | *int64* | :heavy_check_mark: | The playlist item ID to move. | | +| `After` | **int64* | :heavy_minus_sign: | The playlist item ID to insert the new item after. If not provided, item is moved to beginning of playlist | | \ No newline at end of file diff --git a/docs/models/operations/moveplaylistitemresponse.md b/docs/models/operations/moveplaylistitemresponse.md new file mode 100644 index 0000000..16d3a01 --- /dev/null +++ b/docs/models/operations/moveplaylistitemresponse.md @@ -0,0 +1,11 @@ +# MovePlaylistItemResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/moveplayqueueitemglobals.md b/docs/models/operations/moveplayqueueitemglobals.md new file mode 100644 index 0000000..f5eaf31 --- /dev/null +++ b/docs/models/operations/moveplayqueueitemglobals.md @@ -0,0 +1,18 @@ +# MovePlayQueueItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/moveplayqueueitemrequest.md b/docs/models/operations/moveplayqueueitemrequest.md new file mode 100644 index 0000000..d2bb1b7 --- /dev/null +++ b/docs/models/operations/moveplayqueueitemrequest.md @@ -0,0 +1,21 @@ +# MovePlayQueueItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | +| `PlayQueueItemID` | *int64* | :heavy_check_mark: | The play queue item ID to delete. | | +| `After` | **int64* | :heavy_minus_sign: | The play queue item ID to insert the new item after. If not present, moves to the beginning. | | \ No newline at end of file diff --git a/docs/models/operations/moveplayqueueitemresponse.md b/docs/models/operations/moveplayqueueitemresponse.md new file mode 100644 index 0000000..3372b1a --- /dev/null +++ b/docs/models/operations/moveplayqueueitemresponse.md @@ -0,0 +1,11 @@ +# MovePlayQueueItemResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/myplex.md b/docs/models/operations/myplex.md deleted file mode 100644 index 9fb5227..0000000 --- a/docs/models/operations/myplex.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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/one.md b/docs/models/operations/one.md deleted file mode 100644 index 57e2060..0000000 --- a/docs/models/operations/one.md +++ /dev/null @@ -1,9 +0,0 @@ -# One - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneZero` | 0 | -| `OneOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/onlytransient.md b/docs/models/operations/onlytransient.md deleted file mode 100644 index 821597b..0000000 --- a/docs/models/operations/onlytransient.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/operator.md b/docs/models/operations/operator.md deleted file mode 100644 index 59acf7e..0000000 --- a/docs/models/operations/operator.md +++ /dev/null @@ -1,9 +0,0 @@ -# Operator - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Key` | *string* | :heavy_check_mark: | N/A | = | -| `Title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/optimizedatabaseglobals.md b/docs/models/operations/optimizedatabaseglobals.md new file mode 100644 index 0000000..272450d --- /dev/null +++ b/docs/models/operations/optimizedatabaseglobals.md @@ -0,0 +1,18 @@ +# OptimizeDatabaseGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/optimizedatabaserequest.md b/docs/models/operations/optimizedatabaserequest.md new file mode 100644 index 0000000..8c0f65f --- /dev/null +++ b/docs/models/operations/optimizedatabaserequest.md @@ -0,0 +1,19 @@ +# OptimizeDatabaseRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Async` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | If set, don't wait for completion but return an activity | 1 | \ No newline at end of file diff --git a/docs/models/operations/optimizedatabaseresponse.md b/docs/models/operations/optimizedatabaseresponse.md new file mode 100644 index 0000000..2baadb6 --- /dev/null +++ b/docs/models/operations/optimizedatabaseresponse.md @@ -0,0 +1,10 @@ +# OptimizeDatabaseResponse + + +## 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/optimizedforstreaming.md b/docs/models/operations/optimizedforstreaming.md deleted file mode 100644 index b60d7df..0000000 --- a/docs/models/operations/optimizedforstreaming.md +++ /dev/null @@ -1,19 +0,0 @@ -# OptimizedForStreaming - -Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - - -## Supported Types - -### One - -```go -optimizedForStreaming := operations.CreateOptimizedForStreamingOne(operations.One{/* values here */}) -``` - -### - -```go -optimizedForStreaming := operations.CreateOptimizedForStreamingBoolean(bool{/* values here */}) -``` - diff --git a/docs/models/operations/optimizedforstreaming1.md b/docs/models/operations/optimizedforstreaming1.md deleted file mode 100644 index 75fa218..0000000 --- a/docs/models/operations/optimizedforstreaming1.md +++ /dev/null @@ -1,9 +0,0 @@ -# OptimizedForStreaming1 - - -## Values - -| Name | Value | -| ---------------------------- | ---------------------------- | -| `OptimizedForStreaming1Zero` | 0 | -| `OptimizedForStreaming1One` | 1 | \ No newline at end of file diff --git a/docs/models/operations/owned.md b/docs/models/operations/owned.md deleted file mode 100644 index e989d43..0000000 --- a/docs/models/operations/owned.md +++ /dev/null @@ -1,11 +0,0 @@ -# Owned - -Indicates if the user owns the server. - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `OwnedDisable` | 0 | -| `OwnedEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/params.md b/docs/models/operations/params.md new file mode 100644 index 0000000..b26379e --- /dev/null +++ b/docs/models/operations/params.md @@ -0,0 +1,12 @@ +# Params + +Subscription parameters. + - `mediaProviderID`: Required for downloads to indicate which MP the subscription will download into + - `source`: Required for downloads to indicate the source of the downloaded content. + + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/part.md b/docs/models/operations/part.md deleted file mode 100644 index 9caed81..0000000 --- a/docs/models/operations/part.md +++ /dev/null @@ -1,23 +0,0 @@ -# Part - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true | -| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true | -| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 | -| `Key` | *string* | :heavy_check_mark: | Key to access this part. | /library/parts/418385/1735864239/file.mkv | -| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd | -| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 | -| `File` | *string* | :heavy_check_mark: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv | -| `Size` | *int64* | :heavy_check_mark: | File size in bytes. | 30649952104 | -| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 | -| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv | -| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 | -| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts | -| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false | -| `OptimizedForStreaming` | [*operations.GetRecentlyAddedOptimizedForStreaming](../../models/operations/getrecentlyaddedoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | | -| `HasThumbnail` | [*operations.HasThumbnail](../../models/operations/hasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | -| `Stream` | [][operations.Stream](../../models/operations/stream.md) | :heavy_minus_sign: | An array of streams for this part. | | \ No newline at end of file diff --git a/docs/models/operations/pastsubscription.md b/docs/models/operations/pastsubscription.md deleted file mode 100644 index 32008a8..0000000 --- a/docs/models/operations/pastsubscription.md +++ /dev/null @@ -1,22 +0,0 @@ -# PastSubscription - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `ID` | *string* | :heavy_check_mark: | N/A | | -| `Mode` | *string* | :heavy_check_mark: | N/A | | -| `RenewsAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `EndsAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `Canceled` | **bool* | :heavy_minus_sign: | N/A | false | -| `GracePeriod` | **bool* | :heavy_minus_sign: | N/A | false | -| `OnHold` | **bool* | :heavy_minus_sign: | N/A | false | -| `CanReactivate` | **bool* | :heavy_minus_sign: | N/A | false | -| `CanUpgrade` | **bool* | :heavy_minus_sign: | N/A | false | -| `CanDowngrade` | **bool* | :heavy_minus_sign: | N/A | false | -| `CanConvert` | **bool* | :heavy_minus_sign: | N/A | false | -| `Type` | *string* | :heavy_check_mark: | N/A | plexpass | -| `Transfer` | *string* | :heavy_check_mark: | N/A | | -| `State` | [operations.PostUsersSignInDataState](../../models/operations/postuserssignindatastate.md) | :heavy_check_mark: | N/A | ended | -| `Billing` | [operations.Billing](../../models/operations/billing.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/pathparamelement.md b/docs/models/operations/pathparamelement.md new file mode 100644 index 0000000..1f06923 --- /dev/null +++ b/docs/models/operations/pathparamelement.md @@ -0,0 +1,13 @@ +# PathParamElement + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `PathParamElementThumb` | thumb | +| `PathParamElementArt` | art | +| `PathParamElementClearLogo` | clearLogo | +| `PathParamElementBanner` | banner | +| `PathParamElementPoster` | poster | +| `PathParamElementTheme` | theme | \ No newline at end of file diff --git a/docs/models/operations/pathparamindex.md b/docs/models/operations/pathparamindex.md new file mode 100644 index 0000000..3323740 --- /dev/null +++ b/docs/models/operations/pathparamindex.md @@ -0,0 +1,10 @@ +# PathParamIndex + +The type of index to grab. + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `PathParamIndexSd` | sd | \ No newline at end of file diff --git a/docs/models/operations/pathparamtask.md b/docs/models/operations/pathparamtask.md new file mode 100644 index 0000000..51bf250 --- /dev/null +++ b/docs/models/operations/pathparamtask.md @@ -0,0 +1,31 @@ +# PathParamTask + +The task name + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `PathParamTaskAutomaticUpdates` | AutomaticUpdates | +| `PathParamTaskBackupDatabase` | BackupDatabase | +| `PathParamTaskButlerTaskGenerateAdMarkers` | ButlerTaskGenerateAdMarkers | +| `PathParamTaskButlerTaskGenerateCreditsMarkers` | ButlerTaskGenerateCreditsMarkers | +| `PathParamTaskButlerTaskGenerateIntroMarkers` | ButlerTaskGenerateIntroMarkers | +| `PathParamTaskButlerTaskGenerateVoiceActivity` | ButlerTaskGenerateVoiceActivity | +| `PathParamTaskCleanOldBundles` | CleanOldBundles | +| `PathParamTaskCleanOldCacheFiles` | CleanOldCacheFiles | +| `PathParamTaskDeepMediaAnalysis` | DeepMediaAnalysis | +| `PathParamTaskGarbageCollectBlobs` | GarbageCollectBlobs | +| `PathParamTaskGarbageCollectLibraryMedia` | GarbageCollectLibraryMedia | +| `PathParamTaskGenerateBlurHashes` | GenerateBlurHashes | +| `PathParamTaskGenerateChapterThumbs` | GenerateChapterThumbs | +| `PathParamTaskGenerateMediaIndexFiles` | GenerateMediaIndexFiles | +| `PathParamTaskLoudnessAnalysis` | LoudnessAnalysis | +| `PathParamTaskMusicAnalysis` | MusicAnalysis | +| `PathParamTaskOptimizeDatabase` | OptimizeDatabase | +| `PathParamTaskRefreshEpgGuides` | RefreshEpgGuides | +| `PathParamTaskRefreshLibraries` | RefreshLibraries | +| `PathParamTaskRefreshLocalMedia` | RefreshLocalMedia | +| `PathParamTaskRefreshPeriodicMetadata` | RefreshPeriodicMetadata | +| `PathParamTaskUpgradeMediaAnalysis` | UpgradeMediaAnalysis | \ No newline at end of file diff --git a/docs/models/operations/pathparamtaskname.md b/docs/models/operations/pathparamtaskname.md deleted file mode 100644 index af025a7..0000000 --- a/docs/models/operations/pathparamtaskname.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/pending.md b/docs/models/operations/pending.md deleted file mode 100644 index 7d8772f..0000000 --- a/docs/models/operations/pending.md +++ /dev/null @@ -1,11 +0,0 @@ -# Pending - -Indicates if the server is pending approval. - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `PendingDisable` | 0 | -| `PendingEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/performsearchrequest.md b/docs/models/operations/performsearchrequest.md deleted file mode 100644 index 6eaa10c..0000000 --- a/docs/models/operations/performsearchrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 3cbad9c..0000000 --- a/docs/models/operations/performsearchresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 8447212..0000000 --- a/docs/models/operations/performvoicesearchrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index cf7d06b..0000000 --- a/docs/models/operations/performvoicesearchresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/player.md b/docs/models/operations/player.md deleted file mode 100644 index 0331bf4..0000000 --- a/docs/models/operations/player.md +++ /dev/null @@ -1,22 +0,0 @@ -# Player - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | -| `Address` | **string* | :heavy_minus_sign: | N/A | 10.10.10.171 | -| `MachineIdentifier` | **string* | :heavy_minus_sign: | N/A | 3tsdzir85m2onc3qyr255aq1 | -| `Model` | **string* | :heavy_minus_sign: | N/A | standalone | -| `Platform` | **string* | :heavy_minus_sign: | N/A | windows | -| `PlatformVersion` | **string* | :heavy_minus_sign: | N/A | 10.0.22621 | -| `Product` | **string* | :heavy_minus_sign: | N/A | Plex for Windows | -| `Profile` | **string* | :heavy_minus_sign: | N/A | Plex Desktop | -| `RemotePublicAddress` | **string* | :heavy_minus_sign: | N/A | 68.248.140.20 | -| `State` | **string* | :heavy_minus_sign: | N/A | playing | -| `Title` | **string* | :heavy_minus_sign: | N/A | DESKTOP-BL80MTD | -| `Version` | **string* | :heavy_minus_sign: | N/A | 1.85.0.4071-21128b56 | -| `Local` | **bool* | :heavy_minus_sign: | N/A | true | -| `Relayed` | **bool* | :heavy_minus_sign: | N/A | false | -| `Secure` | **bool* | :heavy_minus_sign: | N/A | true | -| `UserID` | **int* | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/playlisttype.md b/docs/models/operations/playlisttype.md index ab5ca88..7af5030 100644 --- a/docs/models/operations/playlisttype.md +++ b/docs/models/operations/playlisttype.md @@ -1,6 +1,6 @@ # PlaylistType -limit to a type of playlist. +Limit to a type of playlist ## Values diff --git a/docs/models/operations/playqueuegenerator.md b/docs/models/operations/playqueuegenerator.md new file mode 100644 index 0000000..2782b7f --- /dev/null +++ b/docs/models/operations/playqueuegenerator.md @@ -0,0 +1,14 @@ +# PlayQueueGenerator + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `ChangedAt` | **int64* | :heavy_minus_sign: | N/A | +| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | +| `ID` | **int64* | :heavy_minus_sign: | N/A | +| `PlaylistID` | **int64* | :heavy_minus_sign: | N/A | +| `Type` | [*operations.GetPlaylistGeneratorsType](../../models/operations/getplaylistgeneratorstype.md) | :heavy_minus_sign: | The type of playlist generator.

- -1: A smart playlist generator
- 42: A optimized version generator
| +| `UpdatedAt` | **int64* | :heavy_minus_sign: | N/A | +| `URI` | **string* | :heavy_minus_sign: | The URI indicating the search for this generator | \ No newline at end of file diff --git a/docs/models/operations/plexdevice.md b/docs/models/operations/plexdevice.md deleted file mode 100644 index 24e3be3..0000000 --- a/docs/models/operations/plexdevice.md +++ /dev/null @@ -1,31 +0,0 @@ -# PlexDevice - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `Name` | *string* | :heavy_check_mark: | N/A | | -| `Product` | *string* | :heavy_check_mark: | N/A | | -| `ProductVersion` | *string* | :heavy_check_mark: | N/A | | -| `Platform` | *string* | :heavy_check_mark: | N/A | | -| `PlatformVersion` | *string* | :heavy_check_mark: | N/A | | -| `Device` | *string* | :heavy_check_mark: | N/A | | -| `ClientIdentifier` | *string* | :heavy_check_mark: | N/A | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2019-06-24T11:38:02Z | -| `LastSeenAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2019-06-24T11:38:02Z | -| `Provides` | *string* | :heavy_check_mark: | N/A | | -| `OwnerID` | *int64* | :heavy_check_mark: | ownerId is null when the device is owned by the token used to send the request | | -| `SourceTitle` | *string* | :heavy_check_mark: | N/A | | -| `PublicAddress` | *string* | :heavy_check_mark: | N/A | | -| `AccessToken` | *string* | :heavy_check_mark: | N/A | | -| `Owned` | *bool* | :heavy_check_mark: | N/A | | -| `Home` | *bool* | :heavy_check_mark: | N/A | | -| `Synced` | *bool* | :heavy_check_mark: | N/A | | -| `Relay` | *bool* | :heavy_check_mark: | N/A | | -| `Presence` | *bool* | :heavy_check_mark: | N/A | | -| `HTTPSRequired` | *bool* | :heavy_check_mark: | N/A | | -| `PublicAddressMatches` | *bool* | :heavy_check_mark: | N/A | | -| `DNSRebindingProtection` | *bool* | :heavy_check_mark: | N/A | | -| `NatLoopbackSupported` | *bool* | :heavy_check_mark: | N/A | | -| `Connections` | [][operations.Connections](../../models/operations/connections.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/policy.md b/docs/models/operations/policy.md new file mode 100644 index 0000000..e206d7b --- /dev/null +++ b/docs/models/operations/policy.md @@ -0,0 +1,10 @@ +# Policy + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Value` | **int64* | :heavy_minus_sign: | N/A | | +| `Scope` | [*operations.QueryParamScope](../../models/operations/queryparamscope.md) | :heavy_minus_sign: | N/A | | +| `Unwatched` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/postmediaartsrequest.md b/docs/models/operations/postmediaartsrequest.md deleted file mode 100644 index ae805f4..0000000 --- a/docs/models/operations/postmediaartsrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# PostMediaArtsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | -| `URL` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `RequestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | \ No newline at end of file diff --git a/docs/models/operations/postmediaartsresponse.md b/docs/models/operations/postmediaartsresponse.md deleted file mode 100644 index f2c053a..0000000 --- a/docs/models/operations/postmediaartsresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PostMediaArtsResponse - - -## 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/postmediaposterrequest.md b/docs/models/operations/postmediaposterrequest.md deleted file mode 100644 index c1a3da6..0000000 --- a/docs/models/operations/postmediaposterrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# PostMediaPosterRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | -| `URL` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `RequestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | \ No newline at end of file diff --git a/docs/models/operations/postmediaposterresponse.md b/docs/models/operations/postmediaposterresponse.md deleted file mode 100644 index 78fd78a..0000000 --- a/docs/models/operations/postmediaposterresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PostMediaPosterResponse - - -## 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/postuserssignindataauthenticationresponsestatus.md b/docs/models/operations/postuserssignindataauthenticationresponsestatus.md deleted file mode 100644 index 357a1df..0000000 --- a/docs/models/operations/postuserssignindataauthenticationresponsestatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataAuthenticationResponseStatus - -String representation of subscriptionActive - - -## Values - -| Name | Value | -| --------------------------------------------------------- | --------------------------------------------------------- | -| `PostUsersSignInDataAuthenticationResponseStatusInactive` | Inactive | -| `PostUsersSignInDataAuthenticationResponseStatusActive` | Active | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindataauthenticationstatus.md b/docs/models/operations/postuserssignindataauthenticationstatus.md deleted file mode 100644 index 7ca0040..0000000 --- a/docs/models/operations/postuserssignindataauthenticationstatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataAuthenticationStatus - -String representation of subscriptionActive - - -## Values - -| Name | Value | -| ------------------------------------------------- | ------------------------------------------------- | -| `PostUsersSignInDataAuthenticationStatusInactive` | Inactive | -| `PostUsersSignInDataAuthenticationStatusActive` | Active | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindataauthenticationsubscription.md b/docs/models/operations/postuserssignindataauthenticationsubscription.md deleted file mode 100644 index 8637d1c..0000000 --- a/docs/models/operations/postuserssignindataauthenticationsubscription.md +++ /dev/null @@ -1,13 +0,0 @@ -# PostUsersSignInDataAuthenticationSubscription - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `Features` | []*string* | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `Active` | **bool* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `SubscribedAt` | **string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `Status` | [*operations.PostUsersSignInDataAuthenticationResponseStatus](../../models/operations/postuserssignindataauthenticationresponsestatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `PaymentService` | **string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `Plan` | **string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindataautoselectsubtitle.md b/docs/models/operations/postuserssignindataautoselectsubtitle.md deleted file mode 100644 index 64a62fb..0000000 --- a/docs/models/operations/postuserssignindataautoselectsubtitle.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataAutoSelectSubtitle - -The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - - -## Values - -| Name | Value | -| ---------------------------------------------- | ---------------------------------------------- | -| `PostUsersSignInDataAutoSelectSubtitleDisable` | 0 | -| `PostUsersSignInDataAutoSelectSubtitleEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatadefaultsubtitleaccessibility.md b/docs/models/operations/postuserssignindatadefaultsubtitleaccessibility.md deleted file mode 100644 index 1249a53..0000000 --- a/docs/models/operations/postuserssignindatadefaultsubtitleaccessibility.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataDefaultSubtitleAccessibility - -The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) - - -## Values - -| Name | Value | -| -------------------------------------------------------- | -------------------------------------------------------- | -| `PostUsersSignInDataDefaultSubtitleAccessibilityDisable` | 0 | -| `PostUsersSignInDataDefaultSubtitleAccessibilityEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatadefaultsubtitleforced.md b/docs/models/operations/postuserssignindatadefaultsubtitleforced.md deleted file mode 100644 index 9c59943..0000000 --- a/docs/models/operations/postuserssignindatadefaultsubtitleforced.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataDefaultSubtitleForced - -The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) - - -## Values - -| Name | Value | -| ------------------------------------------------- | ------------------------------------------------- | -| `PostUsersSignInDataDefaultSubtitleForcedDisable` | 0 | -| `PostUsersSignInDataDefaultSubtitleForcedEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatamailingliststatus.md b/docs/models/operations/postuserssignindatamailingliststatus.md deleted file mode 100644 index 259453d..0000000 --- a/docs/models/operations/postuserssignindatamailingliststatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataMailingListStatus - -Your current mailing list status (active or unsubscribed) - - -## Values - -| Name | Value | -| -------------------------------------------------- | -------------------------------------------------- | -| `PostUsersSignInDataMailingListStatusActive` | active | -| `PostUsersSignInDataMailingListStatusUnsubscribed` | unsubscribed | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatamediareviewsvisibility.md b/docs/models/operations/postuserssignindatamediareviewsvisibility.md deleted file mode 100644 index 509e0d7..0000000 --- a/docs/models/operations/postuserssignindatamediareviewsvisibility.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataMediaReviewsVisibility - -Whether or not the account has media reviews visibility enabled - - -## Values - -| Name | Value | -| -------------------------------------------------- | -------------------------------------------------- | -| `PostUsersSignInDataMediaReviewsVisibilityDisable` | 0 | -| `PostUsersSignInDataMediaReviewsVisibilityEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatarequest.md b/docs/models/operations/postuserssignindatarequest.md deleted file mode 100644 index 5f330fb..0000000 --- a/docs/models/operations/postuserssignindatarequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# PostUsersSignInDataRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `ClientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `ClientName` | **string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `DeviceNickname` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `ClientVersion` | **string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `Platform` | **string* | :heavy_minus_sign: | The platform of the client application. | Roku | -| `RequestBody` | [*operations.PostUsersSignInDataRequestBody](../../models/operations/postuserssignindatarequestbody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatarequestbody.md b/docs/models/operations/postuserssignindatarequestbody.md deleted file mode 100644 index cadfc27..0000000 --- a/docs/models/operations/postuserssignindatarequestbody.md +++ /dev/null @@ -1,13 +0,0 @@ -# PostUsersSignInDataRequestBody - -Login credentials - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `Login` | *string* | :heavy_check_mark: | N/A | username@email.com | -| `Password` | *string* | :heavy_check_mark: | N/A | password123 | -| `RememberMe` | **bool* | :heavy_minus_sign: | N/A | | -| `VerificationCode` | **string* | :heavy_minus_sign: | N/A | 123456 | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindataresponse.md b/docs/models/operations/postuserssignindataresponse.md deleted file mode 100644 index 13460f0..0000000 --- a/docs/models/operations/postuserssignindataresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataResponse - - -## 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 | -| `UserPlexAccount` | [*operations.PostUsersSignInDataUserPlexAccount](../../models/operations/postuserssignindatauserplexaccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindataservices.md b/docs/models/operations/postuserssignindataservices.md deleted file mode 100644 index 6453480..0000000 --- a/docs/models/operations/postuserssignindataservices.md +++ /dev/null @@ -1,12 +0,0 @@ -# PostUsersSignInDataServices - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Identifier` | *string* | :heavy_check_mark: | N/A | metadata-dev | -| `Endpoint` | *string* | :heavy_check_mark: | N/A | https://epg.provider.plex.tv | -| `Token` | *string* | :heavy_check_mark: | N/A | DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv | -| `Secret` | *string* | :heavy_check_mark: | N/A | | -| `Status` | [operations.PostUsersSignInDataStatus](../../models/operations/postuserssignindatastatus.md) | :heavy_check_mark: | N/A | online | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatastate.md b/docs/models/operations/postuserssignindatastate.md deleted file mode 100644 index 52cf607..0000000 --- a/docs/models/operations/postuserssignindatastate.md +++ /dev/null @@ -1,8 +0,0 @@ -# PostUsersSignInDataState - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `PostUsersSignInDataStateEnded` | ended | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatastatus.md b/docs/models/operations/postuserssignindatastatus.md deleted file mode 100644 index 9c1762a..0000000 --- a/docs/models/operations/postuserssignindatastatus.md +++ /dev/null @@ -1,9 +0,0 @@ -# PostUsersSignInDataStatus - - -## Values - -| Name | Value | -| ---------------------------------- | ---------------------------------- | -| `PostUsersSignInDataStatusOnline` | online | -| `PostUsersSignInDataStatusOffline` | offline | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatasubscription.md b/docs/models/operations/postuserssignindatasubscription.md deleted file mode 100644 index 6ba2e08..0000000 --- a/docs/models/operations/postuserssignindatasubscription.md +++ /dev/null @@ -1,15 +0,0 @@ -# PostUsersSignInDataSubscription - -If the account’s Plex Pass subscription is active - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `Features` | []*string* | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `Active` | **bool* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `SubscribedAt` | **string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `Status` | [*operations.PostUsersSignInDataAuthenticationStatus](../../models/operations/postuserssignindataauthenticationstatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `PaymentService` | **string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `Plan` | **string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatauserplexaccount.md b/docs/models/operations/postuserssignindatauserplexaccount.md deleted file mode 100644 index e3a4588..0000000 --- a/docs/models/operations/postuserssignindatauserplexaccount.md +++ /dev/null @@ -1,52 +0,0 @@ -# PostUsersSignInDataUserPlexAccount - -Returns the user account data with a valid auth token - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdsConsent` | *bool* | :heavy_check_mark: | Unknown | | -| `AdsConsentReminderAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `AdsConsentSetAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 | -| `Anonymous` | **bool* | :heavy_minus_sign: | Unknown | | -| `AuthToken` | *string* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf | -| `BackupCodesCreated` | **bool* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | | -| `Confirmed` | **bool* | :heavy_minus_sign: | If the account has been confirmed | | -| `Country` | *string* | :heavy_check_mark: | The account country | US | -| `Email` | *string* | :heavy_check_mark: | The account email address | username@email.com | -| `EmailOnlyAuth` | **bool* | :heavy_minus_sign: | If login with email only is enabled | | -| `ExperimentalFeatures` | **bool* | :heavy_minus_sign: | If experimental features are enabled | | -| `FriendlyName` | *string* | :heavy_check_mark: | Your account full name | friendlyUsername | -| `Entitlements` | []*string* | :heavy_check_mark: | List of devices your allowed to use with this account | | -| `Guest` | **bool* | :heavy_minus_sign: | If the account is a Plex Home guest user | | -| `HasPassword` | **bool* | :heavy_minus_sign: | If the account has a password | | -| `Home` | **bool* | :heavy_minus_sign: | If the account is a Plex Home user | | -| `HomeAdmin` | **bool* | :heavy_minus_sign: | If the account is the Plex Home admin | | -| `HomeSize` | *int* | :heavy_check_mark: | The number of accounts in the Plex Home | 1 | -| `ID` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 | -| `JoinedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `Locale` | *string* | :heavy_check_mark: | The account locale | | -| `MailingListActive` | **bool* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | -| `MailingListStatus` | [operations.PostUsersSignInDataMailingListStatus](../../models/operations/postuserssignindatamailingliststatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active | -| `MaxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 | -| ~~`Pin`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[Might be removed] The hashed Plex Home PIN | | -| `Profile` | [operations.PostUsersSignInDataUserProfile](../../models/operations/postuserssignindatauserprofile.md) | :heavy_check_mark: | N/A | | -| `Protected` | **bool* | :heavy_minus_sign: | If the account has a Plex Home PIN enabled | | -| `RememberExpiresAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `Restricted` | **bool* | :heavy_minus_sign: | If the account is a Plex Home managed user | | -| `Roles` | []*string* | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | | -| `ScrobbleTypes` | *string* | :heavy_check_mark: | Unknown | | -| `Services` | [][operations.PostUsersSignInDataServices](../../models/operations/postuserssignindataservices.md) | :heavy_check_mark: | N/A | | -| `Subscription` | [operations.PostUsersSignInDataSubscription](../../models/operations/postuserssignindatasubscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | | -| `SubscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | | -| `Subscriptions` | [][operations.PostUsersSignInDataAuthenticationSubscription](../../models/operations/postuserssignindataauthenticationsubscription.md) | :heavy_minus_sign: | N/A | | -| `Thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 | -| `Title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle | -| `TwoFactorEnabled` | **bool* | :heavy_minus_sign: | If two-factor authentication is enabled | | -| `Username` | *string* | :heavy_check_mark: | The account username | Username | -| `UUID` | *string* | :heavy_check_mark: | The account UUID | dae343c1f45beb4f | -| `AttributionPartner` | *string* | :heavy_check_mark: | N/A | | -| `PastSubscriptions` | [][operations.PastSubscription](../../models/operations/pastsubscription.md) | :heavy_check_mark: | N/A | | -| `Trials` | [][operations.Trials](../../models/operations/trials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatauserprofile.md b/docs/models/operations/postuserssignindatauserprofile.md deleted file mode 100644 index 763197a..0000000 --- a/docs/models/operations/postuserssignindatauserprofile.md +++ /dev/null @@ -1,15 +0,0 @@ -# PostUsersSignInDataUserProfile - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `AutoSelectAudio` | **bool* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | -| `DefaultAudioLanguage` | *string* | :heavy_check_mark: | The preferred audio language for the account | ja | -| `DefaultSubtitleLanguage` | *string* | :heavy_check_mark: | The preferred subtitle language for the account | en | -| `AutoSelectSubtitle` | [*operations.PostUsersSignInDataAutoSelectSubtitle](../../models/operations/postuserssignindataautoselectsubtitle.md) | :heavy_minus_sign: | N/A | 1 | -| `DefaultSubtitleAccessibility` | [*operations.PostUsersSignInDataDefaultSubtitleAccessibility](../../models/operations/postuserssignindatadefaultsubtitleaccessibility.md) | :heavy_minus_sign: | N/A | 1 | -| `DefaultSubtitleForced` | [*operations.PostUsersSignInDataDefaultSubtitleForced](../../models/operations/postuserssignindatadefaultsubtitleforced.md) | :heavy_minus_sign: | N/A | 1 | -| `WatchedIndicator` | [*operations.PostUsersSignInDataWatchedIndicator](../../models/operations/postuserssignindatawatchedindicator.md) | :heavy_minus_sign: | N/A | 1 | -| `MediaReviewsVisibility` | [*operations.PostUsersSignInDataMediaReviewsVisibility](../../models/operations/postuserssignindatamediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/postuserssignindatawatchedindicator.md b/docs/models/operations/postuserssignindatawatchedindicator.md deleted file mode 100644 index 8d8e861..0000000 --- a/docs/models/operations/postuserssignindatawatchedindicator.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataWatchedIndicator - -Whether or not media watched indicators are enabled (little orange dot on media) - - -## Values - -| Name | Value | -| -------------------------------------------- | -------------------------------------------- | -| `PostUsersSignInDataWatchedIndicatorDisable` | 0 | -| `PostUsersSignInDataWatchedIndicatorEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/prefs.md b/docs/models/operations/prefs.md new file mode 100644 index 0000000..0da5d3f --- /dev/null +++ b/docs/models/operations/prefs.md @@ -0,0 +1,7 @@ +# Prefs + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/processingstate.md b/docs/models/operations/processingstate.md new file mode 100644 index 0000000..92f8c25 --- /dev/null +++ b/docs/models/operations/processingstate.md @@ -0,0 +1,15 @@ +# ProcessingState + +The state of processing if this generator is part of an optimizer playlist + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `ProcessingStateProcessed` | processed | +| `ProcessingStateCompleted` | completed | +| `ProcessingStateTombstoned` | tombstoned | +| `ProcessingStateDisabled` | disabled | +| `ProcessingStateError` | error | +| `ProcessingStatePending` | pending | \ No newline at end of file diff --git a/docs/models/operations/processingstatecontext.md b/docs/models/operations/processingstatecontext.md new file mode 100644 index 0000000..a25e31c --- /dev/null +++ b/docs/models/operations/processingstatecontext.md @@ -0,0 +1,21 @@ +# ProcessingStateContext + +The error which could have occurred (or `good`) + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `ProcessingStateContextGood` | good | +| `ProcessingStateContextSourceFileUnavailable` | sourceFileUnavailable | +| `ProcessingStateContextSourceFileMetadataError` | sourceFileMetadataError | +| `ProcessingStateContextClientProfileError` | clientProfileError | +| `ProcessingStateContextIoError` | ioError | +| `ProcessingStateContextTranscoderError` | transcoderError | +| `ProcessingStateContextUnknownError` | unknownError | +| `ProcessingStateContextMediaAnalysisError` | mediaAnalysisError | +| `ProcessingStateContextDownloadFailed` | downloadFailed | +| `ProcessingStateContextAccessDenied` | accessDenied | +| `ProcessingStateContextCannotTranscode` | cannotTranscode | +| `ProcessingStateContextCodecInstallError` | codecInstallError | \ No newline at end of file diff --git a/docs/models/operations/processsubscriptionsresponse.md b/docs/models/operations/processsubscriptionsresponse.md new file mode 100644 index 0000000..4cd3c93 --- /dev/null +++ b/docs/models/operations/processsubscriptionsresponse.md @@ -0,0 +1,11 @@ +# ProcessSubscriptionsResponse + + +## 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 | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/producer.md b/docs/models/operations/producer.md deleted file mode 100644 index d4ff29e..0000000 --- a/docs/models/operations/producer.md +++ /dev/null @@ -1,12 +0,0 @@ -# Producer - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the producer. | 126522 | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this producer. | producer=126522 | -| `Tag` | *string* | :heavy_check_mark: | The name of the producer | Amelia Knapp | -| `TagKey` | *string* | :heavy_check_mark: | A 24-character hexadecimal unique key associated with the producer's tag, used for internal identification.
| 5d77683d85719b001f3a535e | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the producer. | https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg | \ No newline at end of file diff --git a/docs/models/operations/protected.md b/docs/models/operations/protected.md deleted file mode 100644 index 05f5e78..0000000 --- a/docs/models/operations/protected.md +++ /dev/null @@ -1,11 +0,0 @@ -# Protected - -Indicates whether the account is protected. - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `ProtectedDisable` | 0 | -| `ProtectedEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/protocol.md b/docs/models/operations/protocol.md index c6ddb3b..5869486 100644 --- a/docs/models/operations/protocol.md +++ b/docs/models/operations/protocol.md @@ -1,11 +1,13 @@ # Protocol -The protocol used for the connection (http, https, etc) +Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + ## Values -| Name | Value | -| --------------- | --------------- | -| `ProtocolHTTP` | http | -| `ProtocolHTTPS` | https | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `ProtocolHTTP` | http | +| `ProtocolHls` | hls | +| `ProtocolDash` | dash | \ No newline at end of file diff --git a/docs/models/operations/provider.md b/docs/models/operations/provider.md deleted file mode 100644 index 464aaf1..0000000 --- a/docs/models/operations/provider.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/queryparamargs.md b/docs/models/operations/queryparamargs.md new file mode 100644 index 0000000..65f0d63 --- /dev/null +++ b/docs/models/operations/queryparamargs.md @@ -0,0 +1,7 @@ +# QueryParamArgs + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/queryparamattributes.md b/docs/models/operations/queryparamattributes.md new file mode 100644 index 0000000..a41b227 --- /dev/null +++ b/docs/models/operations/queryparamattributes.md @@ -0,0 +1,9 @@ +# QueryParamAttributes + +The attributes to assign to this marker + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/queryparamfilter.md b/docs/models/operations/queryparamfilter.md deleted file mode 100644 index 7167549..0000000 --- a/docs/models/operations/queryparamfilter.md +++ /dev/null @@ -1,11 +0,0 @@ -# QueryParamFilter - -Filters content by field and direction/equality -(Unknown if viewedAt is the only supported column) - - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/queryparamforce.md b/docs/models/operations/queryparamforce.md deleted file mode 100644 index e6dcec5..0000000 --- a/docs/models/operations/queryparamforce.md +++ /dev/null @@ -1,15 +0,0 @@ -# QueryParamForce - -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 | -| --------------------- | --------------------- | -| `QueryParamForceZero` | 0 | -| `QueryParamForceOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamincludecollections.md b/docs/models/operations/queryparamincludecollections.md deleted file mode 100644 index 3425743..0000000 --- a/docs/models/operations/queryparamincludecollections.md +++ /dev/null @@ -1,9 +0,0 @@ -# QueryParamIncludeCollections - - -## Values - -| Name | Value | -| ------------------------------------- | ------------------------------------- | -| `QueryParamIncludeCollectionsDisable` | 0 | -| `QueryParamIncludeCollectionsEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamincludeexternalmedia.md b/docs/models/operations/queryparamincludeexternalmedia.md deleted file mode 100644 index 70b004a..0000000 --- a/docs/models/operations/queryparamincludeexternalmedia.md +++ /dev/null @@ -1,9 +0,0 @@ -# QueryParamIncludeExternalMedia - - -## Values - -| Name | Value | -| --------------------------------------- | --------------------------------------- | -| `QueryParamIncludeExternalMediaDisable` | 0 | -| `QueryParamIncludeExternalMediaEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamincludeguids.md b/docs/models/operations/queryparamincludeguids.md deleted file mode 100644 index c093cb0..0000000 --- a/docs/models/operations/queryparamincludeguids.md +++ /dev/null @@ -1,12 +0,0 @@ -# QueryParamIncludeGuids - -Adds the Guid object to the response - - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `QueryParamIncludeGuidsDisable` | 0 | -| `QueryParamIncludeGuidsEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamincludemeta.md b/docs/models/operations/queryparamincludemeta.md deleted file mode 100644 index 87050c4..0000000 --- a/docs/models/operations/queryparamincludemeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# QueryParamIncludeMeta - -Adds the Meta object to the response - - - -## Values - -| Name | Value | -| ------------------------------ | ------------------------------ | -| `QueryParamIncludeMetaDisable` | 0 | -| `QueryParamIncludeMetaEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamlocation.md b/docs/models/operations/queryparamlocation.md new file mode 100644 index 0000000..e297d5d --- /dev/null +++ b/docs/models/operations/queryparamlocation.md @@ -0,0 +1,12 @@ +# QueryParamLocation + +Network type of the client, can be used to help determine target bitrate. + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QueryParamLocationLan` | lan | +| `QueryParamLocationWan` | wan | +| `QueryParamLocationCellular` | cellular | \ No newline at end of file diff --git a/docs/models/operations/queryparamonlytransient.md b/docs/models/operations/queryparamonlytransient.md deleted file mode 100644 index ed114a5..0000000 --- a/docs/models/operations/queryparamonlytransient.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/queryparamprefs.md b/docs/models/operations/queryparamprefs.md new file mode 100644 index 0000000..cbf9b54 --- /dev/null +++ b/docs/models/operations/queryparamprefs.md @@ -0,0 +1,9 @@ +# QueryParamPrefs + +The preferences for this section + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/queryparamprotocol.md b/docs/models/operations/queryparamprotocol.md new file mode 100644 index 0000000..d5e80f0 --- /dev/null +++ b/docs/models/operations/queryparamprotocol.md @@ -0,0 +1,13 @@ +# QueryParamProtocol + +Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `QueryParamProtocolHTTP` | http | +| `QueryParamProtocolHls` | hls | +| `QueryParamProtocolDash` | dash | \ No newline at end of file diff --git a/docs/models/operations/queryparamscope.md b/docs/models/operations/queryparamscope.md new file mode 100644 index 0000000..a2eb02b --- /dev/null +++ b/docs/models/operations/queryparamscope.md @@ -0,0 +1,9 @@ +# QueryParamScope + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `QueryParamScopeAll` | all | +| `QueryParamScopeCount` | count | \ No newline at end of file diff --git a/docs/models/operations/queryparamsmart.md b/docs/models/operations/queryparamsmart.md deleted file mode 100644 index cfa97c1..0000000 --- a/docs/models/operations/queryparamsmart.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/queryparamsubtitles.md b/docs/models/operations/queryparamsubtitles.md new file mode 100644 index 0000000..04afd5a --- /dev/null +++ b/docs/models/operations/queryparamsubtitles.md @@ -0,0 +1,17 @@ +# QueryParamSubtitles + +Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `QueryParamSubtitlesAuto` | auto | +| `QueryParamSubtitlesBurn` | burn | +| `QueryParamSubtitlesNone` | none | +| `QueryParamSubtitlesSidecar` | sidecar | +| `QueryParamSubtitlesEmbedded` | embedded | +| `QueryParamSubtitlesSegmented` | segmented | +| `QueryParamSubtitlesUnknown` | unknown | \ No newline at end of file diff --git a/docs/models/operations/queryparamtype.md b/docs/models/operations/queryparamtype.md index e70cdbe..aa2e053 100644 --- a/docs/models/operations/queryparamtype.md +++ b/docs/models/operations/queryparamtype.md @@ -1,24 +1,10 @@ # QueryParamType -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - +The value `delegation` is the only supported `type` parameter. ## Values | Name | Value | | -------------------------- | -------------------------- | -| `QueryParamTypeMovie` | 1 | -| `QueryParamTypeTvShow` | 2 | -| `QueryParamTypeSeason` | 3 | -| `QueryParamTypeEpisode` | 4 | -| `QueryParamTypeArtist` | 5 | -| `QueryParamTypeAlbum` | 6 | -| `QueryParamTypeTrack` | 7 | -| `QueryParamTypePhotoAlbum` | 8 | -| `QueryParamTypePhoto` | 9 | \ No newline at end of file +| `QueryParamTypeDelegation` | delegation | \ No newline at end of file diff --git a/docs/models/operations/rating.md b/docs/models/operations/rating.md deleted file mode 100644 index 4a8b7da..0000000 --- a/docs/models/operations/rating.md +++ /dev/null @@ -1,12 +0,0 @@ -# Rating - -The type of rating, for example 'audience' or 'critic'. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `Image` | *string* | :heavy_check_mark: | The URL for the rating image, for example from IMDb. | imdb://image.rating | -| `Value` | *float32* | :heavy_check_mark: | N/A | 5.1 | -| `Type` | *string* | :heavy_check_mark: | N/A | audience | \ No newline at end of file diff --git a/docs/models/operations/ratings.md b/docs/models/operations/ratings.md deleted file mode 100644 index 28be5c0..0000000 --- a/docs/models/operations/ratings.md +++ /dev/null @@ -1,10 +0,0 @@ -# Ratings - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `Image` | *string* | :heavy_check_mark: | The image or reference for the rating. | imdb://image.rating | -| `Value` | *float32* | :heavy_check_mark: | The rating value. | 9 | -| `Type` | *string* | :heavy_check_mark: | The type of rating (e.g., audience, critic). | audience | \ No newline at end of file diff --git a/docs/models/operations/recommendationsvisibility.md b/docs/models/operations/recommendationsvisibility.md new file mode 100644 index 0000000..3b9f26a --- /dev/null +++ b/docs/models/operations/recommendationsvisibility.md @@ -0,0 +1,18 @@ +# RecommendationsVisibility + +The visibility of this hub in recommendations: + - all: Visible to all users + - none: Visible to no users + - admin: Visible to only admin users + - shared: Visible to shared users + + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `RecommendationsVisibilityAll` | all | +| `RecommendationsVisibilityNone` | none | +| `RecommendationsVisibilityAdmin` | admin | +| `RecommendationsVisibilityShared` | shared | \ No newline at end of file diff --git a/docs/models/operations/refreshitemsmetadataglobals.md b/docs/models/operations/refreshitemsmetadataglobals.md new file mode 100644 index 0000000..b6cce6d --- /dev/null +++ b/docs/models/operations/refreshitemsmetadataglobals.md @@ -0,0 +1,18 @@ +# RefreshItemsMetadataGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/refreshitemsmetadatarequest.md b/docs/models/operations/refreshitemsmetadatarequest.md new file mode 100644 index 0000000..9deea1e --- /dev/null +++ b/docs/models/operations/refreshitemsmetadatarequest.md @@ -0,0 +1,21 @@ +# RefreshItemsMetadataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Agent` | **string* | :heavy_minus_sign: | N/A | | +| `MarkUpdated` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/refreshitemsmetadataresponse.md b/docs/models/operations/refreshitemsmetadataresponse.md new file mode 100644 index 0000000..617f7fa --- /dev/null +++ b/docs/models/operations/refreshitemsmetadataresponse.md @@ -0,0 +1,10 @@ +# RefreshItemsMetadataResponse + + +## 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/refreshplaylistglobals.md b/docs/models/operations/refreshplaylistglobals.md new file mode 100644 index 0000000..270d605 --- /dev/null +++ b/docs/models/operations/refreshplaylistglobals.md @@ -0,0 +1,18 @@ +# RefreshPlaylistGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/refreshplaylistrequest.md b/docs/models/operations/refreshplaylistrequest.md new file mode 100644 index 0000000..ca64630 --- /dev/null +++ b/docs/models/operations/refreshplaylistrequest.md @@ -0,0 +1,22 @@ +# RefreshPlaylistRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | +| `GeneratorID` | *int64* | :heavy_check_mark: | The generator item ID to act on | | +| `MetadataID` | *int64* | :heavy_check_mark: | The metadata item ID to act on | | +| `Action` | [operations.Action](../../models/operations/action.md) | :heavy_check_mark: | The action to perform for this item on this optimizer queue | | \ No newline at end of file diff --git a/docs/models/operations/refreshplaylistresponse.md b/docs/models/operations/refreshplaylistresponse.md new file mode 100644 index 0000000..42c36b2 --- /dev/null +++ b/docs/models/operations/refreshplaylistresponse.md @@ -0,0 +1,10 @@ +# RefreshPlaylistResponse + + +## 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/refreshprovidersresponse.md b/docs/models/operations/refreshprovidersresponse.md new file mode 100644 index 0000000..1b3461a --- /dev/null +++ b/docs/models/operations/refreshprovidersresponse.md @@ -0,0 +1,10 @@ +# RefreshProvidersResponse + + +## 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/refreshsectionglobals.md b/docs/models/operations/refreshsectionglobals.md new file mode 100644 index 0000000..d3f525a --- /dev/null +++ b/docs/models/operations/refreshsectionglobals.md @@ -0,0 +1,18 @@ +# RefreshSectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/refreshsectionrequest.md b/docs/models/operations/refreshsectionrequest.md new file mode 100644 index 0000000..1c1f22e --- /dev/null +++ b/docs/models/operations/refreshsectionrequest.md @@ -0,0 +1,21 @@ +# RefreshSectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Force` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether the update of metadata and items should be performed even if modification dates indicate the items have not change | 1 | +| `Path` | **string* | :heavy_minus_sign: | Restrict refresh to the specified path | | \ No newline at end of file diff --git a/docs/models/operations/refreshsectionresponse.md b/docs/models/operations/refreshsectionresponse.md new file mode 100644 index 0000000..04a0fea --- /dev/null +++ b/docs/models/operations/refreshsectionresponse.md @@ -0,0 +1,10 @@ +# RefreshSectionResponse + + +## 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/refreshsectionsmetadataglobals.md b/docs/models/operations/refreshsectionsmetadataglobals.md new file mode 100644 index 0000000..62dfdd8 --- /dev/null +++ b/docs/models/operations/refreshsectionsmetadataglobals.md @@ -0,0 +1,18 @@ +# RefreshSectionsMetadataGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/refreshsectionsmetadatarequest.md b/docs/models/operations/refreshsectionsmetadatarequest.md new file mode 100644 index 0000000..5af30e5 --- /dev/null +++ b/docs/models/operations/refreshsectionsmetadatarequest.md @@ -0,0 +1,19 @@ +# RefreshSectionsMetadataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Force` | **bool* | :heavy_minus_sign: | Force refresh of metadata | | \ No newline at end of file diff --git a/docs/models/operations/refreshsectionsmetadataresponse.md b/docs/models/operations/refreshsectionsmetadataresponse.md new file mode 100644 index 0000000..80d7686 --- /dev/null +++ b/docs/models/operations/refreshsectionsmetadataresponse.md @@ -0,0 +1,10 @@ +# RefreshSectionsMetadataResponse + + +## 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/release.md b/docs/models/operations/release.md index d73a622..bad3084 100644 --- a/docs/models/operations/release.md +++ b/docs/models/operations/release.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Key` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/updater/releases/5136 | -| `Version` | **string* | :heavy_minus_sign: | N/A | 1.40.0.7775-456fbaf97 | -| `Added` | **string* | :heavy_minus_sign: | N/A | (PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.
(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)
(Music) Store track genres and add filtering options (#14653)
(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)
(View History) No longer create a view history entry for items marked as played (#10888)
(Web) Updated to 4.118.0 | -| `Fixed` | **string* | :heavy_minus_sign: | N/A | (Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)
(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)
(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)
(Collection) Server could become unresponsive when collection membership changes (#14612)
(DVR) Previously watched recordings could be deleted without being watched again (#13779)
(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)
(Library) The Content Rating not equal to None filter does not work (#14620)
(Search) Album search results could contain all the album's tracks too (#14486)
(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)
(Transcoder) HW encoding would fail on devices with no rate control (#14222)
(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605) | -| `DownloadURL` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx | -| `State` | **string* | :heavy_minus_sign: | N/A | notify | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Added` | **string* | :heavy_minus_sign: | A list of what has been added in this version | +| `DownloadURL` | **string* | :heavy_minus_sign: | The URL of where this update is available | +| `Fixed` | **string* | :heavy_minus_sign: | A list of what has been fixed in this version | +| `Key` | **string* | :heavy_minus_sign: | The URL key of the update | +| `State` | [*operations.GetUpdatesStatusState](../../models/operations/getupdatesstatusstate.md) | :heavy_minus_sign: | The status of this update.

- available - This release is available
- downloading - This release is downloading
- downloaded - This release has been downloaded
- installing - This release is installing
- tonight - This release will be installed tonight
- skipped - This release has been skipped
- error - This release has an error
- notify - This release is only notifying it is available (typically because it cannot be installed on this setup)
- done - This release is complete
| +| `Version` | **string* | :heavy_minus_sign: | The version available | \ No newline at end of file diff --git a/docs/models/operations/reloadguideglobals.md b/docs/models/operations/reloadguideglobals.md new file mode 100644 index 0000000..607edf9 --- /dev/null +++ b/docs/models/operations/reloadguideglobals.md @@ -0,0 +1,18 @@ +# ReloadGuideGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/reloadguiderequest.md b/docs/models/operations/reloadguiderequest.md new file mode 100644 index 0000000..0331bac --- /dev/null +++ b/docs/models/operations/reloadguiderequest.md @@ -0,0 +1,19 @@ +# ReloadGuideRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | \ No newline at end of file diff --git a/docs/models/operations/reloadguideresponse.md b/docs/models/operations/reloadguideresponse.md new file mode 100644 index 0000000..692ddab --- /dev/null +++ b/docs/models/operations/reloadguideresponse.md @@ -0,0 +1,11 @@ +# ReloadGuideResponse + + +## 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 | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrdvr.md b/docs/models/operations/removedevicefromdvrdvr.md new file mode 100644 index 0000000..88c4bb9 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrdvr.md @@ -0,0 +1,12 @@ +# RemoveDeviceFromDVRDVR + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrdvrsmediacontainer.md b/docs/models/operations/removedevicefromdvrdvrsmediacontainer.md new file mode 100644 index 0000000..98ab0e7 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# RemoveDeviceFromDVRDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrglobals.md b/docs/models/operations/removedevicefromdvrglobals.md new file mode 100644 index 0000000..a8d5e15 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrglobals.md @@ -0,0 +1,18 @@ +# RemoveDeviceFromDVRGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrmediacontainer.md b/docs/models/operations/removedevicefromdvrmediacontainer.md new file mode 100644 index 0000000..dfc2911 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrmediacontainer.md @@ -0,0 +1,9 @@ +# RemoveDeviceFromDVRMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.RemoveDeviceFromDVRDVRsMediaContainer](../../models/operations/removedevicefromdvrdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.RemoveDeviceFromDVRDVR](../../models/operations/removedevicefromdvrdvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrrequest.md b/docs/models/operations/removedevicefromdvrrequest.md new file mode 100644 index 0000000..5d0adc1 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrrequest.md @@ -0,0 +1,20 @@ +# RemoveDeviceFromDVRRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device to add. | | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrresponse.md b/docs/models/operations/removedevicefromdvrresponse.md new file mode 100644 index 0000000..a75f0b8 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrresponse.md @@ -0,0 +1,12 @@ +# RemoveDeviceFromDVRResponse + + +## 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.RemoveDeviceFromDVRResponseBody](../../models/operations/removedevicefromdvrresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedevicefromdvrresponsebody.md b/docs/models/operations/removedevicefromdvrresponsebody.md new file mode 100644 index 0000000..5898e30 --- /dev/null +++ b/docs/models/operations/removedevicefromdvrresponsebody.md @@ -0,0 +1,10 @@ +# RemoveDeviceFromDVRResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.RemoveDeviceFromDVRMediaContainer](../../models/operations/removedevicefromdvrmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedeviceglobals.md b/docs/models/operations/removedeviceglobals.md new file mode 100644 index 0000000..a433d37 --- /dev/null +++ b/docs/models/operations/removedeviceglobals.md @@ -0,0 +1,18 @@ +# RemoveDeviceGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/removedevicemediacontainer.md b/docs/models/operations/removedevicemediacontainer.md new file mode 100644 index 0000000..40fee02 --- /dev/null +++ b/docs/models/operations/removedevicemediacontainer.md @@ -0,0 +1,18 @@ +# RemoveDeviceMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Message` | **string* | :heavy_minus_sign: | N/A | +| `Status` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedevicerequest.md b/docs/models/operations/removedevicerequest.md new file mode 100644 index 0000000..835da5d --- /dev/null +++ b/docs/models/operations/removedevicerequest.md @@ -0,0 +1,19 @@ +# RemoveDeviceRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | \ No newline at end of file diff --git a/docs/models/operations/removedeviceresponse.md b/docs/models/operations/removedeviceresponse.md new file mode 100644 index 0000000..f135d73 --- /dev/null +++ b/docs/models/operations/removedeviceresponse.md @@ -0,0 +1,12 @@ +# RemoveDeviceResponse + + +## 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.RemoveDeviceResponseBody](../../models/operations/removedeviceresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedeviceresponsebody.md b/docs/models/operations/removedeviceresponsebody.md new file mode 100644 index 0000000..ac8af9a --- /dev/null +++ b/docs/models/operations/removedeviceresponsebody.md @@ -0,0 +1,10 @@ +# RemoveDeviceResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.RemoveDeviceMediaContainer](../../models/operations/removedevicemediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removedownloadqueueitemsglobals.md b/docs/models/operations/removedownloadqueueitemsglobals.md new file mode 100644 index 0000000..4262890 --- /dev/null +++ b/docs/models/operations/removedownloadqueueitemsglobals.md @@ -0,0 +1,18 @@ +# RemoveDownloadQueueItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/removedownloadqueueitemsrequest.md b/docs/models/operations/removedownloadqueueitemsrequest.md new file mode 100644 index 0000000..f25f43a --- /dev/null +++ b/docs/models/operations/removedownloadqueueitemsrequest.md @@ -0,0 +1,20 @@ +# RemoveDownloadQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | +| `ItemID` | []*int64* | :heavy_check_mark: | The item id | [
32,
345,
23
] | \ No newline at end of file diff --git a/docs/models/operations/removedownloadqueueitemsresponse.md b/docs/models/operations/removedownloadqueueitemsresponse.md new file mode 100644 index 0000000..28f4dbd --- /dev/null +++ b/docs/models/operations/removedownloadqueueitemsresponse.md @@ -0,0 +1,10 @@ +# RemoveDownloadQueueItemsResponse + + +## 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/reordersubscriptionglobals.md b/docs/models/operations/reordersubscriptionglobals.md new file mode 100644 index 0000000..f26182a --- /dev/null +++ b/docs/models/operations/reordersubscriptionglobals.md @@ -0,0 +1,18 @@ +# ReorderSubscriptionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/reordersubscriptionrequest.md b/docs/models/operations/reordersubscriptionrequest.md new file mode 100644 index 0000000..5ce803c --- /dev/null +++ b/docs/models/operations/reordersubscriptionrequest.md @@ -0,0 +1,20 @@ +# ReorderSubscriptionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SubscriptionID` | *int64* | :heavy_check_mark: | N/A | | +| `After` | **int64* | :heavy_minus_sign: | The subscription to move this sub after. If missing will insert at the beginning of the list | | \ No newline at end of file diff --git a/docs/models/operations/reordersubscriptionresponse.md b/docs/models/operations/reordersubscriptionresponse.md new file mode 100644 index 0000000..acdffee --- /dev/null +++ b/docs/models/operations/reordersubscriptionresponse.md @@ -0,0 +1,11 @@ +# ReorderSubscriptionResponse + + +## 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 | +| `MediaContainerWithSubscription` | [*components.MediaContainerWithSubscription](../../models/components/mediacontainerwithsubscription.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/reportglobals.md b/docs/models/operations/reportglobals.md new file mode 100644 index 0000000..33ca5ac --- /dev/null +++ b/docs/models/operations/reportglobals.md @@ -0,0 +1,18 @@ +# ReportGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/reportrequest.md b/docs/models/operations/reportrequest.md new file mode 100644 index 0000000..e0a050f --- /dev/null +++ b/docs/models/operations/reportrequest.md @@ -0,0 +1,33 @@ +# ReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Key` | **string* | :heavy_minus_sign: | The details key for the item. | /foo | +| `RatingKey` | **string* | :heavy_minus_sign: | The rating key attribute for the item. | xyz | +| `State` | [*operations.State](../../models/operations/state.md) | :heavy_minus_sign: | The current state of the media. | playing | +| `PlayQueueItemID` | **string* | :heavy_minus_sign: | If playing media from a play queue, the play queue's ID. | 123 | +| `Time` | **int64* | :heavy_minus_sign: | The current time offset of playback in ms. | 0 | +| `Duration` | **int64* | :heavy_minus_sign: | The total duration of the item in ms. | 10000 | +| `Continuing` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | When state is `stopped`, a flag indicating whether or not the client is going to continue playing anothe item. | 1 | +| `Updated` | **int64* | :heavy_minus_sign: | Used when a sync client comes online and is syncing media timelines, holds the time at which the playback state was last updated. | 14200000 | +| `Offline` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Also used by sync clients, used to indicate that a timeline is being synced from being offline, as opposed to being "live". | 1 | +| `TimeToFirstFrame` | **int64* | :heavy_minus_sign: | Time in seconds till first frame is displayed. Sent only on the first playing timeline request. | 1000 | +| `TimeStalled` | **int64* | :heavy_minus_sign: | Time in seconds spent buffering since last request. | 1000 | +| `Bandwidth` | **int64* | :heavy_minus_sign: | Bandwidth in kbps as estimated by the client. | 100 | +| `BufferedTime` | **int64* | :heavy_minus_sign: | Amount of time in seconds buffered by client. Omit if computed by `bufferedSize` below. | 100 | +| `BufferedSize` | **int64* | :heavy_minus_sign: | Size in kilobytes of data buffered by client. Omit if computed by `bufferedTime` above | 1024 | +| `XPlexSessionIdentifier` | **string* | :heavy_minus_sign: | Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) | | \ No newline at end of file diff --git a/docs/models/operations/reportresponse.md b/docs/models/operations/reportresponse.md new file mode 100644 index 0000000..f961eaf --- /dev/null +++ b/docs/models/operations/reportresponse.md @@ -0,0 +1,11 @@ +# ReportResponse + + +## 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.ReportResponseBody](../../models/operations/reportresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/reportresponsebody.md b/docs/models/operations/reportresponsebody.md new file mode 100644 index 0000000..013d58a --- /dev/null +++ b/docs/models/operations/reportresponsebody.md @@ -0,0 +1,10 @@ +# ReportResponseBody + +OK + + +## 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/resetplayqueueglobals.md b/docs/models/operations/resetplayqueueglobals.md new file mode 100644 index 0000000..631dfcd --- /dev/null +++ b/docs/models/operations/resetplayqueueglobals.md @@ -0,0 +1,18 @@ +# ResetPlayQueueGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/resetplayqueuerequest.md b/docs/models/operations/resetplayqueuerequest.md new file mode 100644 index 0000000..f41e849 --- /dev/null +++ b/docs/models/operations/resetplayqueuerequest.md @@ -0,0 +1,19 @@ +# ResetPlayQueueRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | \ No newline at end of file diff --git a/docs/models/operations/resetplayqueueresponse.md b/docs/models/operations/resetplayqueueresponse.md new file mode 100644 index 0000000..e1a1fe8 --- /dev/null +++ b/docs/models/operations/resetplayqueueresponse.md @@ -0,0 +1,11 @@ +# ResetPlayQueueResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/resetsectiondefaultsglobals.md b/docs/models/operations/resetsectiondefaultsglobals.md new file mode 100644 index 0000000..002a6f5 --- /dev/null +++ b/docs/models/operations/resetsectiondefaultsglobals.md @@ -0,0 +1,18 @@ +# ResetSectionDefaultsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/resetsectiondefaultsrequest.md b/docs/models/operations/resetsectiondefaultsrequest.md new file mode 100644 index 0000000..003fabc --- /dev/null +++ b/docs/models/operations/resetsectiondefaultsrequest.md @@ -0,0 +1,19 @@ +# ResetSectionDefaultsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to reorder | | \ No newline at end of file diff --git a/docs/models/operations/resetsectiondefaultsresponse.md b/docs/models/operations/resetsectiondefaultsresponse.md new file mode 100644 index 0000000..1e2cc86 --- /dev/null +++ b/docs/models/operations/resetsectiondefaultsresponse.md @@ -0,0 +1,10 @@ +# ResetSectionDefaultsResponse + + +## 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 deleted file mode 100644 index 224469e..0000000 --- a/docs/models/operations/responsebody.md +++ /dev/null @@ -1,13 +0,0 @@ -# ResponseBody - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `Identifier` | *string* | :heavy_check_mark: | N/A | tv.plex.sonos | -| `BaseURL` | *string* | :heavy_check_mark: | N/A | https://sonos.plex.tv | -| `Title` | *string* | :heavy_check_mark: | N/A | Sonos | -| `LinkURL` | *string* | :heavy_check_mark: | N/A | https://sonos.plex.tv/link | -| `Provides` | *string* | :heavy_check_mark: | N/A | client,player | -| `Token` | *string* | :heavy_check_mark: | The plex authtoken used to identify with | | \ No newline at end of file diff --git a/docs/models/operations/restartprocessingdownloadqueueitemsglobals.md b/docs/models/operations/restartprocessingdownloadqueueitemsglobals.md new file mode 100644 index 0000000..b95a473 --- /dev/null +++ b/docs/models/operations/restartprocessingdownloadqueueitemsglobals.md @@ -0,0 +1,18 @@ +# RestartProcessingDownloadQueueItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/restartprocessingdownloadqueueitemsrequest.md b/docs/models/operations/restartprocessingdownloadqueueitemsrequest.md new file mode 100644 index 0000000..4fcf4ff --- /dev/null +++ b/docs/models/operations/restartprocessingdownloadqueueitemsrequest.md @@ -0,0 +1,20 @@ +# RestartProcessingDownloadQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `QueueID` | *int64* | :heavy_check_mark: | The queue id | | +| `ItemID` | []*int64* | :heavy_check_mark: | The item ids | [
32,
345,
23
] | \ No newline at end of file diff --git a/docs/models/operations/restartprocessingdownloadqueueitemsresponse.md b/docs/models/operations/restartprocessingdownloadqueueitemsresponse.md new file mode 100644 index 0000000..a0022a1 --- /dev/null +++ b/docs/models/operations/restartprocessingdownloadqueueitemsresponse.md @@ -0,0 +1,10 @@ +# RestartProcessingDownloadQueueItemsResponse + + +## 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/restricted.md b/docs/models/operations/restricted.md deleted file mode 100644 index 861f407..0000000 --- a/docs/models/operations/restricted.md +++ /dev/null @@ -1,11 +0,0 @@ -# Restricted - -Indicates if the user has restricted access. - - -## Values - -| Name | Value | -| ------------------- | ------------------- | -| `RestrictedDisable` | 0 | -| `RestrictedEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/role.md b/docs/models/operations/role.md deleted file mode 100644 index fbad285..0000000 --- a/docs/models/operations/role.md +++ /dev/null @@ -1,13 +0,0 @@ -# Role - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | The unique identifier for the role.
NOTE: This is different for each Plex server and is not globally unique.
| 126522 | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. | actor=126522 | -| `Tag` | *string* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller | -| `TagKey` | *string* | :heavy_check_mark: | A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification.
NOTE: This is globally unique across all Plex Servers.
| 5d77683d85719b001f3a535e | -| `Role` | **string* | :heavy_minus_sign: | The role played by the actor in the media item. | Self - Judge | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the actor. | https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg | \ No newline at end of file diff --git a/docs/models/operations/scanglobals.md b/docs/models/operations/scanglobals.md new file mode 100644 index 0000000..41cc03b --- /dev/null +++ b/docs/models/operations/scanglobals.md @@ -0,0 +1,18 @@ +# ScanGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/scanrequest.md b/docs/models/operations/scanrequest.md new file mode 100644 index 0000000..4ff3c24 --- /dev/null +++ b/docs/models/operations/scanrequest.md @@ -0,0 +1,20 @@ +# ScanRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | +| `Source` | **string* | :heavy_minus_sign: | A valid source for the scan | Cable | \ No newline at end of file diff --git a/docs/models/operations/scanresponse.md b/docs/models/operations/scanresponse.md new file mode 100644 index 0000000..1de7e39 --- /dev/null +++ b/docs/models/operations/scanresponse.md @@ -0,0 +1,12 @@ +# ScanResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/scope.md b/docs/models/operations/scope.md index 40d9585..1216a42 100644 --- a/docs/models/operations/scope.md +++ b/docs/models/operations/scope.md @@ -1,6 +1,6 @@ # Scope -`all` - This is the only supported `scope` parameter. +The value `all` is the only supported `scope` parameter. ## Values diff --git a/docs/models/operations/searchhubsglobals.md b/docs/models/operations/searchhubsglobals.md new file mode 100644 index 0000000..720261a --- /dev/null +++ b/docs/models/operations/searchhubsglobals.md @@ -0,0 +1,18 @@ +# SearchHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/searchhubsmediacontainer.md b/docs/models/operations/searchhubsmediacontainer.md new file mode 100644 index 0000000..9ee9967 --- /dev/null +++ b/docs/models/operations/searchhubsmediacontainer.md @@ -0,0 +1,17 @@ +# SearchHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/searchhubsrequest.md b/docs/models/operations/searchhubsrequest.md new file mode 100644 index 0000000..26fc569 --- /dev/null +++ b/docs/models/operations/searchhubsrequest.md @@ -0,0 +1,21 @@ +# SearchHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Query` | *string* | :heavy_check_mark: | The query term | | +| `SectionID` | **int64* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs. | 1 | +| `Limit` | **int64* | :heavy_minus_sign: | The number of items to return per hub. 3 if not specified | | \ No newline at end of file diff --git a/docs/models/operations/searchhubsresponse.md b/docs/models/operations/searchhubsresponse.md new file mode 100644 index 0000000..53f6cc6 --- /dev/null +++ b/docs/models/operations/searchhubsresponse.md @@ -0,0 +1,12 @@ +# SearchHubsResponse + + +## 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.SearchHubsResponseBody](../../models/operations/searchhubsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/searchhubsresponsebody.md b/docs/models/operations/searchhubsresponsebody.md new file mode 100644 index 0000000..6c35a08 --- /dev/null +++ b/docs/models/operations/searchhubsresponsebody.md @@ -0,0 +1,10 @@ +# SearchHubsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.SearchHubsMediaContainer](../../models/operations/searchhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/searchresult.md b/docs/models/operations/searchresult.md deleted file mode 100644 index 5153270..0000000 --- a/docs/models/operations/searchresult.md +++ /dev/null @@ -1,10 +0,0 @@ -# SearchResult - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `Score` | *float32* | :heavy_check_mark: | The score of the search result, typically a float value between 0 and 1. | 0.92 | -| `Directory` | [*operations.GetSearchAllLibrariesDirectory](../../models/operations/getsearchalllibrariesdirectory.md) | :heavy_minus_sign: | N/A | | -| `Metadata` | [*operations.GetSearchAllLibrariesMetadata](../../models/operations/getsearchalllibrariesmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/searchtypes.md b/docs/models/operations/searchtypes.md deleted file mode 100644 index be57f3c..0000000 --- a/docs/models/operations/searchtypes.md +++ /dev/null @@ -1,12 +0,0 @@ -# SearchTypes - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `SearchTypesMovies` | movies | -| `SearchTypesMusic` | music | -| `SearchTypesOtherVideos` | otherVideos | -| `SearchTypesPeople` | people | -| `SearchTypesTv` | tv | \ No newline at end of file diff --git a/docs/models/operations/server.md b/docs/models/operations/server.md deleted file mode 100644 index 8cc2dba..0000000 --- a/docs/models/operations/server.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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/services.md b/docs/models/operations/services.md deleted file mode 100644 index ba36c7a..0000000 --- a/docs/models/operations/services.md +++ /dev/null @@ -1,12 +0,0 @@ -# Services - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Identifier` | *string* | :heavy_check_mark: | N/A | metadata-dev | -| `Endpoint` | *string* | :heavy_check_mark: | N/A | https://epg.provider.plex.tv | -| `Token` | *string* | :heavy_check_mark: | N/A | DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv | -| `Secret` | *string* | :heavy_check_mark: | N/A | | -| `Status` | [operations.GetTokenDetailsStatus](../../models/operations/gettokendetailsstatus.md) | :heavy_check_mark: | N/A | online | \ No newline at end of file diff --git a/docs/models/operations/session.md b/docs/models/operations/session.md deleted file mode 100644 index 8e1f5eb..0000000 --- a/docs/models/operations/session.md +++ /dev/null @@ -1,10 +0,0 @@ -# Session - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | -| `ID` | **string* | :heavy_minus_sign: | N/A | 93h7e00ncblxncqw9lkfaoxi | -| `Bandwidth` | **int* | :heavy_minus_sign: | N/A | 1050 | -| `Location` | **string* | :heavy_minus_sign: | N/A | lan | \ No newline at end of file diff --git a/docs/models/operations/setchannelmapglobals.md b/docs/models/operations/setchannelmapglobals.md new file mode 100644 index 0000000..47f0112 --- /dev/null +++ b/docs/models/operations/setchannelmapglobals.md @@ -0,0 +1,18 @@ +# SetChannelmapGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setchannelmaprequest.md b/docs/models/operations/setchannelmaprequest.md new file mode 100644 index 0000000..68c7562 --- /dev/null +++ b/docs/models/operations/setchannelmaprequest.md @@ -0,0 +1,22 @@ +# SetChannelmapRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | +| `ChannelMapping` | [*operations.ChannelMapping](../../models/operations/channelmapping.md) | :heavy_minus_sign: | The mapping of changes, passed as a map of device channel to lineup VCN. | {
"46.3": 2,
"48.9": 4
} | +| `ChannelMappingByKey` | [*operations.ChannelMappingByKey](../../models/operations/channelmappingbykey.md) | :heavy_minus_sign: | The mapping of changes, passed as a map of device channel to lineup key. | {
"46.3": "5cc83d73af4a72001e9b16d7-5cab3c634df507001fefcad0",
"48.9": "5cc83d73af4a72001e9b16d7-5cab3c63ec158a001d32db8d"
} | +| `ChannelsEnabled` | []*string* | :heavy_minus_sign: | The channels which are enabled. | 46.1,44.1,45.1 | \ No newline at end of file diff --git a/docs/models/operations/setchannelmapresponse.md b/docs/models/operations/setchannelmapresponse.md new file mode 100644 index 0000000..f4022b8 --- /dev/null +++ b/docs/models/operations/setchannelmapresponse.md @@ -0,0 +1,11 @@ +# SetChannelmapResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/setdevicepreferencesglobals.md b/docs/models/operations/setdevicepreferencesglobals.md new file mode 100644 index 0000000..294a932 --- /dev/null +++ b/docs/models/operations/setdevicepreferencesglobals.md @@ -0,0 +1,18 @@ +# SetDevicePreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setdevicepreferencesrequest.md b/docs/models/operations/setdevicepreferencesrequest.md new file mode 100644 index 0000000..7526795 --- /dev/null +++ b/docs/models/operations/setdevicepreferencesrequest.md @@ -0,0 +1,20 @@ +# SetDevicePreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | +| `Name` | **string* | :heavy_minus_sign: | The preference names and values. | | \ No newline at end of file diff --git a/docs/models/operations/setdevicepreferencesresponse.md b/docs/models/operations/setdevicepreferencesresponse.md new file mode 100644 index 0000000..3009b67 --- /dev/null +++ b/docs/models/operations/setdevicepreferencesresponse.md @@ -0,0 +1,10 @@ +# SetDevicePreferencesResponse + + +## 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/setdvrpreferencesdvr.md b/docs/models/operations/setdvrpreferencesdvr.md new file mode 100644 index 0000000..1fcd165 --- /dev/null +++ b/docs/models/operations/setdvrpreferencesdvr.md @@ -0,0 +1,12 @@ +# SetDVRPreferencesDVR + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Device` | [][components.Device](../../models/components/device.md) | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Language` | **string* | :heavy_minus_sign: | N/A | +| `Lineup` | **string* | :heavy_minus_sign: | N/A | +| `UUID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/setdvrpreferencesdvrsmediacontainer.md b/docs/models/operations/setdvrpreferencesdvrsmediacontainer.md new file mode 100644 index 0000000..a6c2649 --- /dev/null +++ b/docs/models/operations/setdvrpreferencesdvrsmediacontainer.md @@ -0,0 +1,17 @@ +# SetDVRPreferencesDVRsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Status` | **int64* | :heavy_minus_sign: | A status indicator. If present and non-zero, indicates an error | \ No newline at end of file diff --git a/docs/models/operations/setdvrpreferencesglobals.md b/docs/models/operations/setdvrpreferencesglobals.md new file mode 100644 index 0000000..f1c4362 --- /dev/null +++ b/docs/models/operations/setdvrpreferencesglobals.md @@ -0,0 +1,18 @@ +# SetDVRPreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setdvrpreferencesmediacontainer.md b/docs/models/operations/setdvrpreferencesmediacontainer.md new file mode 100644 index 0000000..2b0772e --- /dev/null +++ b/docs/models/operations/setdvrpreferencesmediacontainer.md @@ -0,0 +1,9 @@ +# SetDVRPreferencesMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.SetDVRPreferencesDVRsMediaContainer](../../models/operations/setdvrpreferencesdvrsmediacontainer.md) | :heavy_minus_sign: | N/A | +| `Dvr` | [][operations.SetDVRPreferencesDVR](../../models/operations/setdvrpreferencesdvr.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/setdvrpreferencesrequest.md b/docs/models/operations/setdvrpreferencesrequest.md new file mode 100644 index 0000000..6180377 --- /dev/null +++ b/docs/models/operations/setdvrpreferencesrequest.md @@ -0,0 +1,20 @@ +# SetDVRPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | +| `Name` | **string* | :heavy_minus_sign: | Set the `name` preference to the provided value | | \ No newline at end of file diff --git a/docs/models/operations/setdvrpreferencesresponse.md b/docs/models/operations/setdvrpreferencesresponse.md new file mode 100644 index 0000000..342a968 --- /dev/null +++ b/docs/models/operations/setdvrpreferencesresponse.md @@ -0,0 +1,12 @@ +# SetDVRPreferencesResponse + + +## 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.SetDVRPreferencesResponseBody](../../models/operations/setdvrpreferencesresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/setdvrpreferencesresponsebody.md b/docs/models/operations/setdvrpreferencesresponsebody.md new file mode 100644 index 0000000..d0e05ab --- /dev/null +++ b/docs/models/operations/setdvrpreferencesresponsebody.md @@ -0,0 +1,10 @@ +# SetDVRPreferencesResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.SetDVRPreferencesMediaContainer](../../models/operations/setdvrpreferencesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/setitemartworkglobals.md b/docs/models/operations/setitemartworkglobals.md new file mode 100644 index 0000000..0148596 --- /dev/null +++ b/docs/models/operations/setitemartworkglobals.md @@ -0,0 +1,18 @@ +# SetItemArtworkGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setitemartworkrequest.md b/docs/models/operations/setitemartworkrequest.md new file mode 100644 index 0000000..8c1f6ca --- /dev/null +++ b/docs/models/operations/setitemartworkrequest.md @@ -0,0 +1,21 @@ +# SetItemArtworkRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Element` | [operations.Element](../../models/operations/element.md) | :heavy_check_mark: | N/A | | +| `URL` | **string* | :heavy_minus_sign: | The url of the new asset. If not provided, the binary of the asset must be provided in the post body. | | \ No newline at end of file diff --git a/docs/models/operations/setitemartworkresponse.md b/docs/models/operations/setitemartworkresponse.md new file mode 100644 index 0000000..f1903ed --- /dev/null +++ b/docs/models/operations/setitemartworkresponse.md @@ -0,0 +1,10 @@ +# SetItemArtworkResponse + + +## 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/setitempreferencesglobals.md b/docs/models/operations/setitempreferencesglobals.md new file mode 100644 index 0000000..6ab2801 --- /dev/null +++ b/docs/models/operations/setitempreferencesglobals.md @@ -0,0 +1,18 @@ +# SetItemPreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setitempreferencesrequest.md b/docs/models/operations/setitempreferencesrequest.md new file mode 100644 index 0000000..0b6c553 --- /dev/null +++ b/docs/models/operations/setitempreferencesrequest.md @@ -0,0 +1,20 @@ +# SetItemPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Args` | [*operations.QueryParamArgs](../../models/operations/queryparamargs.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/setitempreferencesresponse.md b/docs/models/operations/setitempreferencesresponse.md new file mode 100644 index 0000000..92417e3 --- /dev/null +++ b/docs/models/operations/setitempreferencesresponse.md @@ -0,0 +1,10 @@ +# SetItemPreferencesResponse + + +## 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/setpreferencesglobals.md b/docs/models/operations/setpreferencesglobals.md new file mode 100644 index 0000000..938a5a1 --- /dev/null +++ b/docs/models/operations/setpreferencesglobals.md @@ -0,0 +1,18 @@ +# SetPreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setpreferencesrequest.md b/docs/models/operations/setpreferencesrequest.md new file mode 100644 index 0000000..8211cff --- /dev/null +++ b/docs/models/operations/setpreferencesrequest.md @@ -0,0 +1,19 @@ +# SetPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Prefs` | [operations.Prefs](../../models/operations/prefs.md) | :heavy_check_mark: | N/A | {
"FriendlyName": "My Server",
"ScheduledLibraryUpdateInterval": 3600,
"sendCrashReports": 1
} | \ No newline at end of file diff --git a/docs/models/operations/setpreferencesresponse.md b/docs/models/operations/setpreferencesresponse.md new file mode 100644 index 0000000..67d7dac --- /dev/null +++ b/docs/models/operations/setpreferencesresponse.md @@ -0,0 +1,10 @@ +# SetPreferencesResponse + + +## 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/setratingglobals.md b/docs/models/operations/setratingglobals.md new file mode 100644 index 0000000..361f2f8 --- /dev/null +++ b/docs/models/operations/setratingglobals.md @@ -0,0 +1,18 @@ +# SetRatingGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setratingrequest.md b/docs/models/operations/setratingrequest.md new file mode 100644 index 0000000..974b84f --- /dev/null +++ b/docs/models/operations/setratingrequest.md @@ -0,0 +1,22 @@ +# SetRatingRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Identifier` | *string* | :heavy_check_mark: | The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library` | | +| `Key` | *string* | :heavy_check_mark: | The key of the item to rate. This is the `ratingKey` found in metadata items | | +| `Rating` | *float64* | :heavy_check_mark: | The rating to give the item. | | +| `RatedAt` | **int64* | :heavy_minus_sign: | The time when the rating occurred. If not present, interpreted as now. | | \ No newline at end of file diff --git a/docs/models/operations/setratingresponse.md b/docs/models/operations/setratingresponse.md new file mode 100644 index 0000000..e3c8b03 --- /dev/null +++ b/docs/models/operations/setratingresponse.md @@ -0,0 +1,10 @@ +# SetRatingResponse + + +## 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/setsectionpreferencesglobals.md b/docs/models/operations/setsectionpreferencesglobals.md new file mode 100644 index 0000000..8ed6bd8 --- /dev/null +++ b/docs/models/operations/setsectionpreferencesglobals.md @@ -0,0 +1,18 @@ +# SetSectionPreferencesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setsectionpreferencesqueryparamprefs.md b/docs/models/operations/setsectionpreferencesqueryparamprefs.md new file mode 100644 index 0000000..e70d4d6 --- /dev/null +++ b/docs/models/operations/setsectionpreferencesqueryparamprefs.md @@ -0,0 +1,7 @@ +# SetSectionPreferencesQueryParamPrefs + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/setsectionpreferencesrequest.md b/docs/models/operations/setsectionpreferencesrequest.md new file mode 100644 index 0000000..cc78db9 --- /dev/null +++ b/docs/models/operations/setsectionpreferencesrequest.md @@ -0,0 +1,20 @@ +# SetSectionPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | +| `Prefs` | [operations.SetSectionPreferencesQueryParamPrefs](../../models/operations/setsectionpreferencesqueryparamprefs.md) | :heavy_check_mark: | N/A | {
"enableCinemaTrailers": 1,
"hidden": 0
} | \ No newline at end of file diff --git a/docs/models/operations/setsectionpreferencesresponse.md b/docs/models/operations/setsectionpreferencesresponse.md new file mode 100644 index 0000000..2134490 --- /dev/null +++ b/docs/models/operations/setsectionpreferencesresponse.md @@ -0,0 +1,10 @@ +# SetSectionPreferencesResponse + + +## 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/setstreamoffsetglobals.md b/docs/models/operations/setstreamoffsetglobals.md new file mode 100644 index 0000000..be5d6f5 --- /dev/null +++ b/docs/models/operations/setstreamoffsetglobals.md @@ -0,0 +1,18 @@ +# SetStreamOffsetGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setstreamoffsetrequest.md b/docs/models/operations/setstreamoffsetrequest.md new file mode 100644 index 0000000..60a96f6 --- /dev/null +++ b/docs/models/operations/setstreamoffsetrequest.md @@ -0,0 +1,21 @@ +# SetStreamOffsetRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `StreamID` | *int64* | :heavy_check_mark: | The id of the stream | | +| `Ext` | *string* | :heavy_check_mark: | This is not a part of this endpoint but documented here to satisfy OpenAPI | | +| `Offset` | **int64* | :heavy_minus_sign: | The offest in ms | | \ No newline at end of file diff --git a/docs/models/operations/setstreamoffsetresponse.md b/docs/models/operations/setstreamoffsetresponse.md new file mode 100644 index 0000000..823d8f3 --- /dev/null +++ b/docs/models/operations/setstreamoffsetresponse.md @@ -0,0 +1,10 @@ +# SetStreamOffsetResponse + + +## 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/setstreamselectionglobals.md b/docs/models/operations/setstreamselectionglobals.md new file mode 100644 index 0000000..0cf5e33 --- /dev/null +++ b/docs/models/operations/setstreamselectionglobals.md @@ -0,0 +1,18 @@ +# SetStreamSelectionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/setstreamselectionrequest.md b/docs/models/operations/setstreamselectionrequest.md new file mode 100644 index 0000000..61cb609 --- /dev/null +++ b/docs/models/operations/setstreamselectionrequest.md @@ -0,0 +1,22 @@ +# SetStreamSelectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PartID` | *int64* | :heavy_check_mark: | The id of the part to select streams on | | +| `AudioStreamID` | **int64* | :heavy_minus_sign: | The id of the audio stream to select in this part | | +| `SubtitleStreamID` | **int64* | :heavy_minus_sign: | The id of the subtitle stream to select in this part. Specify 0 to select no subtitle | | +| `AllParts` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Perform the same for all parts of this media selecting similar streams in each | 1 | \ No newline at end of file diff --git a/docs/models/operations/setstreamselectionresponse.md b/docs/models/operations/setstreamselectionresponse.md new file mode 100644 index 0000000..cbb2315 --- /dev/null +++ b/docs/models/operations/setstreamselectionresponse.md @@ -0,0 +1,10 @@ +# SetStreamSelectionResponse + + +## 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/setting.md b/docs/models/operations/setting.md deleted file mode 100644 index be84858..0000000 --- a/docs/models/operations/setting.md +++ /dev/null @@ -1,17 +0,0 @@ -# Setting - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | EnableDatabaseTrace | -| `Label` | **string* | :heavy_minus_sign: | N/A | | -| `Summary` | **string* | :heavy_minus_sign: | N/A | | -| `Type` | **string* | :heavy_minus_sign: | N/A | bool | -| `Default` | **bool* | :heavy_minus_sign: | N/A | false | -| `Value` | **bool* | :heavy_minus_sign: | N/A | false | -| `Hidden` | **bool* | :heavy_minus_sign: | N/A | true | -| `Advanced` | **bool* | :heavy_minus_sign: | N/A | false | -| `Group` | **string* | :heavy_minus_sign: | N/A | | -| `EnumValues` | **string* | :heavy_minus_sign: | N/A | 1:admin only\|2:everyone | \ No newline at end of file diff --git a/docs/models/operations/sharedservers.md b/docs/models/operations/sharedservers.md deleted file mode 100644 index d787f3b..0000000 --- a/docs/models/operations/sharedservers.md +++ /dev/null @@ -1,7 +0,0 @@ -# SharedServers - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/sharedsources.md b/docs/models/operations/sharedsources.md deleted file mode 100644 index ca74299..0000000 --- a/docs/models/operations/sharedsources.md +++ /dev/null @@ -1,7 +0,0 @@ -# SharedSources - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/showordering.md b/docs/models/operations/showordering.md deleted file mode 100644 index 4d4a6b6..0000000 --- a/docs/models/operations/showordering.md +++ /dev/null @@ -1,21 +0,0 @@ -# ShowOrdering - -Setting that indicates the episode ordering for the show. -Options: - - None = Library default - - tmdbAiring = The Movie Database (Aired) - - aired = TheTVDB (Aired) - - dvd = TheTVDB (DVD) - - absolute = TheTVDB (Absolute) - - - -## Values - -| Name | Value | -| -------------------------- | -------------------------- | -| `ShowOrderingNone` | None | -| `ShowOrderingTmdbAiring` | tmdbAiring | -| `ShowOrderingTvdbAired` | aired | -| `ShowOrderingTvdbDvd` | dvd | -| `ShowOrderingTvdbAbsolute` | absolute | \ No newline at end of file diff --git a/docs/models/operations/shuffleglobals.md b/docs/models/operations/shuffleglobals.md new file mode 100644 index 0000000..407c67e --- /dev/null +++ b/docs/models/operations/shuffleglobals.md @@ -0,0 +1,18 @@ +# ShuffleGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/shufflerequest.md b/docs/models/operations/shufflerequest.md new file mode 100644 index 0000000..a5e5955 --- /dev/null +++ b/docs/models/operations/shufflerequest.md @@ -0,0 +1,19 @@ +# ShuffleRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | \ No newline at end of file diff --git a/docs/models/operations/shuffleresponse.md b/docs/models/operations/shuffleresponse.md new file mode 100644 index 0000000..85eb510 --- /dev/null +++ b/docs/models/operations/shuffleresponse.md @@ -0,0 +1,11 @@ +# ShuffleResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/similar.md b/docs/models/operations/similar.md deleted file mode 100644 index 9c68315..0000000 --- a/docs/models/operations/similar.md +++ /dev/null @@ -1,12 +0,0 @@ -# Similar - -The display tag for the similar item, typically the title. - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------- | --------------------- | --------------------- | --------------------- | --------------------- | -| `ID` | *int* | :heavy_check_mark: | N/A | 259 | -| `Filter` | *string* | :heavy_check_mark: | N/A | similar=259 | -| `Tag` | *string* | :heavy_check_mark: | N/A | Criss Angel Mindfreak | \ No newline at end of file diff --git a/docs/models/operations/skip.md b/docs/models/operations/skip.md deleted file mode 100644 index 8338409..0000000 --- a/docs/models/operations/skip.md +++ /dev/null @@ -1,11 +0,0 @@ -# Skip - -Indicate that the latest version should be marked as skipped. The [Release] 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 deleted file mode 100644 index a090f94..0000000 --- a/docs/models/operations/smart.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/sort.md b/docs/models/operations/sort.md deleted file mode 100644 index fdb5411..0000000 --- a/docs/models/operations/sort.md +++ /dev/null @@ -1,15 +0,0 @@ -# Sort - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Default` | **string* | :heavy_minus_sign: | N/A | asc | -| `Active` | **bool* | :heavy_minus_sign: | N/A | false | -| `ActiveDirection` | [*operations.ActiveDirection](../../models/operations/activedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DefaultDirection` | [*operations.DefaultDirection](../../models/operations/defaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | -| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc | -| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | -| `Key` | *string* | :heavy_check_mark: | N/A | titleSort | -| `Title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/models/operations/splititemglobals.md b/docs/models/operations/splititemglobals.md new file mode 100644 index 0000000..e0142c7 --- /dev/null +++ b/docs/models/operations/splititemglobals.md @@ -0,0 +1,18 @@ +# SplitItemGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/splititemrequest.md b/docs/models/operations/splititemrequest.md new file mode 100644 index 0000000..833d3c9 --- /dev/null +++ b/docs/models/operations/splititemrequest.md @@ -0,0 +1,19 @@ +# SplitItemRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/splititemresponse.md b/docs/models/operations/splititemresponse.md new file mode 100644 index 0000000..68d86e4 --- /dev/null +++ b/docs/models/operations/splititemresponse.md @@ -0,0 +1,10 @@ +# SplitItemResponse + + +## 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/startalltasksresponse.md b/docs/models/operations/startalltasksresponse.md deleted file mode 100644 index d1eccb1..0000000 --- a/docs/models/operations/startalltasksresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/startanalysisglobals.md b/docs/models/operations/startanalysisglobals.md new file mode 100644 index 0000000..163e65e --- /dev/null +++ b/docs/models/operations/startanalysisglobals.md @@ -0,0 +1,18 @@ +# StartAnalysisGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/startanalysisrequest.md b/docs/models/operations/startanalysisrequest.md new file mode 100644 index 0000000..e09685c --- /dev/null +++ b/docs/models/operations/startanalysisrequest.md @@ -0,0 +1,19 @@ +# StartAnalysisRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | Section identifier | | \ No newline at end of file diff --git a/docs/models/operations/startanalysisresponse.md b/docs/models/operations/startanalysisresponse.md new file mode 100644 index 0000000..c892b8b --- /dev/null +++ b/docs/models/operations/startanalysisresponse.md @@ -0,0 +1,10 @@ +# StartAnalysisResponse + + +## 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/startbifgenerationglobals.md b/docs/models/operations/startbifgenerationglobals.md new file mode 100644 index 0000000..e7b6c20 --- /dev/null +++ b/docs/models/operations/startbifgenerationglobals.md @@ -0,0 +1,18 @@ +# StartBifGenerationGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/startbifgenerationrequest.md b/docs/models/operations/startbifgenerationrequest.md new file mode 100644 index 0000000..dada75b --- /dev/null +++ b/docs/models/operations/startbifgenerationrequest.md @@ -0,0 +1,20 @@ +# StartBifGenerationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Force` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/startbifgenerationresponse.md b/docs/models/operations/startbifgenerationresponse.md new file mode 100644 index 0000000..53ddce7 --- /dev/null +++ b/docs/models/operations/startbifgenerationresponse.md @@ -0,0 +1,10 @@ +# StartBifGenerationResponse + + +## 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/starttaskglobals.md b/docs/models/operations/starttaskglobals.md new file mode 100644 index 0000000..d84fa98 --- /dev/null +++ b/docs/models/operations/starttaskglobals.md @@ -0,0 +1,18 @@ +# StartTaskGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/starttaskrequest.md b/docs/models/operations/starttaskrequest.md index 1be0bc7..b28e9a9 100644 --- a/docs/models/operations/starttaskrequest.md +++ b/docs/models/operations/starttaskrequest.md @@ -3,6 +3,17 @@ ## 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 +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Task` | [operations.PathParamTask](../../models/operations/pathparamtask.md) | :heavy_check_mark: | The task name | | \ No newline at end of file diff --git a/docs/models/operations/starttasksresponse.md b/docs/models/operations/starttasksresponse.md new file mode 100644 index 0000000..45bc4ce --- /dev/null +++ b/docs/models/operations/starttasksresponse.md @@ -0,0 +1,10 @@ +# StartTasksResponse + + +## 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/starttranscodesessionglobals.md b/docs/models/operations/starttranscodesessionglobals.md new file mode 100644 index 0000000..368fbac --- /dev/null +++ b/docs/models/operations/starttranscodesessionglobals.md @@ -0,0 +1,18 @@ +# StartTranscodeSessionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/starttranscodesessionqueryparamlocation.md b/docs/models/operations/starttranscodesessionqueryparamlocation.md new file mode 100644 index 0000000..6c22bf6 --- /dev/null +++ b/docs/models/operations/starttranscodesessionqueryparamlocation.md @@ -0,0 +1,12 @@ +# StartTranscodeSessionQueryParamLocation + +Network type of the client, can be used to help determine target bitrate. + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `StartTranscodeSessionQueryParamLocationLan` | lan | +| `StartTranscodeSessionQueryParamLocationWan` | wan | +| `StartTranscodeSessionQueryParamLocationCellular` | cellular | \ No newline at end of file diff --git a/docs/models/operations/starttranscodesessionqueryparamprotocol.md b/docs/models/operations/starttranscodesessionqueryparamprotocol.md new file mode 100644 index 0000000..7695427 --- /dev/null +++ b/docs/models/operations/starttranscodesessionqueryparamprotocol.md @@ -0,0 +1,13 @@ +# StartTranscodeSessionQueryParamProtocol + +Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + + + +## Values + +| Name | Value | +| --------------------------------------------- | --------------------------------------------- | +| `StartTranscodeSessionQueryParamProtocolHTTP` | http | +| `StartTranscodeSessionQueryParamProtocolHls` | hls | +| `StartTranscodeSessionQueryParamProtocolDash` | dash | \ No newline at end of file diff --git a/docs/models/operations/starttranscodesessionqueryparamsubtitles.md b/docs/models/operations/starttranscodesessionqueryparamsubtitles.md new file mode 100644 index 0000000..8b2e152 --- /dev/null +++ b/docs/models/operations/starttranscodesessionqueryparamsubtitles.md @@ -0,0 +1,17 @@ +# StartTranscodeSessionQueryParamSubtitles + +Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + + + +## Values + +| Name | Value | +| --------------------------------------------------- | --------------------------------------------------- | +| `StartTranscodeSessionQueryParamSubtitlesAuto` | auto | +| `StartTranscodeSessionQueryParamSubtitlesBurn` | burn | +| `StartTranscodeSessionQueryParamSubtitlesNone` | none | +| `StartTranscodeSessionQueryParamSubtitlesSidecar` | sidecar | +| `StartTranscodeSessionQueryParamSubtitlesEmbedded` | embedded | +| `StartTranscodeSessionQueryParamSubtitlesSegmented` | segmented | +| `StartTranscodeSessionQueryParamSubtitlesUnknown` | unknown | \ No newline at end of file diff --git a/docs/models/operations/starttranscodesessionrequest.md b/docs/models/operations/starttranscodesessionrequest.md new file mode 100644 index 0000000..f710ba4 --- /dev/null +++ b/docs/models/operations/starttranscodesessionrequest.md @@ -0,0 +1,50 @@ +# StartTranscodeSessionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `TranscodeType` | [components.TranscodeType](../../models/components/transcodetype.md) | :heavy_check_mark: | Type of transcode media | | +| `TranscodeSessionID` | **string* | :heavy_minus_sign: | Transcode session UUID | | +| `Extension` | [operations.Extension](../../models/operations/extension.md) | :heavy_check_mark: | Extension
| | +| `AdvancedSubtitles` | [*components.AdvancedSubtitles](../../models/components/advancedsubtitles.md) | :heavy_minus_sign: | Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost
| burn | +| `AudioBoost` | **int64* | :heavy_minus_sign: | Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) | 50 | +| `AudioChannelCount` | **int64* | :heavy_minus_sign: | Target video number of audio channels. | 5 | +| `AutoAdjustQuality` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports ABR. | 1 | +| `AutoAdjustSubtitle` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if the server should adjust subtitles based on Voice Activity Data. | 1 | +| `DirectPlay` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct playing the indicated content. | 1 | +| `DirectStream` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the video of the indicated content. | 1 | +| `DirectStreamAudio` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the audio of the indicated content. | 1 | +| `DisableResolutionRotation` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if resolution should be adjusted for orientation. | 1 | +| `HasMDE` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 | 1 | +| `Location` | [*operations.StartTranscodeSessionQueryParamLocation](../../models/operations/starttranscodesessionqueryparamlocation.md) | :heavy_minus_sign: | Network type of the client, can be used to help determine target bitrate. | wan | +| `MediaBufferSize` | **int64* | :heavy_minus_sign: | Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. | 102400 | +| `MediaIndex` | **int64* | :heavy_minus_sign: | Index of the media to transcode. -1 or not specified indicates let the server choose. | 0 | +| `MusicBitrate` | **int64* | :heavy_minus_sign: | Target bitrate for audio only files (in kbps, used to transcode). | 5000 | +| `Offset` | **float64* | :heavy_minus_sign: | Offset from the start of the media (in seconds). | 90.5 | +| `PartIndex` | **int64* | :heavy_minus_sign: | Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode | 0 | +| `Path` | **string* | :heavy_minus_sign: | Internal PMS path of the media to transcode. | /library/metadata/151671 | +| `PeakBitrate` | **int64* | :heavy_minus_sign: | Maximum bitrate (in kbps) to use in ABR. | 12000 | +| `PhotoResolution` | **string* | :heavy_minus_sign: | Target photo resolution. | 1080x1080 | +| `Protocol` | [*operations.StartTranscodeSessionQueryParamProtocol](../../models/operations/starttranscodesessionqueryparamprotocol.md) | :heavy_minus_sign: | Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022)
| dash | +| `SecondsPerSegment` | **int64* | :heavy_minus_sign: | Number of seconds to include in each transcoded segment | 5 | +| `SubtitleSize` | **int64* | :heavy_minus_sign: | Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) | 50 | +| `Subtitles` | [*operations.StartTranscodeSessionQueryParamSubtitles](../../models/operations/starttranscodesessionqueryparamsubtitles.md) | :heavy_minus_sign: | Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream
| Burn | +| `VideoBitrate` | **int64* | :heavy_minus_sign: | Target video bitrate (in kbps). | 12000 | +| `VideoQuality` | **int64* | :heavy_minus_sign: | Target photo quality. | 50 | +| `VideoResolution` | **string* | :heavy_minus_sign: | Target maximum video resolution. | 1080x1080 | +| `XPlexClientProfileExtra` | **string* | :heavy_minus_sign: | See [Profile Augmentations](#section/API-Info/Profile-Augmentations) . | add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash) | +| `XPlexClientProfileName` | **string* | :heavy_minus_sign: | Which built in Client Profile to use in the decision. Generally should only be used to specify the Generic profile. | generic | +| `XPlexSessionIdentifier` | **string* | :heavy_minus_sign: | Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) | | \ No newline at end of file diff --git a/docs/models/operations/starttranscodesessionresponse.md b/docs/models/operations/starttranscodesessionresponse.md new file mode 100644 index 0000000..e1fa5d7 --- /dev/null +++ b/docs/models/operations/starttranscodesessionresponse.md @@ -0,0 +1,11 @@ +# StartTranscodeSessionResponse + + +## 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 | +| `ResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | MPD file (see ISO/IEC 23009-1:2022), m3u8 file (see RFC 8216), or binary http stream | \ No newline at end of file diff --git a/docs/models/operations/startuniversaltranscoderequest.md b/docs/models/operations/startuniversaltranscoderequest.md deleted file mode 100644 index 30c5af9..0000000 --- a/docs/models/operations/startuniversaltranscoderequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# StartUniversalTranscodeRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | 1 | -| `Path` | *string* | :heavy_check_mark: | The path to the media item to transcode | /library/metadata/23409 | -| `MediaIndex` | *float64* | :heavy_check_mark: | The index of the media item to transcode | 0 | -| `PartIndex` | *float64* | :heavy_check_mark: | The index of the part to transcode | 0 | -| `Protocol` | *string* | :heavy_check_mark: | The protocol to use for the transcode session | hls | -| `FastSeek` | **float64* | :heavy_minus_sign: | Whether to use fast seek or not | 0 | -| `DirectPlay` | **float64* | :heavy_minus_sign: | Whether to use direct play or not | 0 | -| `DirectStream` | **float64* | :heavy_minus_sign: | Whether to use direct stream or not | 0 | -| `SubtitleSize` | **float64* | :heavy_minus_sign: | The size of the subtitles | 100 | -| `Subtites` | **string* | :heavy_minus_sign: | The subtitles | burn | -| `AudioBoost` | **float64* | :heavy_minus_sign: | The audio boost | 100 | -| `Location` | **string* | :heavy_minus_sign: | The location of the transcode session | lan | -| `MediaBufferSize` | **float64* | :heavy_minus_sign: | The size of the media buffer | 102400 | -| `Session` | **string* | :heavy_minus_sign: | The session ID | zvcage8b7rkioqcm8f4uns4c | -| `AddDebugOverlay` | **float64* | :heavy_minus_sign: | Whether to add a debug overlay or not | 0 | -| `AutoAdjustQuality` | **float64* | :heavy_minus_sign: | Whether to auto adjust quality or not | 0 | \ No newline at end of file diff --git a/docs/models/operations/startuniversaltranscoderesponse.md b/docs/models/operations/startuniversaltranscoderesponse.md deleted file mode 100644 index 1f5064b..0000000 --- a/docs/models/operations/startuniversaltranscoderesponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 index 93e2776..ce42781 100644 --- a/docs/models/operations/state.md +++ b/docs/models/operations/state.md @@ -1,12 +1,13 @@ # State -The state of the media item +The current state of the media. ## Values -| Name | Value | -| -------------- | -------------- | -| `StatePlaying` | playing | -| `StatePaused` | paused | -| `StateStopped` | stopped | \ No newline at end of file +| Name | Value | +| ---------------- | ---------------- | +| `StateStopped` | stopped | +| `StateBuffering` | buffering | +| `StatePlaying` | playing | +| `StatePaused` | paused | \ No newline at end of file diff --git a/docs/models/operations/statisticsbandwidth.md b/docs/models/operations/statisticsbandwidth.md deleted file mode 100644 index 3585455..0000000 --- a/docs/models/operations/statisticsbandwidth.md +++ /dev/null @@ -1,13 +0,0 @@ -# StatisticsBandwidth - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `AccountID` | **int* | :heavy_minus_sign: | N/A | 238960586 | -| `DeviceID` | **int* | :heavy_minus_sign: | N/A | 208 | -| `Timespan` | **int64* | :heavy_minus_sign: | N/A | 6 | -| `At` | **int* | :heavy_minus_sign: | N/A | 1718387650 | -| `Lan` | **bool* | :heavy_minus_sign: | N/A | true | -| `Bytes` | **int64* | :heavy_minus_sign: | N/A | 22 | \ No newline at end of file diff --git a/docs/models/operations/statisticsmedia.md b/docs/models/operations/statisticsmedia.md deleted file mode 100644 index 119089f..0000000 --- a/docs/models/operations/statisticsmedia.md +++ /dev/null @@ -1,14 +0,0 @@ -# StatisticsMedia - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `AccountID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `DeviceID` | **int* | :heavy_minus_sign: | N/A | 13 | -| `Timespan` | **int* | :heavy_minus_sign: | N/A | 4 | -| `At` | **int* | :heavy_minus_sign: | N/A | 1707141600 | -| `MetadataType` | **int* | :heavy_minus_sign: | N/A | 4 | -| `Count` | **int* | :heavy_minus_sign: | N/A | 1 | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 1555 | \ No newline at end of file diff --git a/docs/models/operations/statisticsresources.md b/docs/models/operations/statisticsresources.md deleted file mode 100644 index 7520831..0000000 --- a/docs/models/operations/statisticsresources.md +++ /dev/null @@ -1,13 +0,0 @@ -# StatisticsResources - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------- | -------------------------- | -------------------------- | -------------------------- | -------------------------- | -| `Timespan` | **int64* | :heavy_minus_sign: | N/A | 6 | -| `At` | **int64* | :heavy_minus_sign: | N/A | 1718384427 | -| `HostCPUUtilization` | **float32* | :heavy_minus_sign: | N/A | 1.276 | -| `ProcessCPUUtilization` | **float32* | :heavy_minus_sign: | N/A | 0.025 | -| `HostMemoryUtilization` | **float32* | :heavy_minus_sign: | N/A | 17.026 | -| `ProcessMemoryUtilization` | **float32* | :heavy_minus_sign: | N/A | 0.493 | \ No newline at end of file diff --git a/docs/models/operations/status.md b/docs/models/operations/status.md index a9d9d40..b9f2ffa 100644 --- a/docs/models/operations/status.md +++ b/docs/models/operations/status.md @@ -1,10 +1,20 @@ # Status -Current friend request status +The state of this queue + - deciding: At least one item is still being decided + - waiting: At least one item is waiting for transcode and none are currently transcoding + - processing: At least one item is being transcoded + - done: All items are available (or potentially expired) + - error: At least one item has encountered an error + ## Values -| Name | Value | -| ---------------- | ---------------- | -| `StatusAccepted` | accepted | \ No newline at end of file +| Name | Value | +| ------------------ | ------------------ | +| `StatusDeciding` | deciding | +| `StatusWaiting` | waiting | +| `StatusProcessing` | processing | +| `StatusDone` | done | +| `StatusError` | error | \ No newline at end of file diff --git a/docs/models/operations/stopallrefreshesresponse.md b/docs/models/operations/stopallrefreshesresponse.md new file mode 100644 index 0000000..517bd5d --- /dev/null +++ b/docs/models/operations/stopallrefreshesresponse.md @@ -0,0 +1,11 @@ +# StopAllRefreshesResponse + + +## 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 | +| `RequestHandlerSlashGetResponses200` | [*components.RequestHandlerSlashGetResponses200](../../models/components/requesthandlerslashgetresponses200.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/stopalltasksresponse.md b/docs/models/operations/stopalltasksresponse.md deleted file mode 100644 index 96f14ee..0000000 --- a/docs/models/operations/stopalltasksresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/stopdvrreloadglobals.md b/docs/models/operations/stopdvrreloadglobals.md new file mode 100644 index 0000000..168a9a3 --- /dev/null +++ b/docs/models/operations/stopdvrreloadglobals.md @@ -0,0 +1,18 @@ +# StopDVRReloadGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/stopdvrreloadrequest.md b/docs/models/operations/stopdvrreloadrequest.md new file mode 100644 index 0000000..5292634 --- /dev/null +++ b/docs/models/operations/stopdvrreloadrequest.md @@ -0,0 +1,19 @@ +# StopDVRReloadRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | \ No newline at end of file diff --git a/docs/models/operations/stopdvrreloadresponse.md b/docs/models/operations/stopdvrreloadresponse.md new file mode 100644 index 0000000..6c71e3f --- /dev/null +++ b/docs/models/operations/stopdvrreloadresponse.md @@ -0,0 +1,10 @@ +# StopDVRReloadResponse + + +## 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/stopscanglobals.md b/docs/models/operations/stopscanglobals.md new file mode 100644 index 0000000..9afdf7b --- /dev/null +++ b/docs/models/operations/stopscanglobals.md @@ -0,0 +1,18 @@ +# StopScanGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/stopscanrequest.md b/docs/models/operations/stopscanrequest.md new file mode 100644 index 0000000..1aa5308 --- /dev/null +++ b/docs/models/operations/stopscanrequest.md @@ -0,0 +1,19 @@ +# StopScanRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DeviceID` | *int64* | :heavy_check_mark: | The ID of the device. | | \ No newline at end of file diff --git a/docs/models/operations/stopscanresponse.md b/docs/models/operations/stopscanresponse.md new file mode 100644 index 0000000..8e61b18 --- /dev/null +++ b/docs/models/operations/stopscanresponse.md @@ -0,0 +1,11 @@ +# StopScanResponse + + +## 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 | +| `MediaContainerWithDevice` | [*components.MediaContainerWithDevice](../../models/components/mediacontainerwithdevice.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/stoptaskglobals.md b/docs/models/operations/stoptaskglobals.md new file mode 100644 index 0000000..c671778 --- /dev/null +++ b/docs/models/operations/stoptaskglobals.md @@ -0,0 +1,18 @@ +# StopTaskGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/stoptaskrequest.md b/docs/models/operations/stoptaskrequest.md index 1f6b005..4c4efe2 100644 --- a/docs/models/operations/stoptaskrequest.md +++ b/docs/models/operations/stoptaskrequest.md @@ -3,6 +3,17 @@ ## 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 +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Task` | [operations.Task](../../models/operations/task.md) | :heavy_check_mark: | The task name | | \ No newline at end of file diff --git a/docs/models/operations/stoptasksresponse.md b/docs/models/operations/stoptasksresponse.md new file mode 100644 index 0000000..37b31d5 --- /dev/null +++ b/docs/models/operations/stoptasksresponse.md @@ -0,0 +1,10 @@ +# StopTasksResponse + + +## 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 deleted file mode 100644 index d694f48..0000000 --- a/docs/models/operations/stoptranscodesessionrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index 79f4d0a..0000000 --- a/docs/models/operations/stoptranscodesessionresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index 3159f89..0000000 --- a/docs/models/operations/stream.md +++ /dev/null @@ -1,58 +0,0 @@ -# Stream - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | Unique stream identifier. | 1002625 | -| `StreamType` | *int64* | :heavy_check_mark: | Stream type:
- VIDEO = 1
- AUDIO = 2
- SUBTITLE = 3
| | -| `Format` | **string* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt | -| `Default` | **bool* | :heavy_minus_sign: | Indicates if this stream is default. | true | -| `Codec` | *string* | :heavy_check_mark: | Codec used by the stream. | hevc | -| `Index` | **int* | :heavy_minus_sign: | Index of the stream. | 0 | -| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate of the stream. | 24743 | -| `Language` | **string* | :heavy_minus_sign: | Language of the stream. | English | -| `LanguageTag` | **string* | :heavy_minus_sign: | Language tag (e.g., en). | en | -| `LanguageCode` | **string* | :heavy_minus_sign: | ISO language code. | eng | -| `HeaderCompression` | **bool* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true | -| `DOVIBLCompatID` | **int* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 | -| `DOVIBLPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true | -| `DOVIELPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false | -| `DOVILevel` | **int* | :heavy_minus_sign: | Dolby Vision level. | 6 | -| `DOVIPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true | -| `DOVIProfile` | **int* | :heavy_minus_sign: | Dolby Vision profile. | 8 | -| `DOVIRPUPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true | -| `DOVIVersion` | **string* | :heavy_minus_sign: | Dolby Vision version. | 1.0 | -| `BitDepth` | **int* | :heavy_minus_sign: | Bit depth of the video stream. | 10 | -| `ChromaLocation` | **string* | :heavy_minus_sign: | Chroma sample location. | topleft | -| `ChromaSubsampling` | **string* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 | -| `CodedHeight` | **int* | :heavy_minus_sign: | Coded video height. | 1608 | -| `CodedWidth` | **int* | :heavy_minus_sign: | Coded video width. | 3840 | -| `ClosedCaptions` | **bool* | :heavy_minus_sign: | N/A | true | -| `ColorPrimaries` | **string* | :heavy_minus_sign: | Color primaries used. | bt2020 | -| `ColorRange` | **string* | :heavy_minus_sign: | Color range (e.g., tv). | tv | -| `ColorSpace` | **string* | :heavy_minus_sign: | Color space. | bt2020nc | -| `ColorTrc` | **string* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 | -| `FrameRate` | **float32* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 | -| `Key` | **string* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 | -| `Height` | **int* | :heavy_minus_sign: | Height of the video stream. | 1602 | -| `Level` | **int* | :heavy_minus_sign: | Video level. | 150 | -| `Original` | **bool* | :heavy_minus_sign: | Indicates if this is the original stream. | true | -| `HasScalingMatrix` | **bool* | :heavy_minus_sign: | N/A | false | -| `Profile` | **string* | :heavy_minus_sign: | Video profile. | main 10 | -| `ScanType` | **string* | :heavy_minus_sign: | N/A | progressive | -| `EmbeddedInVideo` | **string* | :heavy_minus_sign: | N/A | progressive | -| `RefFrames` | **int* | :heavy_minus_sign: | Number of reference frames. | 1 | -| `Width` | **int* | :heavy_minus_sign: | Width of the video stream. | 3840 | -| `DisplayTitle` | *string* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) | -| `ExtendedDisplayTitle` | *string* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) | -| `Selected` | **bool* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true | -| `Forced` | **bool* | :heavy_minus_sign: | N/A | true | -| `Channels` | **int* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 | -| `AudioChannelLayout` | **string* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) | -| `SamplingRate` | **int* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 | -| `CanAutoSync` | **bool* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false | -| `HearingImpaired` | **bool* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true | -| `Dub` | **bool* | :heavy_minus_sign: | Indicates if the stream is a dub. | true | -| `Title` | **string* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH | \ No newline at end of file diff --git a/docs/models/operations/subscription.md b/docs/models/operations/subscription.md deleted file mode 100644 index e0322b0..0000000 --- a/docs/models/operations/subscription.md +++ /dev/null @@ -1,15 +0,0 @@ -# Subscription - -If the account’s Plex Pass subscription is active - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `Features` | []*string* | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `Active` | **bool* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `SubscribedAt` | **string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `Status` | [*operations.GetTokenDetailsAuthenticationStatus](../../models/operations/gettokendetailsauthenticationstatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `PaymentService` | **string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `Plan` | **string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/operations/subscriptiontemplate.md b/docs/models/operations/subscriptiontemplate.md new file mode 100644 index 0000000..7bb8c13 --- /dev/null +++ b/docs/models/operations/subscriptiontemplate.md @@ -0,0 +1,8 @@ +# SubscriptionTemplate + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `MediaSubscription` | [][operations.MediaSubscription](../../models/operations/mediasubscription.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/subtitles.md b/docs/models/operations/subtitles.md new file mode 100644 index 0000000..d3ad139 --- /dev/null +++ b/docs/models/operations/subtitles.md @@ -0,0 +1,17 @@ +# Subtitles + +Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `SubtitlesAuto` | auto | +| `SubtitlesBurn` | burn | +| `SubtitlesNone` | none | +| `SubtitlesSidecar` | sidecar | +| `SubtitlesEmbedded` | embedded | +| `SubtitlesSegmented` | segmented | +| `SubtitlesUnknown` | unknown | \ No newline at end of file diff --git a/docs/models/operations/tag.md b/docs/models/operations/tag.md deleted file mode 100644 index fd08766..0000000 --- a/docs/models/operations/tag.md +++ /dev/null @@ -1,25 +0,0 @@ -# Tag - -A key representing a specific tag within the section. - - -## Values - -| Name | Value | -| ------------------- | ------------------- | -| `TagUnwatched` | unwatched | -| `TagNewest` | newest | -| `TagRecentlyAdded` | recentlyAdded | -| `TagRecentlyViewed` | recentlyViewed | -| `TagOnDeck` | onDeck | -| `TagCollection` | collection | -| `TagEdition` | edition | -| `TagYear` | year | -| `TagDecade` | decade | -| `TagDirector` | director | -| `TagContentRating` | contentRating | -| `TagRating` | rating | -| `TagResolution` | resolution | -| `TagFirstCharacter` | firstCharacter | -| `TagFolder` | folder | -| `TagAlbums` | albums | \ No newline at end of file diff --git a/docs/models/operations/task.md b/docs/models/operations/task.md new file mode 100644 index 0000000..cc452ec --- /dev/null +++ b/docs/models/operations/task.md @@ -0,0 +1,31 @@ +# Task + +The task name + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `TaskAutomaticUpdates` | AutomaticUpdates | +| `TaskBackupDatabase` | BackupDatabase | +| `TaskButlerTaskGenerateAdMarkers` | ButlerTaskGenerateAdMarkers | +| `TaskButlerTaskGenerateCreditsMarkers` | ButlerTaskGenerateCreditsMarkers | +| `TaskButlerTaskGenerateIntroMarkers` | ButlerTaskGenerateIntroMarkers | +| `TaskButlerTaskGenerateVoiceActivity` | ButlerTaskGenerateVoiceActivity | +| `TaskCleanOldBundles` | CleanOldBundles | +| `TaskCleanOldCacheFiles` | CleanOldCacheFiles | +| `TaskDeepMediaAnalysis` | DeepMediaAnalysis | +| `TaskGarbageCollectBlobs` | GarbageCollectBlobs | +| `TaskGarbageCollectLibraryMedia` | GarbageCollectLibraryMedia | +| `TaskGenerateBlurHashes` | GenerateBlurHashes | +| `TaskGenerateChapterThumbs` | GenerateChapterThumbs | +| `TaskGenerateMediaIndexFiles` | GenerateMediaIndexFiles | +| `TaskLoudnessAnalysis` | LoudnessAnalysis | +| `TaskMusicAnalysis` | MusicAnalysis | +| `TaskOptimizeDatabase` | OptimizeDatabase | +| `TaskRefreshEpgGuides` | RefreshEpgGuides | +| `TaskRefreshLibraries` | RefreshLibraries | +| `TaskRefreshLocalMedia` | RefreshLocalMedia | +| `TaskRefreshPeriodicMetadata` | RefreshPeriodicMetadata | +| `TaskUpgradeMediaAnalysis` | UpgradeMediaAnalysis | \ No newline at end of file diff --git a/docs/models/operations/taskname.md b/docs/models/operations/taskname.md deleted file mode 100644 index ef800bd..0000000 --- a/docs/models/operations/taskname.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/terminatesessionglobals.md b/docs/models/operations/terminatesessionglobals.md new file mode 100644 index 0000000..c34efde --- /dev/null +++ b/docs/models/operations/terminatesessionglobals.md @@ -0,0 +1,18 @@ +# TerminateSessionGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/terminatesessionrequest.md b/docs/models/operations/terminatesessionrequest.md new file mode 100644 index 0000000..08b043e --- /dev/null +++ b/docs/models/operations/terminatesessionrequest.md @@ -0,0 +1,20 @@ +# TerminateSessionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SessionID` | *string* | :heavy_check_mark: | The session id (found in the `Session` element in [/status/sessions](#tag/Status/operation/statusGetSlash)) | cdefghijklmnopqrstuvwxyz | +| `Reason` | **string* | :heavy_minus_sign: | The reason to give to the user (typically displayed in the client) | Stop Playing | \ No newline at end of file diff --git a/docs/models/operations/terminatesessionresponse.md b/docs/models/operations/terminatesessionresponse.md new file mode 100644 index 0000000..ce33696 --- /dev/null +++ b/docs/models/operations/terminatesessionresponse.md @@ -0,0 +1,10 @@ +# TerminateSessionResponse + + +## 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/tonight.md b/docs/models/operations/tonight.md deleted file mode 100644 index 5968d95..0000000 --- a/docs/models/operations/tonight.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/transcode.md b/docs/models/operations/transcode.md new file mode 100644 index 0000000..94ea9d9 --- /dev/null +++ b/docs/models/operations/transcode.md @@ -0,0 +1,9 @@ +# Transcode + +The transcode session object which is not yet documented otherwise it'd be a $ref here. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/transcodeimageglobals.md b/docs/models/operations/transcodeimageglobals.md new file mode 100644 index 0000000..035eaa3 --- /dev/null +++ b/docs/models/operations/transcodeimageglobals.md @@ -0,0 +1,18 @@ +# TranscodeImageGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/transcodeimagerequest.md b/docs/models/operations/transcodeimagerequest.md new file mode 100644 index 0000000..5268595 --- /dev/null +++ b/docs/models/operations/transcodeimagerequest.md @@ -0,0 +1,32 @@ +# TranscodeImageRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `URL` | **string* | :heavy_minus_sign: | The source URL for the image to transcode. Note, if this URL requires a token such as `X-Plex-Token`, it should be given as a query parameter to this url. | /library/metadata/265/thumb/1715112705 | +| `Format` | [*operations.Format](../../models/operations/format.md) | :heavy_minus_sign: | The output format for the image; defaults to jpg | | +| `Width` | **int64* | :heavy_minus_sign: | The desired width of the output image | | +| `Height` | **int64* | :heavy_minus_sign: | The desired height of the output image | | +| `Quality` | **int64* | :heavy_minus_sign: | The desired quality of the output. -1 means the highest quality. Defaults to -1 | | +| `Background` | **string* | :heavy_minus_sign: | The background color to apply before painting the image. Only really applicable if image has transparency. Defaults to none | #ff5522 | +| `Upscale` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if image should be upscaled to the desired width/height. Defaults to false | 1 | +| `MinSize` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if image should be scaled to fit the smaller dimension. By default (false) the image is scaled to fit within the width/height specified but if this parameter is true, it will allow overflowing one dimension to fit the other. Essentially it is making the width/height minimum sizes of the image or sizing the image to fill the entire width/height even if it overflows one dimension. | 1 | +| `Rotate` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Obey the rotation values specified in EXIF data. Defaults to true. | 1 | +| `Blur` | **int64* | :heavy_minus_sign: | Apply a blur to the image, Defaults to 0 (none) | | +| `Saturation` | **int64* | :heavy_minus_sign: | Scale the image saturation by the specified percentage. Defaults to 100 | | +| `Opacity` | **int64* | :heavy_minus_sign: | Render the image at the specified opacity percentage. Defaults to 100 | | +| `ChromaSubsampling` | [*operations.ChromaSubsampling](../../models/operations/chromasubsampling.md) | :heavy_minus_sign: | Use the specified chroma subsambling.
- 0: 411
- 1: 420
- 2: 422
- 3: 444
Defaults to 3 (444) | | +| `BlendColor` | **string* | :heavy_minus_sign: | The color to blend with the image. Defaults to none | #ff5522 | \ No newline at end of file diff --git a/docs/models/operations/transcodeimageresponse.md b/docs/models/operations/transcodeimageresponse.md new file mode 100644 index 0000000..b185587 --- /dev/null +++ b/docs/models/operations/transcodeimageresponse.md @@ -0,0 +1,13 @@ +# TranscodeImageResponse + + +## 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 | +| `TwoHundredImageJpegResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | The resulting image | +| `TwoHundredImagePngResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | The resulting image | +| `TwoHundredImageXPortablePixmapResponseStream` | *io.ReadCloser* | :heavy_minus_sign: | The resulting image | \ No newline at end of file diff --git a/docs/models/operations/transcodejob.md b/docs/models/operations/transcodejob.md new file mode 100644 index 0000000..cf1d07a --- /dev/null +++ b/docs/models/operations/transcodejob.md @@ -0,0 +1,18 @@ +# TranscodeJob + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `GeneratorID` | **int64* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Progress` | **float64* | :heavy_minus_sign: | N/A | +| `RatingKey` | **string* | :heavy_minus_sign: | N/A | +| `Remaining` | **int64* | :heavy_minus_sign: | The number of seconds remaining in this job | +| `Size` | **int64* | :heavy_minus_sign: | The size of the result so far | +| `Speed` | **float64* | :heavy_minus_sign: | The speed of the transcode; 1.0 means real-time | +| `TargetTagID` | **int64* | :heavy_minus_sign: | The tag associated with the job. This could be the tag containing the optimizer settings. | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Type` | [*operations.GetBackgroundTasksType](../../models/operations/getbackgroundtaskstype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/transcodesession.md b/docs/models/operations/transcodesession.md deleted file mode 100644 index b97ed9a..0000000 --- a/docs/models/operations/transcodesession.md +++ /dev/null @@ -1,31 +0,0 @@ -# TranscodeSession - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | -| `Key` | **string* | :heavy_minus_sign: | N/A | vv3i2q2lax92qlzul1hbd4bx | -| `Throttled` | **bool* | :heavy_minus_sign: | N/A | false | -| `Complete` | **bool* | :heavy_minus_sign: | N/A | false | -| `Progress` | **float64* | :heavy_minus_sign: | N/A | 1.7999999523162842 | -| `Size` | **int* | :heavy_minus_sign: | N/A | -22 | -| `Speed` | **float64* | :heavy_minus_sign: | N/A | 25.100000381469727 | -| `Error` | **bool* | :heavy_minus_sign: | N/A | false | -| `Duration` | **int* | :heavy_minus_sign: | N/A | 1445695 | -| `Remaining` | **int* | :heavy_minus_sign: | N/A | 53 | -| `Context` | **string* | :heavy_minus_sign: | N/A | streaming | -| `SourceVideoCodec` | **string* | :heavy_minus_sign: | N/A | h264 | -| `SourceAudioCodec` | **string* | :heavy_minus_sign: | N/A | aac | -| `VideoDecision` | **string* | :heavy_minus_sign: | N/A | transcode | -| `AudioDecision` | **string* | :heavy_minus_sign: | N/A | transcode | -| `SubtitleDecision` | **string* | :heavy_minus_sign: | N/A | burn | -| `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` | **int* | :heavy_minus_sign: | N/A | 1 | -| `TranscodeHwRequested` | **bool* | :heavy_minus_sign: | N/A | true | -| `TimeStamp` | **float64* | :heavy_minus_sign: | N/A | 1.7058958054919229e+09 | -| `MaxOffsetAvailable` | **float64* | :heavy_minus_sign: | N/A | 29.53 | -| `MinOffsetAvailable` | **float64* | :heavy_minus_sign: | N/A | 3.003000020980835 | \ No newline at end of file diff --git a/docs/models/operations/transcodesubtitlesglobals.md b/docs/models/operations/transcodesubtitlesglobals.md new file mode 100644 index 0000000..1e2b1bc --- /dev/null +++ b/docs/models/operations/transcodesubtitlesglobals.md @@ -0,0 +1,18 @@ +# TranscodeSubtitlesGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/transcodesubtitlesrequest.md b/docs/models/operations/transcodesubtitlesrequest.md new file mode 100644 index 0000000..afc88cd --- /dev/null +++ b/docs/models/operations/transcodesubtitlesrequest.md @@ -0,0 +1,49 @@ +# TranscodeSubtitlesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `TranscodeType` | [components.TranscodeType](../../models/components/transcodetype.md) | :heavy_check_mark: | Type of transcode media | | +| `TranscodeSessionID` | **string* | :heavy_minus_sign: | Transcode session UUID | | +| `AdvancedSubtitles` | [*components.AdvancedSubtitles](../../models/components/advancedsubtitles.md) | :heavy_minus_sign: | Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost
| burn | +| `AudioBoost` | **int64* | :heavy_minus_sign: | Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) | 50 | +| `AudioChannelCount` | **int64* | :heavy_minus_sign: | Target video number of audio channels. | 5 | +| `AutoAdjustQuality` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports ABR. | 1 | +| `AutoAdjustSubtitle` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if the server should adjust subtitles based on Voice Activity Data. | 1 | +| `DirectPlay` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct playing the indicated content. | 1 | +| `DirectStream` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the video of the indicated content. | 1 | +| `DirectStreamAudio` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates the client supports direct streaming the audio of the indicated content. | 1 | +| `DisableResolutionRotation` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Indicates if resolution should be adjusted for orientation. | 1 | +| `HasMDE` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 | 1 | +| `Location` | [*operations.QueryParamLocation](../../models/operations/queryparamlocation.md) | :heavy_minus_sign: | Network type of the client, can be used to help determine target bitrate. | wan | +| `MediaBufferSize` | **int64* | :heavy_minus_sign: | Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. | 102400 | +| `MediaIndex` | **int64* | :heavy_minus_sign: | Index of the media to transcode. -1 or not specified indicates let the server choose. | 0 | +| `MusicBitrate` | **int64* | :heavy_minus_sign: | Target bitrate for audio only files (in kbps, used to transcode). | 5000 | +| `Offset` | **float64* | :heavy_minus_sign: | Offset from the start of the media (in seconds). | 90.5 | +| `PartIndex` | **int64* | :heavy_minus_sign: | Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode | 0 | +| `Path` | **string* | :heavy_minus_sign: | Internal PMS path of the media to transcode. | /library/metadata/151671 | +| `PeakBitrate` | **int64* | :heavy_minus_sign: | Maximum bitrate (in kbps) to use in ABR. | 12000 | +| `PhotoResolution` | **string* | :heavy_minus_sign: | Target photo resolution. | 1080x1080 | +| `Protocol` | [*operations.QueryParamProtocol](../../models/operations/queryparamprotocol.md) | :heavy_minus_sign: | Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022)
| dash | +| `SecondsPerSegment` | **int64* | :heavy_minus_sign: | Number of seconds to include in each transcoded segment | 5 | +| `SubtitleSize` | **int64* | :heavy_minus_sign: | Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) | 50 | +| `Subtitles` | [*operations.QueryParamSubtitles](../../models/operations/queryparamsubtitles.md) | :heavy_minus_sign: | Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream
| Burn | +| `VideoBitrate` | **int64* | :heavy_minus_sign: | Target video bitrate (in kbps). | 12000 | +| `VideoQuality` | **int64* | :heavy_minus_sign: | Target photo quality. | 50 | +| `VideoResolution` | **string* | :heavy_minus_sign: | Target maximum video resolution. | 1080x1080 | +| `XPlexClientProfileExtra` | **string* | :heavy_minus_sign: | See [Profile Augmentations](#section/API-Info/Profile-Augmentations) . | add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash) | +| `XPlexClientProfileName` | **string* | :heavy_minus_sign: | Which built in Client Profile to use in the decision. Generally should only be used to specify the Generic profile. | generic | +| `XPlexSessionIdentifier` | **string* | :heavy_minus_sign: | Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) | | \ No newline at end of file diff --git a/docs/models/operations/transcodesubtitlesresponse.md b/docs/models/operations/transcodesubtitlesresponse.md new file mode 100644 index 0000000..742dfc9 --- /dev/null +++ b/docs/models/operations/transcodesubtitlesresponse.md @@ -0,0 +1,10 @@ +# TranscodeSubtitlesResponse + + +## 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/trials.md b/docs/models/operations/trials.md deleted file mode 100644 index 1b9b77d..0000000 --- a/docs/models/operations/trials.md +++ /dev/null @@ -1,7 +0,0 @@ -# Trials - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/triggerfallbackglobals.md b/docs/models/operations/triggerfallbackglobals.md new file mode 100644 index 0000000..1569a8a --- /dev/null +++ b/docs/models/operations/triggerfallbackglobals.md @@ -0,0 +1,18 @@ +# TriggerFallbackGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/triggerfallbackrequest.md b/docs/models/operations/triggerfallbackrequest.md new file mode 100644 index 0000000..02d0006 --- /dev/null +++ b/docs/models/operations/triggerfallbackrequest.md @@ -0,0 +1,20 @@ +# TriggerFallbackRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `TranscodeType` | [components.TranscodeType](../../models/components/transcodetype.md) | :heavy_check_mark: | Type of transcode media | | +| `TranscodeSessionID` | **string* | :heavy_minus_sign: | Transcode session UUID | | \ No newline at end of file diff --git a/docs/models/operations/triggerfallbackresponse.md b/docs/models/operations/triggerfallbackresponse.md new file mode 100644 index 0000000..abfa242 --- /dev/null +++ b/docs/models/operations/triggerfallbackresponse.md @@ -0,0 +1,10 @@ +# TriggerFallbackResponse + + +## 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/tunechannelglobals.md b/docs/models/operations/tunechannelglobals.md new file mode 100644 index 0000000..de5ab24 --- /dev/null +++ b/docs/models/operations/tunechannelglobals.md @@ -0,0 +1,18 @@ +# TuneChannelGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/tunechannelrequest.md b/docs/models/operations/tunechannelrequest.md new file mode 100644 index 0000000..b56ec64 --- /dev/null +++ b/docs/models/operations/tunechannelrequest.md @@ -0,0 +1,20 @@ +# TuneChannelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `DvrID` | *int64* | :heavy_check_mark: | The ID of the DVR. | | +| `Channel` | *string* | :heavy_check_mark: | The channel ID to tune | 2.1 | \ No newline at end of file diff --git a/docs/models/operations/tunechannelresponse.md b/docs/models/operations/tunechannelresponse.md new file mode 100644 index 0000000..691eb9c --- /dev/null +++ b/docs/models/operations/tunechannelresponse.md @@ -0,0 +1,12 @@ +# TuneChannelResponse + + +## 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 | +| `MediaContainerWithMetadata` | [*components.MediaContainerWithMetadata](../../models/components/mediacontainerwithmetadata.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/type.md b/docs/models/operations/type.md index 555d352..359d438 100644 --- a/docs/models/operations/type.md +++ b/docs/models/operations/type.md @@ -1,24 +1,12 @@ # Type -The type of media to retrieve or filter by. -1 = movie -2 = show -3 = season -4 = episode -E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - +The type of play queue to create ## Values -| Name | Value | -| ---------------- | ---------------- | -| `TypeMovie` | 1 | -| `TypeTvShow` | 2 | -| `TypeSeason` | 3 | -| `TypeEpisode` | 4 | -| `TypeArtist` | 5 | -| `TypeAlbum` | 6 | -| `TypeTrack` | 7 | -| `TypePhotoAlbum` | 8 | -| `TypePhoto` | 9 | \ No newline at end of file +| Name | Value | +| ----------- | ----------- | +| `TypeAudio` | audio | +| `TypeVideo` | video | +| `TypePhoto` | photo | \ No newline at end of file diff --git a/docs/models/operations/ultrablurcolors.md b/docs/models/operations/ultrablurcolors.md index e01c9db..5e79ac6 100644 --- a/docs/models/operations/ultrablurcolors.md +++ b/docs/models/operations/ultrablurcolors.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `TopLeft` | *string* | :heavy_check_mark: | N/A | 11333b | -| `TopRight` | *string* | :heavy_check_mark: | N/A | 0a232d | -| `BottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | -| `BottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `BottomLeft` | **string* | :heavy_minus_sign: | The color (hex) for the bottom left quadrant. | +| `BottomRight` | **string* | :heavy_minus_sign: | The color (hex) for the bottom right quadrant. | +| `TopLeft` | **string* | :heavy_minus_sign: | The color (hex) for the top left quadrant. | +| `TopRight` | **string* | :heavy_minus_sign: | The color (hex) for the top right quadrant. | \ No newline at end of file diff --git a/docs/models/operations/unmatchglobals.md b/docs/models/operations/unmatchglobals.md new file mode 100644 index 0000000..6333b60 --- /dev/null +++ b/docs/models/operations/unmatchglobals.md @@ -0,0 +1,18 @@ +# UnmatchGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/unmatchrequest.md b/docs/models/operations/unmatchrequest.md new file mode 100644 index 0000000..753bcd3 --- /dev/null +++ b/docs/models/operations/unmatchrequest.md @@ -0,0 +1,19 @@ +# UnmatchRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/unmatchresponse.md b/docs/models/operations/unmatchresponse.md new file mode 100644 index 0000000..e05d466 --- /dev/null +++ b/docs/models/operations/unmatchresponse.md @@ -0,0 +1,10 @@ +# UnmatchResponse + + +## 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/unscrobbleglobals.md b/docs/models/operations/unscrobbleglobals.md new file mode 100644 index 0000000..ca4019c --- /dev/null +++ b/docs/models/operations/unscrobbleglobals.md @@ -0,0 +1,18 @@ +# UnscrobbleGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/unscrobblerequest.md b/docs/models/operations/unscrobblerequest.md new file mode 100644 index 0000000..e8acd0a --- /dev/null +++ b/docs/models/operations/unscrobblerequest.md @@ -0,0 +1,21 @@ +# UnscrobbleRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Identifier` | *string* | :heavy_check_mark: | The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library` | | +| `Key` | **string* | :heavy_minus_sign: | The key of the item to rate. This is the `ratingKey` found in metadata items | | +| `URI` | **string* | :heavy_minus_sign: | The URI of the item to mark as played. See intro for description of the URIs | | \ No newline at end of file diff --git a/docs/models/operations/unscrobbleresponse.md b/docs/models/operations/unscrobbleresponse.md new file mode 100644 index 0000000..1edf074 --- /dev/null +++ b/docs/models/operations/unscrobbleresponse.md @@ -0,0 +1,10 @@ +# UnscrobbleResponse + + +## 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/unshuffleglobals.md b/docs/models/operations/unshuffleglobals.md new file mode 100644 index 0000000..5886cc8 --- /dev/null +++ b/docs/models/operations/unshuffleglobals.md @@ -0,0 +1,18 @@ +# UnshuffleGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/unshufflerequest.md b/docs/models/operations/unshufflerequest.md new file mode 100644 index 0000000..45348fe --- /dev/null +++ b/docs/models/operations/unshufflerequest.md @@ -0,0 +1,19 @@ +# UnshuffleRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlayQueueID` | *int64* | :heavy_check_mark: | The ID of the play queue. | | \ No newline at end of file diff --git a/docs/models/operations/unshuffleresponse.md b/docs/models/operations/unshuffleresponse.md new file mode 100644 index 0000000..d714672 --- /dev/null +++ b/docs/models/operations/unshuffleresponse.md @@ -0,0 +1,11 @@ +# UnshuffleResponse + + +## 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 | +| `MediaContainerWithPlaylistMetadata` | [*components.MediaContainerWithPlaylistMetadata](../../models/components/mediacontainerwithplaylistmetadata.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/updatehubvisibilityglobals.md b/docs/models/operations/updatehubvisibilityglobals.md new file mode 100644 index 0000000..6e246f9 --- /dev/null +++ b/docs/models/operations/updatehubvisibilityglobals.md @@ -0,0 +1,18 @@ +# UpdateHubVisibilityGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/updatehubvisibilityrequest.md b/docs/models/operations/updatehubvisibilityrequest.md new file mode 100644 index 0000000..38995da --- /dev/null +++ b/docs/models/operations/updatehubvisibilityrequest.md @@ -0,0 +1,23 @@ +# UpdateHubVisibilityRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *int64* | :heavy_check_mark: | The section ID for the hubs to change | | +| `Identifier` | *string* | :heavy_check_mark: | The identifier of the hub to change | | +| `PromotedToRecommended` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this hub should be displayed in recommended | 1 | +| `PromotedToOwnHome` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this hub should be displayed in admin's home | 1 | +| `PromotedToSharedHome` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Whether this hub should be displayed in shared user's home | 1 | \ No newline at end of file diff --git a/docs/models/operations/updatehubvisibilityresponse.md b/docs/models/operations/updatehubvisibilityresponse.md new file mode 100644 index 0000000..25f0ed2 --- /dev/null +++ b/docs/models/operations/updatehubvisibilityresponse.md @@ -0,0 +1,10 @@ +# UpdateHubVisibilityResponse + + +## 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/updateitemartworkglobals.md b/docs/models/operations/updateitemartworkglobals.md new file mode 100644 index 0000000..0b3ac11 --- /dev/null +++ b/docs/models/operations/updateitemartworkglobals.md @@ -0,0 +1,18 @@ +# UpdateItemArtworkGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/updateitemartworkrequest.md b/docs/models/operations/updateitemartworkrequest.md new file mode 100644 index 0000000..6c7e2f4 --- /dev/null +++ b/docs/models/operations/updateitemartworkrequest.md @@ -0,0 +1,21 @@ +# UpdateItemArtworkRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Ids` | *string* | :heavy_check_mark: | N/A | | +| `Element` | [operations.PathParamElement](../../models/operations/pathparamelement.md) | :heavy_check_mark: | N/A | | +| `URL` | **string* | :heavy_minus_sign: | The url of the new asset. | | \ No newline at end of file diff --git a/docs/models/operations/updateitemartworkresponse.md b/docs/models/operations/updateitemartworkresponse.md new file mode 100644 index 0000000..d5b9c19 --- /dev/null +++ b/docs/models/operations/updateitemartworkresponse.md @@ -0,0 +1,10 @@ +# UpdateItemArtworkResponse + + +## 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/updateitemsglobals.md b/docs/models/operations/updateitemsglobals.md new file mode 100644 index 0000000..f0a73bd --- /dev/null +++ b/docs/models/operations/updateitemsglobals.md @@ -0,0 +1,18 @@ +# UpdateItemsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/updateitemsrequest.md b/docs/models/operations/updateitemsrequest.md new file mode 100644 index 0000000..333407c --- /dev/null +++ b/docs/models/operations/updateitemsrequest.md @@ -0,0 +1,32 @@ +# UpdateItemsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `SectionID` | *string* | :heavy_check_mark: | The id of the section | | +| `Type` | **string* | :heavy_minus_sign: | N/A | | +| `Filters` | **string* | :heavy_minus_sign: | The filters to apply to determine which items should be modified | | +| `FieldValue` | **string* | :heavy_minus_sign: | Set the specified field to a new value | | +| `FieldLocked` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | Set the specified field to locked (or unlocked if set to 0) | 1 | +| `TitleValue` | **string* | :heavy_minus_sign: | This field is treated specially by albums or artists and may be used for implicit reparenting. | | +| `ArtistTitleValue` | **string* | :heavy_minus_sign: | Reparents set of Tracks or Albums - used with album.title.* in the case of tracks | | +| `ArtistTitleID` | **string* | :heavy_minus_sign: | Reparents set of Tracks or Albums - used with album.title.* in the case of tracks | | +| `AlbumTitleValue` | **string* | :heavy_minus_sign: | Reparents set of Tracks - Must be used in conjunction with artist.title.value or id | | +| `AlbumTitleID` | **string* | :heavy_minus_sign: | Reparents set of Tracks - Must be used in conjunction with artist.title.value or id | | +| `TagtypeIdxTagTag` | **string* | :heavy_minus_sign: | Creates tag and associates it with each item in the set. - [idx] links this and the next parameters together | | +| `TagtypeIdxTaggingObject` | **string* | :heavy_minus_sign: | Here `object` may be text/thumb/art/theme - Optionally used in conjunction with tag.tag, to update association info across the set. | | +| `TagtypeTagTag` | **string* | :heavy_minus_sign: | Remove comma separated tags from the set of items | | +| `TagtypeTag` | **string* | :heavy_minus_sign: | Remove associations of this type (e.g. genre) from the set of items | | \ No newline at end of file diff --git a/docs/models/operations/updateitemsresponse.md b/docs/models/operations/updateitemsresponse.md new file mode 100644 index 0000000..ceb0b5a --- /dev/null +++ b/docs/models/operations/updateitemsresponse.md @@ -0,0 +1,10 @@ +# UpdateItemsResponse + + +## 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/updateplaylistglobals.md b/docs/models/operations/updateplaylistglobals.md new file mode 100644 index 0000000..e5a59a0 --- /dev/null +++ b/docs/models/operations/updateplaylistglobals.md @@ -0,0 +1,18 @@ +# UpdatePlaylistGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/updateplaylistrequest.md b/docs/models/operations/updateplaylistrequest.md index 67c832d..b361e37 100644 --- a/docs/models/operations/updateplaylistrequest.md +++ b/docs/models/operations/updateplaylistrequest.md @@ -3,8 +3,17 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | -| `Title` | **string* | :heavy_minus_sign: | name of the playlist | -| `Summary` | **string* | :heavy_minus_sign: | summary description of the playlist | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `PlaylistID` | *int64* | :heavy_check_mark: | The ID of the playlist | | \ No newline at end of file diff --git a/docs/models/operations/updateplayprogressrequest.md b/docs/models/operations/updateplayprogressrequest.md deleted file mode 100644 index 0ec0520..0000000 --- a/docs/models/operations/updateplayprogressrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdatePlayProgressRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | the media key | | -| `Time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 | -| `State` | *string* | :heavy_check_mark: | The playback state of the media item. | played | \ No newline at end of file diff --git a/docs/models/operations/updateplayprogressresponse.md b/docs/models/operations/updateplayprogressresponse.md deleted file mode 100644 index 5e31258..0000000 --- a/docs/models/operations/updateplayprogressresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/uploadplaylistglobals.md b/docs/models/operations/uploadplaylistglobals.md new file mode 100644 index 0000000..0c17eab --- /dev/null +++ b/docs/models/operations/uploadplaylistglobals.md @@ -0,0 +1,18 @@ +# UploadPlaylistGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/uploadplaylistrequest.md b/docs/models/operations/uploadplaylistrequest.md index 93bd99b..175c98d 100644 --- a/docs/models/operations/uploadplaylistrequest.md +++ b/docs/models/operations/uploadplaylistrequest.md @@ -3,8 +3,18 @@ ## 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.QueryParamForce](../../models/operations/queryparamforce.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.
| | -| `SectionID` | *int64* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Path` | **string* | :heavy_minus_sign: | 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` | [*components.BoolInt](../../models/components/boolint.md) | :heavy_minus_sign: | 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. | 1 | \ No newline at end of file diff --git a/docs/models/operations/upscale.md b/docs/models/operations/upscale.md deleted file mode 100644 index 30574a0..0000000 --- a/docs/models/operations/upscale.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/user.md b/docs/models/operations/user.md deleted file mode 100644 index ceec634..0000000 --- a/docs/models/operations/user.md +++ /dev/null @@ -1,27 +0,0 @@ -# User - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `ID` | *int64* | :heavy_check_mark: | User's unique ID. | 22526914 | -| `Title` | *string* | :heavy_check_mark: | User's display name. | Plex User | -| `Username` | *string* | :heavy_check_mark: | User's username. | zgfuc7krcqfimrmb9lsl5j | -| `Email` | *string* | :heavy_check_mark: | User's email address. | zgfuc7krcqfimrmb9lsl5j@protonmail.com | -| `RecommendationsPlaylistID` | **string* | :heavy_minus_sign: | ID of the user's recommendation playlist. | | -| `Thumb` | *string* | :heavy_check_mark: | URL to the user's avatar image. | https://plex.tv/users/3346028014e93acd/avatar?c=1731605021 | -| `Protected` | [*operations.Protected](../../models/operations/protected.md) | :heavy_minus_sign: | N/A | 1 | -| `Home` | [*operations.Home](../../models/operations/home.md) | :heavy_minus_sign: | N/A | 1 | -| `AllowTuners` | [*operations.AllowTuners](../../models/operations/allowtuners.md) | :heavy_minus_sign: | N/A | 1 | -| `AllowSync` | [*operations.AllowSync](../../models/operations/allowsync.md) | :heavy_minus_sign: | N/A | 1 | -| `AllowCameraUpload` | [*operations.AllowCameraUpload](../../models/operations/allowcameraupload.md) | :heavy_minus_sign: | N/A | 1 | -| `AllowChannels` | [*operations.AllowChannels](../../models/operations/allowchannels.md) | :heavy_minus_sign: | N/A | 1 | -| `AllowSubtitleAdmin` | [*operations.AllowSubtitleAdmin](../../models/operations/allowsubtitleadmin.md) | :heavy_minus_sign: | N/A | 1 | -| `FilterAll` | **string* | :heavy_minus_sign: | Filters applied for all content. | | -| `FilterMovies` | **string* | :heavy_minus_sign: | Filters applied for movies. | | -| `FilterMusic` | **string* | :heavy_minus_sign: | Filters applied for music. | | -| `FilterPhotos` | **string* | :heavy_minus_sign: | Filters applied for photos. | | -| `FilterTelevision` | **string* | :heavy_minus_sign: | Filters applied for television. | | -| `Restricted` | [*operations.Restricted](../../models/operations/restricted.md) | :heavy_minus_sign: | N/A | 1 | -| `Server` | [][operations.GetUsersServer](../../models/operations/getusersserver.md) | :heavy_check_mark: | List of servers owned by the user. | | \ No newline at end of file diff --git a/docs/models/operations/userprofile.md b/docs/models/operations/userprofile.md deleted file mode 100644 index 2b678ec..0000000 --- a/docs/models/operations/userprofile.md +++ /dev/null @@ -1,15 +0,0 @@ -# UserProfile - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `AutoSelectAudio` | **bool* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | -| `DefaultAudioLanguage` | *string* | :heavy_check_mark: | The preferred audio language for the account | ja | -| `DefaultSubtitleLanguage` | *string* | :heavy_check_mark: | The preferred subtitle language for the account | en | -| `AutoSelectSubtitle` | [*operations.AutoSelectSubtitle](../../models/operations/autoselectsubtitle.md) | :heavy_minus_sign: | N/A | 1 | -| `DefaultSubtitleAccessibility` | [*operations.DefaultSubtitleAccessibility](../../models/operations/defaultsubtitleaccessibility.md) | :heavy_minus_sign: | N/A | 1 | -| `DefaultSubtitleForced` | [*operations.DefaultSubtitleForced](../../models/operations/defaultsubtitleforced.md) | :heavy_minus_sign: | N/A | 1 | -| `WatchedIndicator` | [*operations.WatchedIndicator](../../models/operations/watchedindicator.md) | :heavy_minus_sign: | N/A | 1 | -| `MediaReviewsVisibility` | [*operations.MediaReviewsVisibility](../../models/operations/mediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/voicesearchhubsglobals.md b/docs/models/operations/voicesearchhubsglobals.md new file mode 100644 index 0000000..c97d9cb --- /dev/null +++ b/docs/models/operations/voicesearchhubsglobals.md @@ -0,0 +1,18 @@ +# VoiceSearchHubsGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/voicesearchhubsmediacontainer.md b/docs/models/operations/voicesearchhubsmediacontainer.md new file mode 100644 index 0000000..d355296 --- /dev/null +++ b/docs/models/operations/voicesearchhubsmediacontainer.md @@ -0,0 +1,17 @@ +# VoiceSearchHubsMediaContainer + +`MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | +| `Offset` | **int64* | :heavy_minus_sign: | The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
| +| `Size` | **int64* | :heavy_minus_sign: | N/A | +| `TotalSize` | **int64* | :heavy_minus_sign: | The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
| +| `Hub` | [][components.Hub](../../models/components/hub.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/voicesearchhubsrequest.md b/docs/models/operations/voicesearchhubsrequest.md new file mode 100644 index 0000000..9f7d64b --- /dev/null +++ b/docs/models/operations/voicesearchhubsrequest.md @@ -0,0 +1,21 @@ +# VoiceSearchHubsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Query` | *string* | :heavy_check_mark: | The query term | | +| `Type` | **int64* | :heavy_minus_sign: | The metadata type to filter by | | +| `Limit` | **int64* | :heavy_minus_sign: | The number of items to return per hub. 3 if not specified | | \ No newline at end of file diff --git a/docs/models/operations/voicesearchhubsresponse.md b/docs/models/operations/voicesearchhubsresponse.md new file mode 100644 index 0000000..7af35fd --- /dev/null +++ b/docs/models/operations/voicesearchhubsresponse.md @@ -0,0 +1,12 @@ +# VoiceSearchHubsResponse + + +## 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.VoiceSearchHubsResponseBody](../../models/operations/voicesearchhubsresponsebody.md) | :heavy_minus_sign: | OK | +| `Headers` | map[string][]*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/voicesearchhubsresponsebody.md b/docs/models/operations/voicesearchhubsresponsebody.md new file mode 100644 index 0000000..7aed2e6 --- /dev/null +++ b/docs/models/operations/voicesearchhubsresponsebody.md @@ -0,0 +1,10 @@ +# VoiceSearchHubsResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.VoiceSearchHubsMediaContainer](../../models/operations/voicesearchhubsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/watchedindicator.md b/docs/models/operations/watchedindicator.md deleted file mode 100644 index f98bc14..0000000 --- a/docs/models/operations/watchedindicator.md +++ /dev/null @@ -1,11 +0,0 @@ -# WatchedIndicator - -Whether or not media watched indicators are enabled (little orange dot on media) - - -## Values - -| Name | Value | -| ------------------------- | ------------------------- | -| `WatchedIndicatorDisable` | 0 | -| `WatchedIndicatorEnable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/writelogresponse.md b/docs/models/operations/writelogresponse.md new file mode 100644 index 0000000..c8de91d --- /dev/null +++ b/docs/models/operations/writelogresponse.md @@ -0,0 +1,10 @@ +# WriteLogResponse + + +## 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/writemessageglobals.md b/docs/models/operations/writemessageglobals.md new file mode 100644 index 0000000..1191c85 --- /dev/null +++ b/docs/models/operations/writemessageglobals.md @@ -0,0 +1,18 @@ +# WriteMessageGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | \ No newline at end of file diff --git a/docs/models/operations/writemessagerequest.md b/docs/models/operations/writemessagerequest.md new file mode 100644 index 0000000..70870e6 --- /dev/null +++ b/docs/models/operations/writemessagerequest.md @@ -0,0 +1,21 @@ +# WriteMessageRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `Accepts` | [*components.Accepts](../../models/components/accepts.md) | :heavy_minus_sign: | Indicates the client accepts the indicated media types | | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | An opaque identifier unique to the client | abc123 | +| `Product` | **string* | :heavy_minus_sign: | The name of the client product | Plex for Roku | +| `Version` | **string* | :heavy_minus_sign: | The version of the client application | 2.4.1 | +| `Platform` | **string* | :heavy_minus_sign: | The platform of the client | Roku | +| `PlatformVersion` | **string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 | +| `Device` | **string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `Model` | **string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X | +| `DeviceVendor` | **string* | :heavy_minus_sign: | The device vendor | Roku | +| `DeviceName` | **string* | :heavy_minus_sign: | A friendly name for the client | Living Room TV | +| `Marketplace` | **string* | :heavy_minus_sign: | The marketplace on which the client application is distributed | googlePlay | +| `Level` | [*operations.Level](../../models/operations/level.md) | :heavy_minus_sign: | An integer log level to write to the PMS log with.
- 0: Error
- 1: Warning
- 2: Info
- 3: Debug
- 4: Verbose
| | +| `Message` | **string* | :heavy_minus_sign: | The text of the message to write to the log. | | +| `Source` | **string* | :heavy_minus_sign: | A string indicating the source of the message. | | \ No newline at end of file diff --git a/docs/models/operations/writemessageresponse.md b/docs/models/operations/writemessageresponse.md new file mode 100644 index 0000000..868c8b7 --- /dev/null +++ b/docs/models/operations/writemessageresponse.md @@ -0,0 +1,10 @@ +# WriteMessageResponse + + +## 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/writer.md b/docs/models/operations/writer.md deleted file mode 100644 index 01d00c9..0000000 --- a/docs/models/operations/writer.md +++ /dev/null @@ -1,12 +0,0 @@ -# Writer - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `ID` | *int* | :heavy_check_mark: | Unique identifier for the writer. | 126522 | -| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this writer. | writer=126522 | -| `Tag` | *string* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson | -| `TagKey` | **string* | :heavy_minus_sign: | A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. | 5d77683d85719b001f3a535e | -| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the writer. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg | \ No newline at end of file diff --git a/docs/models/sdkerrors/addplaylistcontentsbadrequest.md b/docs/models/sdkerrors/addplaylistcontentsbadrequest.md deleted file mode 100644 index 84a9472..0000000 --- a/docs/models/sdkerrors/addplaylistcontentsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# AddPlaylistContentsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/addplaylistcontentserrors.md b/docs/models/sdkerrors/addplaylistcontentserrors.md deleted file mode 100644 index 5f0d60d..0000000 --- a/docs/models/sdkerrors/addplaylistcontentserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# AddPlaylistContentsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/addplaylistcontentsplaylistserrors.md b/docs/models/sdkerrors/addplaylistcontentsplaylistserrors.md deleted file mode 100644 index ef24feb..0000000 --- a/docs/models/sdkerrors/addplaylistcontentsplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# AddPlaylistContentsPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/addplaylistcontentsunauthorized.md b/docs/models/sdkerrors/addplaylistcontentsunauthorized.md deleted file mode 100644 index fe0faef..0000000 --- a/docs/models/sdkerrors/addplaylistcontentsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# AddPlaylistContentsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.AddPlaylistContentsPlaylistsErrors](../../models/sdkerrors/addplaylistcontentsplaylistserrors.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/applyupdatesbadrequest.md b/docs/models/sdkerrors/applyupdatesbadrequest.md deleted file mode 100644 index 5493b7b..0000000 --- a/docs/models/sdkerrors/applyupdatesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# ApplyUpdatesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/applyupdateserrors.md b/docs/models/sdkerrors/applyupdateserrors.md deleted file mode 100644 index 5a4ff21..0000000 --- a/docs/models/sdkerrors/applyupdateserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# ApplyUpdatesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/applyupdatesunauthorized.md b/docs/models/sdkerrors/applyupdatesunauthorized.md deleted file mode 100644 index 968746c..0000000 --- a/docs/models/sdkerrors/applyupdatesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# ApplyUpdatesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.ApplyUpdatesUpdaterErrors](../../models/sdkerrors/applyupdatesupdatererrors.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/applyupdatesupdatererrors.md b/docs/models/sdkerrors/applyupdatesupdatererrors.md deleted file mode 100644 index 37220be..0000000 --- a/docs/models/sdkerrors/applyupdatesupdatererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# ApplyUpdatesUpdaterErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/cancelserveractivitiesactivitieserrors.md b/docs/models/sdkerrors/cancelserveractivitiesactivitieserrors.md deleted file mode 100644 index a72e63c..0000000 --- a/docs/models/sdkerrors/cancelserveractivitiesactivitieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# CancelServerActivitiesActivitiesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/cancelserveractivitiesbadrequest.md b/docs/models/sdkerrors/cancelserveractivitiesbadrequest.md deleted file mode 100644 index c630803..0000000 --- a/docs/models/sdkerrors/cancelserveractivitiesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# CancelServerActivitiesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/cancelserveractivitieserrors.md b/docs/models/sdkerrors/cancelserveractivitieserrors.md deleted file mode 100644 index 650e0d1..0000000 --- a/docs/models/sdkerrors/cancelserveractivitieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# CancelServerActivitiesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/cancelserveractivitiesunauthorized.md b/docs/models/sdkerrors/cancelserveractivitiesunauthorized.md deleted file mode 100644 index d79093d..0000000 --- a/docs/models/sdkerrors/cancelserveractivitiesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# CancelServerActivitiesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.CancelServerActivitiesActivitiesErrors](../../models/sdkerrors/cancelserveractivitiesactivitieserrors.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/checkforupdatesbadrequest.md b/docs/models/sdkerrors/checkforupdatesbadrequest.md deleted file mode 100644 index 8a474ae..0000000 --- a/docs/models/sdkerrors/checkforupdatesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# CheckForUpdatesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/checkforupdateserrors.md b/docs/models/sdkerrors/checkforupdateserrors.md deleted file mode 100644 index 1405ec6..0000000 --- a/docs/models/sdkerrors/checkforupdateserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckForUpdatesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/checkforupdatesunauthorized.md b/docs/models/sdkerrors/checkforupdatesunauthorized.md deleted file mode 100644 index 0cdf33b..0000000 --- a/docs/models/sdkerrors/checkforupdatesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# CheckForUpdatesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.CheckForUpdatesUpdaterErrors](../../models/sdkerrors/checkforupdatesupdatererrors.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/checkforupdatesupdatererrors.md b/docs/models/sdkerrors/checkforupdatesupdatererrors.md deleted file mode 100644 index 3f1a08f..0000000 --- a/docs/models/sdkerrors/checkforupdatesupdatererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckForUpdatesUpdaterErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/clearplaylistcontentsbadrequest.md b/docs/models/sdkerrors/clearplaylistcontentsbadrequest.md deleted file mode 100644 index d6155d9..0000000 --- a/docs/models/sdkerrors/clearplaylistcontentsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClearPlaylistContentsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/clearplaylistcontentserrors.md b/docs/models/sdkerrors/clearplaylistcontentserrors.md deleted file mode 100644 index 1d8658d..0000000 --- a/docs/models/sdkerrors/clearplaylistcontentserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClearPlaylistContentsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/clearplaylistcontentsplaylistserrors.md b/docs/models/sdkerrors/clearplaylistcontentsplaylistserrors.md deleted file mode 100644 index 17dc7f3..0000000 --- a/docs/models/sdkerrors/clearplaylistcontentsplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClearPlaylistContentsPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/clearplaylistcontentsunauthorized.md b/docs/models/sdkerrors/clearplaylistcontentsunauthorized.md deleted file mode 100644 index a65558b..0000000 --- a/docs/models/sdkerrors/clearplaylistcontentsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClearPlaylistContentsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.ClearPlaylistContentsPlaylistsErrors](../../models/sdkerrors/clearplaylistcontentsplaylistserrors.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/createplaylistbadrequest.md b/docs/models/sdkerrors/createplaylistbadrequest.md deleted file mode 100644 index 5531d7a..0000000 --- a/docs/models/sdkerrors/createplaylistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreatePlaylistBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/createplaylisterrors.md b/docs/models/sdkerrors/createplaylisterrors.md deleted file mode 100644 index 93f2d7d..0000000 --- a/docs/models/sdkerrors/createplaylisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreatePlaylistErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/createplaylistplaylistserrors.md b/docs/models/sdkerrors/createplaylistplaylistserrors.md deleted file mode 100644 index 56b14d3..0000000 --- a/docs/models/sdkerrors/createplaylistplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreatePlaylistPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/createplaylistunauthorized.md b/docs/models/sdkerrors/createplaylistunauthorized.md deleted file mode 100644 index 9a563a9..0000000 --- a/docs/models/sdkerrors/createplaylistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreatePlaylistUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.CreatePlaylistPlaylistsErrors](../../models/sdkerrors/createplaylistplaylistserrors.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/deletelibrarybadrequest.md b/docs/models/sdkerrors/deletelibrarybadrequest.md deleted file mode 100644 index 6296220..0000000 --- a/docs/models/sdkerrors/deletelibrarybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteLibraryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/deletelibraryerrors.md b/docs/models/sdkerrors/deletelibraryerrors.md deleted file mode 100644 index 411f739..0000000 --- a/docs/models/sdkerrors/deletelibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/deletelibrarylibraryerrors.md b/docs/models/sdkerrors/deletelibrarylibraryerrors.md deleted file mode 100644 index b25a3b5..0000000 --- a/docs/models/sdkerrors/deletelibrarylibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteLibraryLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/deletelibraryunauthorized.md b/docs/models/sdkerrors/deletelibraryunauthorized.md deleted file mode 100644 index 70b0b0e..0000000 --- a/docs/models/sdkerrors/deletelibraryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteLibraryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.DeleteLibraryLibraryErrors](../../models/sdkerrors/deletelibrarylibraryerrors.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/deleteplaylistbadrequest.md b/docs/models/sdkerrors/deleteplaylistbadrequest.md deleted file mode 100644 index bca0213..0000000 --- a/docs/models/sdkerrors/deleteplaylistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeletePlaylistBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/deleteplaylisterrors.md b/docs/models/sdkerrors/deleteplaylisterrors.md deleted file mode 100644 index 0474a90..0000000 --- a/docs/models/sdkerrors/deleteplaylisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeletePlaylistErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/deleteplaylistplaylistserrors.md b/docs/models/sdkerrors/deleteplaylistplaylistserrors.md deleted file mode 100644 index 0e60563..0000000 --- a/docs/models/sdkerrors/deleteplaylistplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeletePlaylistPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/deleteplaylistunauthorized.md b/docs/models/sdkerrors/deleteplaylistunauthorized.md deleted file mode 100644 index f1d64b5..0000000 --- a/docs/models/sdkerrors/deleteplaylistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeletePlaylistUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.DeletePlaylistPlaylistsErrors](../../models/sdkerrors/deleteplaylistplaylistserrors.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/enablepapertrailbadrequest.md b/docs/models/sdkerrors/enablepapertrailbadrequest.md deleted file mode 100644 index f620129..0000000 --- a/docs/models/sdkerrors/enablepapertrailbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnablePaperTrailBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/enablepapertrailerrors.md b/docs/models/sdkerrors/enablepapertrailerrors.md deleted file mode 100644 index bb2fb13..0000000 --- a/docs/models/sdkerrors/enablepapertrailerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnablePaperTrailErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/enablepapertraillogerrors.md b/docs/models/sdkerrors/enablepapertraillogerrors.md deleted file mode 100644 index 3465f31..0000000 --- a/docs/models/sdkerrors/enablepapertraillogerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnablePaperTrailLogErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/enablepapertrailunauthorized.md b/docs/models/sdkerrors/enablepapertrailunauthorized.md deleted file mode 100644 index 2006c32..0000000 --- a/docs/models/sdkerrors/enablepapertrailunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnablePaperTrailUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.EnablePaperTrailLogErrors](../../models/sdkerrors/enablepapertraillogerrors.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 deleted file mode 100644 index 3e138f6..0000000 --- a/docs/models/sdkerrors/errors.md +++ /dev/null @@ -1,10 +0,0 @@ -# Errors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getactorslibrarybadrequest.md b/docs/models/sdkerrors/getactorslibrarybadrequest.md deleted file mode 100644 index cef20cb..0000000 --- a/docs/models/sdkerrors/getactorslibrarybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetActorsLibraryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetActorsLibraryErrors](../../models/sdkerrors/getactorslibraryerrors.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/getactorslibraryerrors.md b/docs/models/sdkerrors/getactorslibraryerrors.md deleted file mode 100644 index 1555cfb..0000000 --- a/docs/models/sdkerrors/getactorslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetActorsLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getactorslibrarylibraryerrors.md b/docs/models/sdkerrors/getactorslibrarylibraryerrors.md deleted file mode 100644 index 455eb8a..0000000 --- a/docs/models/sdkerrors/getactorslibrarylibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetActorsLibraryLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getactorslibraryunauthorized.md b/docs/models/sdkerrors/getactorslibraryunauthorized.md deleted file mode 100644 index e6cdcb5..0000000 --- a/docs/models/sdkerrors/getactorslibraryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetActorsLibraryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetActorsLibraryLibraryErrors](../../models/sdkerrors/getactorslibrarylibraryerrors.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/getalllibrariesbadrequest.md b/docs/models/sdkerrors/getalllibrariesbadrequest.md deleted file mode 100644 index a7bb209..0000000 --- a/docs/models/sdkerrors/getalllibrariesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetAllLibrariesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetAllLibrariesErrors](../../models/sdkerrors/getalllibrarieserrors.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/getalllibrarieserrors.md b/docs/models/sdkerrors/getalllibrarieserrors.md deleted file mode 100644 index b0f7426..0000000 --- a/docs/models/sdkerrors/getalllibrarieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAllLibrariesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getalllibrarieslibraryerrors.md b/docs/models/sdkerrors/getalllibrarieslibraryerrors.md deleted file mode 100644 index dd3e91c..0000000 --- a/docs/models/sdkerrors/getalllibrarieslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAllLibrariesLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getalllibrariesunauthorized.md b/docs/models/sdkerrors/getalllibrariesunauthorized.md deleted file mode 100644 index bc68c95..0000000 --- a/docs/models/sdkerrors/getalllibrariesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetAllLibrariesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetAllLibrariesLibraryErrors](../../models/sdkerrors/getalllibrarieslibraryerrors.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/getavailableclientsbadrequest.md b/docs/models/sdkerrors/getavailableclientsbadrequest.md deleted file mode 100644 index 621b1dd..0000000 --- a/docs/models/sdkerrors/getavailableclientsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetAvailableClientsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getavailableclientserrors.md b/docs/models/sdkerrors/getavailableclientserrors.md deleted file mode 100644 index 460be3d..0000000 --- a/docs/models/sdkerrors/getavailableclientserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAvailableClientsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getavailableclientsservererrors.md b/docs/models/sdkerrors/getavailableclientsservererrors.md deleted file mode 100644 index bd7ec55..0000000 --- a/docs/models/sdkerrors/getavailableclientsservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAvailableClientsServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getavailableclientsunauthorized.md b/docs/models/sdkerrors/getavailableclientsunauthorized.md deleted file mode 100644 index bccc4a8..0000000 --- a/docs/models/sdkerrors/getavailableclientsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetAvailableClientsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetAvailableClientsServerErrors](../../models/sdkerrors/getavailableclientsservererrors.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/getbandwidthstatisticsbadrequest.md b/docs/models/sdkerrors/getbandwidthstatisticsbadrequest.md deleted file mode 100644 index e0587e8..0000000 --- a/docs/models/sdkerrors/getbandwidthstatisticsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBandwidthStatisticsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetBandwidthStatisticsErrors](../../models/sdkerrors/getbandwidthstatisticserrors.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/getbandwidthstatisticserrors.md b/docs/models/sdkerrors/getbandwidthstatisticserrors.md deleted file mode 100644 index 69046b5..0000000 --- a/docs/models/sdkerrors/getbandwidthstatisticserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetBandwidthStatisticsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbandwidthstatisticsstatisticserrors.md b/docs/models/sdkerrors/getbandwidthstatisticsstatisticserrors.md deleted file mode 100644 index f2b2eea..0000000 --- a/docs/models/sdkerrors/getbandwidthstatisticsstatisticserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetBandwidthStatisticsStatisticsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbandwidthstatisticsunauthorized.md b/docs/models/sdkerrors/getbandwidthstatisticsunauthorized.md deleted file mode 100644 index 88d3731..0000000 --- a/docs/models/sdkerrors/getbandwidthstatisticsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBandwidthStatisticsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetBandwidthStatisticsStatisticsErrors](../../models/sdkerrors/getbandwidthstatisticsstatisticserrors.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/getbannerimagebadrequest.md b/docs/models/sdkerrors/getbannerimagebadrequest.md deleted file mode 100644 index 26ee7ab..0000000 --- a/docs/models/sdkerrors/getbannerimagebadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBannerImageBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetBannerImageErrors](../../models/sdkerrors/getbannerimageerrors.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/getbannerimageerrors.md b/docs/models/sdkerrors/getbannerimageerrors.md deleted file mode 100644 index 2014a07..0000000 --- a/docs/models/sdkerrors/getbannerimageerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetBannerImageErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbannerimagemediaerrors.md b/docs/models/sdkerrors/getbannerimagemediaerrors.md deleted file mode 100644 index c32025e..0000000 --- a/docs/models/sdkerrors/getbannerimagemediaerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetBannerImageMediaErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbannerimageunauthorized.md b/docs/models/sdkerrors/getbannerimageunauthorized.md deleted file mode 100644 index b84af92..0000000 --- a/docs/models/sdkerrors/getbannerimageunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBannerImageUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetBannerImageMediaErrors](../../models/sdkerrors/getbannerimagemediaerrors.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/getbutlertasksbadrequest.md b/docs/models/sdkerrors/getbutlertasksbadrequest.md deleted file mode 100644 index 43ccaf2..0000000 --- a/docs/models/sdkerrors/getbutlertasksbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetButlerTasksBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getbutlertasksbutlererrors.md b/docs/models/sdkerrors/getbutlertasksbutlererrors.md deleted file mode 100644 index 2130e70..0000000 --- a/docs/models/sdkerrors/getbutlertasksbutlererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetButlerTasksButlerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbutlertaskserrors.md b/docs/models/sdkerrors/getbutlertaskserrors.md deleted file mode 100644 index 61b5247..0000000 --- a/docs/models/sdkerrors/getbutlertaskserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetButlerTasksErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbutlertasksunauthorized.md b/docs/models/sdkerrors/getbutlertasksunauthorized.md deleted file mode 100644 index 2a29e3f..0000000 --- a/docs/models/sdkerrors/getbutlertasksunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetButlerTasksUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetButlerTasksButlerErrors](../../models/sdkerrors/getbutlertasksbutlererrors.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/getcompanionsdatabadrequest.md b/docs/models/sdkerrors/getcompanionsdatabadrequest.md deleted file mode 100644 index f8de402..0000000 --- a/docs/models/sdkerrors/getcompanionsdatabadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCompanionsDataBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetCompanionsDataErrors](../../models/sdkerrors/getcompanionsdataerrors.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/getcompanionsdataerrors.md b/docs/models/sdkerrors/getcompanionsdataerrors.md deleted file mode 100644 index 0a50cf3..0000000 --- a/docs/models/sdkerrors/getcompanionsdataerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCompanionsDataErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getcompanionsdataplexerrors.md b/docs/models/sdkerrors/getcompanionsdataplexerrors.md deleted file mode 100644 index a3f51fd..0000000 --- a/docs/models/sdkerrors/getcompanionsdataplexerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCompanionsDataPlexErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getcompanionsdataunauthorized.md b/docs/models/sdkerrors/getcompanionsdataunauthorized.md deleted file mode 100644 index 3918ca6..0000000 --- a/docs/models/sdkerrors/getcompanionsdataunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCompanionsDataUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetCompanionsDataPlexErrors](../../models/sdkerrors/getcompanionsdataplexerrors.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/getcountrieslibrarybadrequest.md b/docs/models/sdkerrors/getcountrieslibrarybadrequest.md deleted file mode 100644 index bfe733d..0000000 --- a/docs/models/sdkerrors/getcountrieslibrarybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCountriesLibraryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetCountriesLibraryErrors](../../models/sdkerrors/getcountrieslibraryerrors.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/getcountrieslibraryerrors.md b/docs/models/sdkerrors/getcountrieslibraryerrors.md deleted file mode 100644 index 961f35c..0000000 --- a/docs/models/sdkerrors/getcountrieslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCountriesLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getcountrieslibrarylibraryerrors.md b/docs/models/sdkerrors/getcountrieslibrarylibraryerrors.md deleted file mode 100644 index e47a155..0000000 --- a/docs/models/sdkerrors/getcountrieslibrarylibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCountriesLibraryLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getcountrieslibraryunauthorized.md b/docs/models/sdkerrors/getcountrieslibraryunauthorized.md deleted file mode 100644 index d905053..0000000 --- a/docs/models/sdkerrors/getcountrieslibraryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCountriesLibraryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetCountriesLibraryLibraryErrors](../../models/sdkerrors/getcountrieslibrarylibraryerrors.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/getdevicesbadrequest.md b/docs/models/sdkerrors/getdevicesbadrequest.md deleted file mode 100644 index d212d78..0000000 --- a/docs/models/sdkerrors/getdevicesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetDevicesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getdeviceserrors.md b/docs/models/sdkerrors/getdeviceserrors.md deleted file mode 100644 index 1547e4a..0000000 --- a/docs/models/sdkerrors/getdeviceserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetDevicesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getdevicesservererrors.md b/docs/models/sdkerrors/getdevicesservererrors.md deleted file mode 100644 index c7a4387..0000000 --- a/docs/models/sdkerrors/getdevicesservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetDevicesServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getdevicesunauthorized.md b/docs/models/sdkerrors/getdevicesunauthorized.md deleted file mode 100644 index 317aec6..0000000 --- a/docs/models/sdkerrors/getdevicesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetDevicesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetDevicesServerErrors](../../models/sdkerrors/getdevicesservererrors.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/getfilehashbadrequest.md b/docs/models/sdkerrors/getfilehashbadrequest.md deleted file mode 100644 index 42f4e2f..0000000 --- a/docs/models/sdkerrors/getfilehashbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetFileHashBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getfilehasherrors.md b/docs/models/sdkerrors/getfilehasherrors.md deleted file mode 100644 index 33d540f..0000000 --- a/docs/models/sdkerrors/getfilehasherrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetFileHashErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getfilehashlibraryerrors.md b/docs/models/sdkerrors/getfilehashlibraryerrors.md deleted file mode 100644 index 6cbf59b..0000000 --- a/docs/models/sdkerrors/getfilehashlibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetFileHashLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getfilehashunauthorized.md b/docs/models/sdkerrors/getfilehashunauthorized.md deleted file mode 100644 index 4e27e26..0000000 --- a/docs/models/sdkerrors/getfilehashunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetFileHashUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetFileHashLibraryErrors](../../models/sdkerrors/getfilehashlibraryerrors.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/getgenreslibrarybadrequest.md b/docs/models/sdkerrors/getgenreslibrarybadrequest.md deleted file mode 100644 index f26c93e..0000000 --- a/docs/models/sdkerrors/getgenreslibrarybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGenresLibraryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetGenresLibraryErrors](../../models/sdkerrors/getgenreslibraryerrors.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/getgenreslibraryerrors.md b/docs/models/sdkerrors/getgenreslibraryerrors.md deleted file mode 100644 index 6439248..0000000 --- a/docs/models/sdkerrors/getgenreslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGenresLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getgenreslibrarylibraryerrors.md b/docs/models/sdkerrors/getgenreslibrarylibraryerrors.md deleted file mode 100644 index 6e8ccb0..0000000 --- a/docs/models/sdkerrors/getgenreslibrarylibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGenresLibraryLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getgenreslibraryunauthorized.md b/docs/models/sdkerrors/getgenreslibraryunauthorized.md deleted file mode 100644 index 3c8e1d2..0000000 --- a/docs/models/sdkerrors/getgenreslibraryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGenresLibraryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetGenresLibraryLibraryErrors](../../models/sdkerrors/getgenreslibrarylibraryerrors.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/getgeodatabadrequest.md b/docs/models/sdkerrors/getgeodatabadrequest.md deleted file mode 100644 index 4f21227..0000000 --- a/docs/models/sdkerrors/getgeodatabadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGeoDataBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetGeoDataErrors](../../models/sdkerrors/getgeodataerrors.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/getgeodataerrors.md b/docs/models/sdkerrors/getgeodataerrors.md deleted file mode 100644 index 871ef47..0000000 --- a/docs/models/sdkerrors/getgeodataerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGeoDataErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getgeodataplexerrors.md b/docs/models/sdkerrors/getgeodataplexerrors.md deleted file mode 100644 index 355d7ce..0000000 --- a/docs/models/sdkerrors/getgeodataplexerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGeoDataPlexErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getgeodataunauthorized.md b/docs/models/sdkerrors/getgeodataunauthorized.md deleted file mode 100644 index 6edac7d..0000000 --- a/docs/models/sdkerrors/getgeodataunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGeoDataUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetGeoDataPlexErrors](../../models/sdkerrors/getgeodataplexerrors.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/getglobalhubsbadrequest.md b/docs/models/sdkerrors/getglobalhubsbadrequest.md deleted file mode 100644 index b4bdacf..0000000 --- a/docs/models/sdkerrors/getglobalhubsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGlobalHubsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getglobalhubserrors.md b/docs/models/sdkerrors/getglobalhubserrors.md deleted file mode 100644 index 2284407..0000000 --- a/docs/models/sdkerrors/getglobalhubserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGlobalHubsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getglobalhubshubserrors.md b/docs/models/sdkerrors/getglobalhubshubserrors.md deleted file mode 100644 index fe7d759..0000000 --- a/docs/models/sdkerrors/getglobalhubshubserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetGlobalHubsHubsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getglobalhubsunauthorized.md b/docs/models/sdkerrors/getglobalhubsunauthorized.md deleted file mode 100644 index b7a0da7..0000000 --- a/docs/models/sdkerrors/getglobalhubsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGlobalHubsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetGlobalHubsHubsErrors](../../models/sdkerrors/getglobalhubshubserrors.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/gethomedatabadrequest.md b/docs/models/sdkerrors/gethomedatabadrequest.md deleted file mode 100644 index 62e7d99..0000000 --- a/docs/models/sdkerrors/gethomedatabadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetHomeDataBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetHomeDataErrors](../../models/sdkerrors/gethomedataerrors.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/gethomedataerrors.md b/docs/models/sdkerrors/gethomedataerrors.md deleted file mode 100644 index 8c7f478..0000000 --- a/docs/models/sdkerrors/gethomedataerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetHomeDataErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gethomedataplexerrors.md b/docs/models/sdkerrors/gethomedataplexerrors.md deleted file mode 100644 index 64d96b0..0000000 --- a/docs/models/sdkerrors/gethomedataplexerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetHomeDataPlexErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gethomedataunauthorized.md b/docs/models/sdkerrors/gethomedataunauthorized.md deleted file mode 100644 index d2fbd03..0000000 --- a/docs/models/sdkerrors/gethomedataunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetHomeDataUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetHomeDataPlexErrors](../../models/sdkerrors/gethomedataplexerrors.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/getlibrarydetailsbadrequest.md b/docs/models/sdkerrors/getlibrarydetailsbadrequest.md deleted file mode 100644 index 41dd7a6..0000000 --- a/docs/models/sdkerrors/getlibrarydetailsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryDetailsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetLibraryDetailsErrors](../../models/sdkerrors/getlibrarydetailserrors.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/getlibrarydetailserrors.md b/docs/models/sdkerrors/getlibrarydetailserrors.md deleted file mode 100644 index 0a3da0b..0000000 --- a/docs/models/sdkerrors/getlibrarydetailserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryDetailsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibrarydetailslibraryerrors.md b/docs/models/sdkerrors/getlibrarydetailslibraryerrors.md deleted file mode 100644 index a2cfc99..0000000 --- a/docs/models/sdkerrors/getlibrarydetailslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryDetailsLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibrarydetailsunauthorized.md b/docs/models/sdkerrors/getlibrarydetailsunauthorized.md deleted file mode 100644 index 78f2dc7..0000000 --- a/docs/models/sdkerrors/getlibrarydetailsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryDetailsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetLibraryDetailsLibraryErrors](../../models/sdkerrors/getlibrarydetailslibraryerrors.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/getlibraryhubsbadrequest.md b/docs/models/sdkerrors/getlibraryhubsbadrequest.md deleted file mode 100644 index 4b7b352..0000000 --- a/docs/models/sdkerrors/getlibraryhubsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryHubsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getlibraryhubserrors.md b/docs/models/sdkerrors/getlibraryhubserrors.md deleted file mode 100644 index 1953e2c..0000000 --- a/docs/models/sdkerrors/getlibraryhubserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryHubsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryhubshubserrors.md b/docs/models/sdkerrors/getlibraryhubshubserrors.md deleted file mode 100644 index fbd5e84..0000000 --- a/docs/models/sdkerrors/getlibraryhubshubserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryHubsHubsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryhubsunauthorized.md b/docs/models/sdkerrors/getlibraryhubsunauthorized.md deleted file mode 100644 index b53c870..0000000 --- a/docs/models/sdkerrors/getlibraryhubsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryHubsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetLibraryHubsHubsErrors](../../models/sdkerrors/getlibraryhubshubserrors.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/getlibraryitemsbadrequest.md b/docs/models/sdkerrors/getlibraryitemsbadrequest.md deleted file mode 100644 index 058ffb6..0000000 --- a/docs/models/sdkerrors/getlibraryitemsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryItemsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getlibraryitemserrors.md b/docs/models/sdkerrors/getlibraryitemserrors.md deleted file mode 100644 index 37e33e0..0000000 --- a/docs/models/sdkerrors/getlibraryitemserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryitemslibraryerrors.md b/docs/models/sdkerrors/getlibraryitemslibraryerrors.md deleted file mode 100644 index f3c8990..0000000 --- a/docs/models/sdkerrors/getlibraryitemslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibraryItemsLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryitemsunauthorized.md b/docs/models/sdkerrors/getlibraryitemsunauthorized.md deleted file mode 100644 index 27899a8..0000000 --- a/docs/models/sdkerrors/getlibraryitemsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibraryItemsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetLibraryItemsLibraryErrors](../../models/sdkerrors/getlibraryitemslibraryerrors.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/getlibrarysectionsallbadrequest.md b/docs/models/sdkerrors/getlibrarysectionsallbadrequest.md deleted file mode 100644 index 6f2b3d0..0000000 --- a/docs/models/sdkerrors/getlibrarysectionsallbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetLibrarySectionsAllErrors](../../models/sdkerrors/getlibrarysectionsallerrors.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/getlibrarysectionsallerrors.md b/docs/models/sdkerrors/getlibrarysectionsallerrors.md deleted file mode 100644 index 31ededb..0000000 --- a/docs/models/sdkerrors/getlibrarysectionsallerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibrarySectionsAllErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibrarysectionsalllibraryerrors.md b/docs/models/sdkerrors/getlibrarysectionsalllibraryerrors.md deleted file mode 100644 index faad9ce..0000000 --- a/docs/models/sdkerrors/getlibrarysectionsalllibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetLibrarySectionsAllLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibrarysectionsallunauthorized.md b/docs/models/sdkerrors/getlibrarysectionsallunauthorized.md deleted file mode 100644 index 605a073..0000000 --- a/docs/models/sdkerrors/getlibrarysectionsallunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetLibrarySectionsAllUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetLibrarySectionsAllLibraryErrors](../../models/sdkerrors/getlibrarysectionsalllibraryerrors.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/getmediametadatabadrequest.md b/docs/models/sdkerrors/getmediametadatabadrequest.md deleted file mode 100644 index 8f91825..0000000 --- a/docs/models/sdkerrors/getmediametadatabadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaMetaDataBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetMediaMetaDataErrors](../../models/sdkerrors/getmediametadataerrors.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/getmediametadataerrors.md b/docs/models/sdkerrors/getmediametadataerrors.md deleted file mode 100644 index e798c6e..0000000 --- a/docs/models/sdkerrors/getmediametadataerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaMetaDataErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmediametadatalibraryerrors.md b/docs/models/sdkerrors/getmediametadatalibraryerrors.md deleted file mode 100644 index 7f412f9..0000000 --- a/docs/models/sdkerrors/getmediametadatalibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaMetaDataLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmediametadataunauthorized.md b/docs/models/sdkerrors/getmediametadataunauthorized.md deleted file mode 100644 index 24232da..0000000 --- a/docs/models/sdkerrors/getmediametadataunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaMetaDataUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetMediaMetaDataLibraryErrors](../../models/sdkerrors/getmediametadatalibraryerrors.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/getmediaprovidersbadrequest.md b/docs/models/sdkerrors/getmediaprovidersbadrequest.md deleted file mode 100644 index d400730..0000000 --- a/docs/models/sdkerrors/getmediaprovidersbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaProvidersBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetMediaProvidersErrors](../../models/sdkerrors/getmediaproviderserrors.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/getmediaproviderserrors.md b/docs/models/sdkerrors/getmediaproviderserrors.md deleted file mode 100644 index b88b4c4..0000000 --- a/docs/models/sdkerrors/getmediaproviderserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaProvidersErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmediaprovidersservererrors.md b/docs/models/sdkerrors/getmediaprovidersservererrors.md deleted file mode 100644 index 7a37ccb..0000000 --- a/docs/models/sdkerrors/getmediaprovidersservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMediaProvidersServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmediaprovidersunauthorized.md b/docs/models/sdkerrors/getmediaprovidersunauthorized.md deleted file mode 100644 index 505e1e7..0000000 --- a/docs/models/sdkerrors/getmediaprovidersunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMediaProvidersUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetMediaProvidersServerErrors](../../models/sdkerrors/getmediaprovidersservererrors.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/getmetadatachildrenbadrequest.md b/docs/models/sdkerrors/getmetadatachildrenbadrequest.md deleted file mode 100644 index 6221019..0000000 --- a/docs/models/sdkerrors/getmetadatachildrenbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMetadataChildrenBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getmetadatachildrenerrors.md b/docs/models/sdkerrors/getmetadatachildrenerrors.md deleted file mode 100644 index a99c2b1..0000000 --- a/docs/models/sdkerrors/getmetadatachildrenerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMetadataChildrenErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmetadatachildrenlibraryerrors.md b/docs/models/sdkerrors/getmetadatachildrenlibraryerrors.md deleted file mode 100644 index cdc0f6a..0000000 --- a/docs/models/sdkerrors/getmetadatachildrenlibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMetadataChildrenLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmetadatachildrenunauthorized.md b/docs/models/sdkerrors/getmetadatachildrenunauthorized.md deleted file mode 100644 index 03ba4e7..0000000 --- a/docs/models/sdkerrors/getmetadatachildrenunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMetadataChildrenUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetMetadataChildrenLibraryErrors](../../models/sdkerrors/getmetadatachildrenlibraryerrors.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/getmyplexaccountbadrequest.md b/docs/models/sdkerrors/getmyplexaccountbadrequest.md deleted file mode 100644 index fd8865f..0000000 --- a/docs/models/sdkerrors/getmyplexaccountbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMyPlexAccountBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getmyplexaccounterrors.md b/docs/models/sdkerrors/getmyplexaccounterrors.md deleted file mode 100644 index d71f110..0000000 --- a/docs/models/sdkerrors/getmyplexaccounterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMyPlexAccountErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmyplexaccountservererrors.md b/docs/models/sdkerrors/getmyplexaccountservererrors.md deleted file mode 100644 index 90137c9..0000000 --- a/docs/models/sdkerrors/getmyplexaccountservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetMyPlexAccountServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmyplexaccountunauthorized.md b/docs/models/sdkerrors/getmyplexaccountunauthorized.md deleted file mode 100644 index 917cc4b..0000000 --- a/docs/models/sdkerrors/getmyplexaccountunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetMyPlexAccountUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetMyPlexAccountServerErrors](../../models/sdkerrors/getmyplexaccountservererrors.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/getpinbadrequest.md b/docs/models/sdkerrors/getpinbadrequest.md deleted file mode 100644 index 15a741a..0000000 --- a/docs/models/sdkerrors/getpinbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPinBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetPinErrors](../../models/sdkerrors/getpinerrors.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/getpinerrors.md b/docs/models/sdkerrors/getpinerrors.md deleted file mode 100644 index 715f88b..0000000 --- a/docs/models/sdkerrors/getpinerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPinErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistbadrequest.md b/docs/models/sdkerrors/getplaylistbadrequest.md deleted file mode 100644 index 352d14a..0000000 --- a/docs/models/sdkerrors/getplaylistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPlaylistBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getplaylistcontentsbadrequest.md b/docs/models/sdkerrors/getplaylistcontentsbadrequest.md deleted file mode 100644 index 6178b36..0000000 --- a/docs/models/sdkerrors/getplaylistcontentsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPlaylistContentsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getplaylistcontentserrors.md b/docs/models/sdkerrors/getplaylistcontentserrors.md deleted file mode 100644 index 89943f9..0000000 --- a/docs/models/sdkerrors/getplaylistcontentserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistContentsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistcontentsplaylistserrors.md b/docs/models/sdkerrors/getplaylistcontentsplaylistserrors.md deleted file mode 100644 index aae1856..0000000 --- a/docs/models/sdkerrors/getplaylistcontentsplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistContentsPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistcontentsunauthorized.md b/docs/models/sdkerrors/getplaylistcontentsunauthorized.md deleted file mode 100644 index 5b075aa..0000000 --- a/docs/models/sdkerrors/getplaylistcontentsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPlaylistContentsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetPlaylistContentsPlaylistsErrors](../../models/sdkerrors/getplaylistcontentsplaylistserrors.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 deleted file mode 100644 index bdc2ef1..0000000 --- a/docs/models/sdkerrors/getplaylisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistplaylistserrors.md b/docs/models/sdkerrors/getplaylistplaylistserrors.md deleted file mode 100644 index 4e0ff86..0000000 --- a/docs/models/sdkerrors/getplaylistplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistsbadrequest.md b/docs/models/sdkerrors/getplaylistsbadrequest.md deleted file mode 100644 index 669c932..0000000 --- a/docs/models/sdkerrors/getplaylistsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPlaylistsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getplaylistserrors.md b/docs/models/sdkerrors/getplaylistserrors.md deleted file mode 100644 index ffebf0b..0000000 --- a/docs/models/sdkerrors/getplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistsplaylistserrors.md b/docs/models/sdkerrors/getplaylistsplaylistserrors.md deleted file mode 100644 index 484e861..0000000 --- a/docs/models/sdkerrors/getplaylistsplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetPlaylistsPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistsunauthorized.md b/docs/models/sdkerrors/getplaylistsunauthorized.md deleted file mode 100644 index e2f4615..0000000 --- a/docs/models/sdkerrors/getplaylistsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPlaylistsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetPlaylistsPlaylistsErrors](../../models/sdkerrors/getplaylistsplaylistserrors.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/getplaylistunauthorized.md b/docs/models/sdkerrors/getplaylistunauthorized.md deleted file mode 100644 index 40110b3..0000000 --- a/docs/models/sdkerrors/getplaylistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPlaylistUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetPlaylistPlaylistsErrors](../../models/sdkerrors/getplaylistplaylistserrors.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/getrecentlyaddedlibrarybadrequest.md b/docs/models/sdkerrors/getrecentlyaddedlibrarybadrequest.md deleted file mode 100644 index a538e04..0000000 --- a/docs/models/sdkerrors/getrecentlyaddedlibrarybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRecentlyAddedLibraryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetRecentlyAddedLibraryErrors](../../models/sdkerrors/getrecentlyaddedlibraryerrors.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/getrecentlyaddedlibraryerrors.md b/docs/models/sdkerrors/getrecentlyaddedlibraryerrors.md deleted file mode 100644 index 9f27d2c..0000000 --- a/docs/models/sdkerrors/getrecentlyaddedlibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRecentlyAddedLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getrecentlyaddedlibrarylibraryerrors.md b/docs/models/sdkerrors/getrecentlyaddedlibrarylibraryerrors.md deleted file mode 100644 index eb54cad..0000000 --- a/docs/models/sdkerrors/getrecentlyaddedlibrarylibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRecentlyAddedLibraryLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getrecentlyaddedlibraryunauthorized.md b/docs/models/sdkerrors/getrecentlyaddedlibraryunauthorized.md deleted file mode 100644 index 6e60ca5..0000000 --- a/docs/models/sdkerrors/getrecentlyaddedlibraryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRecentlyAddedLibraryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetRecentlyAddedLibraryLibraryErrors](../../models/sdkerrors/getrecentlyaddedlibrarylibraryerrors.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/getrefreshlibrarymetadatabadrequest.md b/docs/models/sdkerrors/getrefreshlibrarymetadatabadrequest.md deleted file mode 100644 index 4cd91a3..0000000 --- a/docs/models/sdkerrors/getrefreshlibrarymetadatabadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRefreshLibraryMetadataBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetRefreshLibraryMetadataErrors](../../models/sdkerrors/getrefreshlibrarymetadataerrors.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/getrefreshlibrarymetadataerrors.md b/docs/models/sdkerrors/getrefreshlibrarymetadataerrors.md deleted file mode 100644 index 35dc553..0000000 --- a/docs/models/sdkerrors/getrefreshlibrarymetadataerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRefreshLibraryMetadataErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getrefreshlibrarymetadatalibraryerrors.md b/docs/models/sdkerrors/getrefreshlibrarymetadatalibraryerrors.md deleted file mode 100644 index 629ed12..0000000 --- a/docs/models/sdkerrors/getrefreshlibrarymetadatalibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetRefreshLibraryMetadataLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getrefreshlibrarymetadataunauthorized.md b/docs/models/sdkerrors/getrefreshlibrarymetadataunauthorized.md deleted file mode 100644 index a4078c7..0000000 --- a/docs/models/sdkerrors/getrefreshlibrarymetadataunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetRefreshLibraryMetadataUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetRefreshLibraryMetadataLibraryErrors](../../models/sdkerrors/getrefreshlibrarymetadatalibraryerrors.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/getresizedphotobadrequest.md b/docs/models/sdkerrors/getresizedphotobadrequest.md deleted file mode 100644 index 3975e5b..0000000 --- a/docs/models/sdkerrors/getresizedphotobadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetResizedPhotoBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getresizedphotoerrors.md b/docs/models/sdkerrors/getresizedphotoerrors.md deleted file mode 100644 index 92b0845..0000000 --- a/docs/models/sdkerrors/getresizedphotoerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetResizedPhotoErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getresizedphotoservererrors.md b/docs/models/sdkerrors/getresizedphotoservererrors.md deleted file mode 100644 index 11134ea..0000000 --- a/docs/models/sdkerrors/getresizedphotoservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetResizedPhotoServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getresizedphotounauthorized.md b/docs/models/sdkerrors/getresizedphotounauthorized.md deleted file mode 100644 index b49b12e..0000000 --- a/docs/models/sdkerrors/getresizedphotounauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetResizedPhotoUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetResizedPhotoServerErrors](../../models/sdkerrors/getresizedphotoservererrors.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/getresourcesstatisticsbadrequest.md b/docs/models/sdkerrors/getresourcesstatisticsbadrequest.md deleted file mode 100644 index ba32fab..0000000 --- a/docs/models/sdkerrors/getresourcesstatisticsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetResourcesStatisticsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetResourcesStatisticsErrors](../../models/sdkerrors/getresourcesstatisticserrors.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/getresourcesstatisticserrors.md b/docs/models/sdkerrors/getresourcesstatisticserrors.md deleted file mode 100644 index b119396..0000000 --- a/docs/models/sdkerrors/getresourcesstatisticserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetResourcesStatisticsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getresourcesstatisticsstatisticserrors.md b/docs/models/sdkerrors/getresourcesstatisticsstatisticserrors.md deleted file mode 100644 index 7f213ed..0000000 --- a/docs/models/sdkerrors/getresourcesstatisticsstatisticserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetResourcesStatisticsStatisticsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getresourcesstatisticsunauthorized.md b/docs/models/sdkerrors/getresourcesstatisticsunauthorized.md deleted file mode 100644 index 71b0b74..0000000 --- a/docs/models/sdkerrors/getresourcesstatisticsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetResourcesStatisticsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetResourcesStatisticsStatisticsErrors](../../models/sdkerrors/getresourcesstatisticsstatisticserrors.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/getsearchalllibrariesbadrequest.md b/docs/models/sdkerrors/getsearchalllibrariesbadrequest.md deleted file mode 100644 index dcdf62f..0000000 --- a/docs/models/sdkerrors/getsearchalllibrariesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetSearchAllLibrariesErrors](../../models/sdkerrors/getsearchalllibrarieserrors.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/getsearchalllibrarieserrors.md b/docs/models/sdkerrors/getsearchalllibrarieserrors.md deleted file mode 100644 index eb50afa..0000000 --- a/docs/models/sdkerrors/getsearchalllibrarieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchalllibrarieslibraryerrors.md b/docs/models/sdkerrors/getsearchalllibrarieslibraryerrors.md deleted file mode 100644 index b0e9344..0000000 --- a/docs/models/sdkerrors/getsearchalllibrarieslibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchAllLibrariesLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchalllibrariesunauthorized.md b/docs/models/sdkerrors/getsearchalllibrariesunauthorized.md deleted file mode 100644 index 855151f..0000000 --- a/docs/models/sdkerrors/getsearchalllibrariesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchAllLibrariesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSearchAllLibrariesLibraryErrors](../../models/sdkerrors/getsearchalllibrarieslibraryerrors.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/getsearchlibrarybadrequest.md b/docs/models/sdkerrors/getsearchlibrarybadrequest.md deleted file mode 100644 index e304da8..0000000 --- a/docs/models/sdkerrors/getsearchlibrarybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchLibraryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSearchLibraryErrors](../../models/sdkerrors/getsearchlibraryerrors.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/getsearchlibraryerrors.md b/docs/models/sdkerrors/getsearchlibraryerrors.md deleted file mode 100644 index a836685..0000000 --- a/docs/models/sdkerrors/getsearchlibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchlibrarylibraryerrors.md b/docs/models/sdkerrors/getsearchlibrarylibraryerrors.md deleted file mode 100644 index 57acd9b..0000000 --- a/docs/models/sdkerrors/getsearchlibrarylibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchLibraryLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchlibraryunauthorized.md b/docs/models/sdkerrors/getsearchlibraryunauthorized.md deleted file mode 100644 index b801d4e..0000000 --- a/docs/models/sdkerrors/getsearchlibraryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchLibraryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSearchLibraryLibraryErrors](../../models/sdkerrors/getsearchlibrarylibraryerrors.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/getsearchresultsbadrequest.md b/docs/models/sdkerrors/getsearchresultsbadrequest.md deleted file mode 100644 index 65f791c..0000000 --- a/docs/models/sdkerrors/getsearchresultsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchResultsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getsearchresultserrors.md b/docs/models/sdkerrors/getsearchresultserrors.md deleted file mode 100644 index 74046d5..0000000 --- a/docs/models/sdkerrors/getsearchresultserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchResultsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchresultssearcherrors.md b/docs/models/sdkerrors/getsearchresultssearcherrors.md deleted file mode 100644 index ca92d64..0000000 --- a/docs/models/sdkerrors/getsearchresultssearcherrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSearchResultsSearchErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchresultsunauthorized.md b/docs/models/sdkerrors/getsearchresultsunauthorized.md deleted file mode 100644 index bc4c8f6..0000000 --- a/docs/models/sdkerrors/getsearchresultsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSearchResultsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSearchResultsSearchErrors](../../models/sdkerrors/getsearchresultssearcherrors.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/getserveractivitiesactivitieserrors.md b/docs/models/sdkerrors/getserveractivitiesactivitieserrors.md deleted file mode 100644 index 416e75c..0000000 --- a/docs/models/sdkerrors/getserveractivitiesactivitieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerActivitiesActivitiesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserveractivitiesbadrequest.md b/docs/models/sdkerrors/getserveractivitiesbadrequest.md deleted file mode 100644 index a447b31..0000000 --- a/docs/models/sdkerrors/getserveractivitiesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerActivitiesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getserveractivitieserrors.md b/docs/models/sdkerrors/getserveractivitieserrors.md deleted file mode 100644 index 0e498ea..0000000 --- a/docs/models/sdkerrors/getserveractivitieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerActivitiesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserveractivitiesunauthorized.md b/docs/models/sdkerrors/getserveractivitiesunauthorized.md deleted file mode 100644 index 0b1ad08..0000000 --- a/docs/models/sdkerrors/getserveractivitiesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerActivitiesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetServerActivitiesActivitiesErrors](../../models/sdkerrors/getserveractivitiesactivitieserrors.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/getservercapabilitiesbadrequest.md b/docs/models/sdkerrors/getservercapabilitiesbadrequest.md deleted file mode 100644 index b985f9c..0000000 --- a/docs/models/sdkerrors/getservercapabilitiesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerCapabilitiesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getservercapabilitieserrors.md b/docs/models/sdkerrors/getservercapabilitieserrors.md deleted file mode 100644 index 95edbff..0000000 --- a/docs/models/sdkerrors/getservercapabilitieserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerCapabilitiesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getservercapabilitiesunauthorized.md b/docs/models/sdkerrors/getservercapabilitiesunauthorized.md deleted file mode 100644 index 6c7ecd3..0000000 --- a/docs/models/sdkerrors/getservercapabilitiesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerCapabilitiesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetServerCapabilitiesErrors](../../models/sdkerrors/getservercapabilitieserrors.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/getserveridentityrequesttimeout.md b/docs/models/sdkerrors/getserveridentityrequesttimeout.md deleted file mode 100644 index 0212234..0000000 --- a/docs/models/sdkerrors/getserveridentityrequesttimeout.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetServerIdentityRequestTimeout - -Request Timeout - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 408 | -| `Message` | **string* | :heavy_minus_sign: | N/A | The server timed out waiting for the request. | -| `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/getserverlistbadrequest.md b/docs/models/sdkerrors/getserverlistbadrequest.md deleted file mode 100644 index 1fc726e..0000000 --- a/docs/models/sdkerrors/getserverlistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerListBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getserverlisterrors.md b/docs/models/sdkerrors/getserverlisterrors.md deleted file mode 100644 index bd5d421..0000000 --- a/docs/models/sdkerrors/getserverlisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerListErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverlistservererrors.md b/docs/models/sdkerrors/getserverlistservererrors.md deleted file mode 100644 index 9bafbaa..0000000 --- a/docs/models/sdkerrors/getserverlistservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerListServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverlistunauthorized.md b/docs/models/sdkerrors/getserverlistunauthorized.md deleted file mode 100644 index 1529223..0000000 --- a/docs/models/sdkerrors/getserverlistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerListUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetServerListServerErrors](../../models/sdkerrors/getserverlistservererrors.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/getserverpreferencesbadrequest.md b/docs/models/sdkerrors/getserverpreferencesbadrequest.md deleted file mode 100644 index e86d847..0000000 --- a/docs/models/sdkerrors/getserverpreferencesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerPreferencesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getserverpreferenceserrors.md b/docs/models/sdkerrors/getserverpreferenceserrors.md deleted file mode 100644 index cdfed96..0000000 --- a/docs/models/sdkerrors/getserverpreferenceserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerPreferencesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverpreferencesservererrors.md b/docs/models/sdkerrors/getserverpreferencesservererrors.md deleted file mode 100644 index af4b2c0..0000000 --- a/docs/models/sdkerrors/getserverpreferencesservererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerPreferencesServerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverpreferencesunauthorized.md b/docs/models/sdkerrors/getserverpreferencesunauthorized.md deleted file mode 100644 index 7435daf..0000000 --- a/docs/models/sdkerrors/getserverpreferencesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerPreferencesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetServerPreferencesServerErrors](../../models/sdkerrors/getserverpreferencesservererrors.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/getserverresourcesbadrequest.md b/docs/models/sdkerrors/getserverresourcesbadrequest.md deleted file mode 100644 index b2f2051..0000000 --- a/docs/models/sdkerrors/getserverresourcesbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerResourcesBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetServerResourcesErrors](../../models/sdkerrors/getserverresourceserrors.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/getserverresourceserrors.md b/docs/models/sdkerrors/getserverresourceserrors.md deleted file mode 100644 index 5053e91..0000000 --- a/docs/models/sdkerrors/getserverresourceserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerResourcesErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverresourcesplexerrors.md b/docs/models/sdkerrors/getserverresourcesplexerrors.md deleted file mode 100644 index b300366..0000000 --- a/docs/models/sdkerrors/getserverresourcesplexerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetServerResourcesPlexErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverresourcesunauthorized.md b/docs/models/sdkerrors/getserverresourcesunauthorized.md deleted file mode 100644 index f6ffb8c..0000000 --- a/docs/models/sdkerrors/getserverresourcesunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetServerResourcesUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetServerResourcesPlexErrors](../../models/sdkerrors/getserverresourcesplexerrors.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/getsessionhistorybadrequest.md b/docs/models/sdkerrors/getsessionhistorybadrequest.md deleted file mode 100644 index 5bb7dd6..0000000 --- a/docs/models/sdkerrors/getsessionhistorybadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSessionHistoryBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getsessionhistoryerrors.md b/docs/models/sdkerrors/getsessionhistoryerrors.md deleted file mode 100644 index 84e509c..0000000 --- a/docs/models/sdkerrors/getsessionhistoryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionHistoryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionhistorysessionserrors.md b/docs/models/sdkerrors/getsessionhistorysessionserrors.md deleted file mode 100644 index 884cedb..0000000 --- a/docs/models/sdkerrors/getsessionhistorysessionserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionHistorySessionsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionhistoryunauthorized.md b/docs/models/sdkerrors/getsessionhistoryunauthorized.md deleted file mode 100644 index 5fbd86d..0000000 --- a/docs/models/sdkerrors/getsessionhistoryunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSessionHistoryUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSessionHistorySessionsErrors](../../models/sdkerrors/getsessionhistorysessionserrors.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/getsessionsbadrequest.md b/docs/models/sdkerrors/getsessionsbadrequest.md deleted file mode 100644 index d848b35..0000000 --- a/docs/models/sdkerrors/getsessionsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSessionsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getsessionserrors.md b/docs/models/sdkerrors/getsessionserrors.md deleted file mode 100644 index 6ebe8e8..0000000 --- a/docs/models/sdkerrors/getsessionserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionssessionserrors.md b/docs/models/sdkerrors/getsessionssessionserrors.md deleted file mode 100644 index 6b5d5a4..0000000 --- a/docs/models/sdkerrors/getsessionssessionserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSessionsSessionsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionsunauthorized.md b/docs/models/sdkerrors/getsessionsunauthorized.md deleted file mode 100644 index 1850518..0000000 --- a/docs/models/sdkerrors/getsessionsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSessionsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSessionsSessionsErrors](../../models/sdkerrors/getsessionssessionserrors.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/getsourceconnectioninformationauthenticationerrors.md b/docs/models/sdkerrors/getsourceconnectioninformationauthenticationerrors.md deleted file mode 100644 index 75ef4fc..0000000 --- a/docs/models/sdkerrors/getsourceconnectioninformationauthenticationerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSourceConnectionInformationAuthenticationErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsourceconnectioninformationbadrequest.md b/docs/models/sdkerrors/getsourceconnectioninformationbadrequest.md deleted file mode 100644 index fdcb737..0000000 --- a/docs/models/sdkerrors/getsourceconnectioninformationbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSourceConnectionInformationBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getsourceconnectioninformationerrors.md b/docs/models/sdkerrors/getsourceconnectioninformationerrors.md deleted file mode 100644 index cd6ae95..0000000 --- a/docs/models/sdkerrors/getsourceconnectioninformationerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetSourceConnectionInformationErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsourceconnectioninformationunauthorized.md b/docs/models/sdkerrors/getsourceconnectioninformationunauthorized.md deleted file mode 100644 index 4a3fb65..0000000 --- a/docs/models/sdkerrors/getsourceconnectioninformationunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSourceConnectionInformationUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetSourceConnectionInformationAuthenticationErrors](../../models/sdkerrors/getsourceconnectioninformationauthenticationerrors.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/getstatisticsbadrequest.md b/docs/models/sdkerrors/getstatisticsbadrequest.md deleted file mode 100644 index 6f18e20..0000000 --- a/docs/models/sdkerrors/getstatisticsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetStatisticsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetStatisticsErrors](../../models/sdkerrors/getstatisticserrors.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/getstatisticserrors.md b/docs/models/sdkerrors/getstatisticserrors.md deleted file mode 100644 index 9c670a4..0000000 --- a/docs/models/sdkerrors/getstatisticserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetStatisticsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getstatisticsstatisticserrors.md b/docs/models/sdkerrors/getstatisticsstatisticserrors.md deleted file mode 100644 index cdd0037..0000000 --- a/docs/models/sdkerrors/getstatisticsstatisticserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetStatisticsStatisticsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getstatisticsunauthorized.md b/docs/models/sdkerrors/getstatisticsunauthorized.md deleted file mode 100644 index 5b42edb..0000000 --- a/docs/models/sdkerrors/getstatisticsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetStatisticsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetStatisticsStatisticsErrors](../../models/sdkerrors/getstatisticsstatisticserrors.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/getthumbimagebadrequest.md b/docs/models/sdkerrors/getthumbimagebadrequest.md deleted file mode 100644 index 4f6d243..0000000 --- a/docs/models/sdkerrors/getthumbimagebadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetThumbImageBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetThumbImageErrors](../../models/sdkerrors/getthumbimageerrors.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/getthumbimageerrors.md b/docs/models/sdkerrors/getthumbimageerrors.md deleted file mode 100644 index d7c0b6a..0000000 --- a/docs/models/sdkerrors/getthumbimageerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetThumbImageErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getthumbimagemediaerrors.md b/docs/models/sdkerrors/getthumbimagemediaerrors.md deleted file mode 100644 index 3c96ca1..0000000 --- a/docs/models/sdkerrors/getthumbimagemediaerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetThumbImageMediaErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getthumbimageunauthorized.md b/docs/models/sdkerrors/getthumbimageunauthorized.md deleted file mode 100644 index 2637833..0000000 --- a/docs/models/sdkerrors/getthumbimageunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetThumbImageUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetThumbImageMediaErrors](../../models/sdkerrors/getthumbimagemediaerrors.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/gettimelinebadrequest.md b/docs/models/sdkerrors/gettimelinebadrequest.md deleted file mode 100644 index 3076a90..0000000 --- a/docs/models/sdkerrors/gettimelinebadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTimelineBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/gettimelineerrors.md b/docs/models/sdkerrors/gettimelineerrors.md deleted file mode 100644 index d029272..0000000 --- a/docs/models/sdkerrors/gettimelineerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTimelineErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettimelineunauthorized.md b/docs/models/sdkerrors/gettimelineunauthorized.md deleted file mode 100644 index 3a7e50e..0000000 --- a/docs/models/sdkerrors/gettimelineunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTimelineUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetTimelineVideoErrors](../../models/sdkerrors/gettimelinevideoerrors.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/gettimelinevideoerrors.md b/docs/models/sdkerrors/gettimelinevideoerrors.md deleted file mode 100644 index ebbf7c9..0000000 --- a/docs/models/sdkerrors/gettimelinevideoerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTimelineVideoErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettokenbypinidbadrequest.md b/docs/models/sdkerrors/gettokenbypinidbadrequest.md deleted file mode 100644 index b941abb..0000000 --- a/docs/models/sdkerrors/gettokenbypinidbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenByPinIDBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetTokenByPinIDErrors](../../models/sdkerrors/gettokenbypiniderrors.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/gettokenbypiniderrors.md b/docs/models/sdkerrors/gettokenbypiniderrors.md deleted file mode 100644 index 8c2441d..0000000 --- a/docs/models/sdkerrors/gettokenbypiniderrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTokenByPinIDErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettokenbypinidplexerrors.md b/docs/models/sdkerrors/gettokenbypinidplexerrors.md deleted file mode 100644 index d443c60..0000000 --- a/docs/models/sdkerrors/gettokenbypinidplexerrors.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetTokenByPinIDPlexErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `Code` | **int64* | :heavy_minus_sign: | N/A | 1020 | -| `Message` | **string* | :heavy_minus_sign: | N/A | Code not found or expired | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettokenbypinidresponsebody.md b/docs/models/sdkerrors/gettokenbypinidresponsebody.md deleted file mode 100644 index 4147162..0000000 --- a/docs/models/sdkerrors/gettokenbypinidresponsebody.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenByPinIDResponseBody - -Not Found or Expired - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetTokenByPinIDPlexErrors](../../models/sdkerrors/gettokenbypinidplexerrors.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/gettokendetailsauthenticationerrors.md b/docs/models/sdkerrors/gettokendetailsauthenticationerrors.md deleted file mode 100644 index ce31930..0000000 --- a/docs/models/sdkerrors/gettokendetailsauthenticationerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTokenDetailsAuthenticationErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettokendetailsbadrequest.md b/docs/models/sdkerrors/gettokendetailsbadrequest.md deleted file mode 100644 index 85cd538..0000000 --- a/docs/models/sdkerrors/gettokendetailsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenDetailsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetTokenDetailsErrors](../../models/sdkerrors/gettokendetailserrors.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/gettokendetailserrors.md b/docs/models/sdkerrors/gettokendetailserrors.md deleted file mode 100644 index a3c0306..0000000 --- a/docs/models/sdkerrors/gettokendetailserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTokenDetailsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettokendetailsunauthorized.md b/docs/models/sdkerrors/gettokendetailsunauthorized.md deleted file mode 100644 index 1594e57..0000000 --- a/docs/models/sdkerrors/gettokendetailsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTokenDetailsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetTokenDetailsAuthenticationErrors](../../models/sdkerrors/gettokendetailsauthenticationerrors.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/gettopwatchedcontentbadrequest.md b/docs/models/sdkerrors/gettopwatchedcontentbadrequest.md deleted file mode 100644 index 3bdf2c2..0000000 --- a/docs/models/sdkerrors/gettopwatchedcontentbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTopWatchedContentBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetTopWatchedContentErrors](../../models/sdkerrors/gettopwatchedcontenterrors.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/gettopwatchedcontenterrors.md b/docs/models/sdkerrors/gettopwatchedcontenterrors.md deleted file mode 100644 index 384c22e..0000000 --- a/docs/models/sdkerrors/gettopwatchedcontenterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTopWatchedContentErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettopwatchedcontentlibraryerrors.md b/docs/models/sdkerrors/gettopwatchedcontentlibraryerrors.md deleted file mode 100644 index bf07003..0000000 --- a/docs/models/sdkerrors/gettopwatchedcontentlibraryerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTopWatchedContentLibraryErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettopwatchedcontentunauthorized.md b/docs/models/sdkerrors/gettopwatchedcontentunauthorized.md deleted file mode 100644 index 0b5e7d4..0000000 --- a/docs/models/sdkerrors/gettopwatchedcontentunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTopWatchedContentUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetTopWatchedContentLibraryErrors](../../models/sdkerrors/gettopwatchedcontentlibraryerrors.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/gettranscodesessionsbadrequest.md b/docs/models/sdkerrors/gettranscodesessionsbadrequest.md deleted file mode 100644 index 9a53c8c..0000000 --- a/docs/models/sdkerrors/gettranscodesessionsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTranscodeSessionsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/gettranscodesessionserrors.md b/docs/models/sdkerrors/gettranscodesessionserrors.md deleted file mode 100644 index 7f56db3..0000000 --- a/docs/models/sdkerrors/gettranscodesessionserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTranscodeSessionsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettranscodesessionssessionserrors.md b/docs/models/sdkerrors/gettranscodesessionssessionserrors.md deleted file mode 100644 index 14fb4a8..0000000 --- a/docs/models/sdkerrors/gettranscodesessionssessionserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTranscodeSessionsSessionsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettranscodesessionsunauthorized.md b/docs/models/sdkerrors/gettranscodesessionsunauthorized.md deleted file mode 100644 index f99c3b3..0000000 --- a/docs/models/sdkerrors/gettranscodesessionsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTranscodeSessionsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetTranscodeSessionsSessionsErrors](../../models/sdkerrors/gettranscodesessionssessionserrors.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/gettransienttokenauthenticationerrors.md b/docs/models/sdkerrors/gettransienttokenauthenticationerrors.md deleted file mode 100644 index 0b95b58..0000000 --- a/docs/models/sdkerrors/gettransienttokenauthenticationerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTransientTokenAuthenticationErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettransienttokenbadrequest.md b/docs/models/sdkerrors/gettransienttokenbadrequest.md deleted file mode 100644 index fce1e90..0000000 --- a/docs/models/sdkerrors/gettransienttokenbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTransientTokenBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/gettransienttokenerrors.md b/docs/models/sdkerrors/gettransienttokenerrors.md deleted file mode 100644 index dd28e0a..0000000 --- a/docs/models/sdkerrors/gettransienttokenerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTransientTokenErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettransienttokenunauthorized.md b/docs/models/sdkerrors/gettransienttokenunauthorized.md deleted file mode 100644 index 2c93c4f..0000000 --- a/docs/models/sdkerrors/gettransienttokenunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTransientTokenUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetTransientTokenAuthenticationErrors](../../models/sdkerrors/gettransienttokenauthenticationerrors.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/getupdatestatusbadrequest.md b/docs/models/sdkerrors/getupdatestatusbadrequest.md deleted file mode 100644 index 29aac6c..0000000 --- a/docs/models/sdkerrors/getupdatestatusbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUpdateStatusBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/getupdatestatuserrors.md b/docs/models/sdkerrors/getupdatestatuserrors.md deleted file mode 100644 index 3d3aea4..0000000 --- a/docs/models/sdkerrors/getupdatestatuserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUpdateStatusErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getupdatestatusunauthorized.md b/docs/models/sdkerrors/getupdatestatusunauthorized.md deleted file mode 100644 index c45d216..0000000 --- a/docs/models/sdkerrors/getupdatestatusunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUpdateStatusUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetUpdateStatusUpdaterErrors](../../models/sdkerrors/getupdatestatusupdatererrors.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/getupdatestatusupdatererrors.md b/docs/models/sdkerrors/getupdatestatusupdatererrors.md deleted file mode 100644 index d596d6b..0000000 --- a/docs/models/sdkerrors/getupdatestatusupdatererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUpdateStatusUpdaterErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getuserfriendsbadrequest.md b/docs/models/sdkerrors/getuserfriendsbadrequest.md deleted file mode 100644 index 39b371b..0000000 --- a/docs/models/sdkerrors/getuserfriendsbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserFriendsBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetUserFriendsErrors](../../models/sdkerrors/getuserfriendserrors.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/getuserfriendserrors.md b/docs/models/sdkerrors/getuserfriendserrors.md deleted file mode 100644 index 85930c7..0000000 --- a/docs/models/sdkerrors/getuserfriendserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUserFriendsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getuserfriendsplexerrors.md b/docs/models/sdkerrors/getuserfriendsplexerrors.md deleted file mode 100644 index 59e112b..0000000 --- a/docs/models/sdkerrors/getuserfriendsplexerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUserFriendsPlexErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getuserfriendsunauthorized.md b/docs/models/sdkerrors/getuserfriendsunauthorized.md deleted file mode 100644 index 08c856d..0000000 --- a/docs/models/sdkerrors/getuserfriendsunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserFriendsUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetUserFriendsPlexErrors](../../models/sdkerrors/getuserfriendsplexerrors.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/getusersbadrequest.md b/docs/models/sdkerrors/getusersbadrequest.md deleted file mode 100644 index 7395603..0000000 --- a/docs/models/sdkerrors/getusersbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUsersBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetUsersErrors](../../models/sdkerrors/getuserserrors.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/getuserserrors.md b/docs/models/sdkerrors/getuserserrors.md deleted file mode 100644 index 8ef7e64..0000000 --- a/docs/models/sdkerrors/getuserserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUsersErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getusersunauthorized.md b/docs/models/sdkerrors/getusersunauthorized.md deleted file mode 100644 index 04aa34c..0000000 --- a/docs/models/sdkerrors/getusersunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUsersUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.GetUsersUsersErrors](../../models/sdkerrors/getusersuserserrors.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/getusersuserserrors.md b/docs/models/sdkerrors/getusersuserserrors.md deleted file mode 100644 index 71d8b31..0000000 --- a/docs/models/sdkerrors/getusersuserserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetUsersUsersErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getwatchlistbadrequest.md b/docs/models/sdkerrors/getwatchlistbadrequest.md deleted file mode 100644 index f07a9da..0000000 --- a/docs/models/sdkerrors/getwatchlistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetWatchListBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetWatchListErrors](../../models/sdkerrors/getwatchlisterrors.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/getwatchlisterrors.md b/docs/models/sdkerrors/getwatchlisterrors.md deleted file mode 100644 index 826f587..0000000 --- a/docs/models/sdkerrors/getwatchlisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetWatchListErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getwatchlistunauthorized.md b/docs/models/sdkerrors/getwatchlistunauthorized.md deleted file mode 100644 index 5cbdf45..0000000 --- a/docs/models/sdkerrors/getwatchlistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetWatchListUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.GetWatchListWatchlistErrors](../../models/sdkerrors/getwatchlistwatchlisterrors.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/getwatchlistwatchlisterrors.md b/docs/models/sdkerrors/getwatchlistwatchlisterrors.md deleted file mode 100644 index 4738ae5..0000000 --- a/docs/models/sdkerrors/getwatchlistwatchlisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetWatchListWatchlistErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/loglinebadrequest.md b/docs/models/sdkerrors/loglinebadrequest.md deleted file mode 100644 index f3e25fd..0000000 --- a/docs/models/sdkerrors/loglinebadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# LogLineBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/loglineerrors.md b/docs/models/sdkerrors/loglineerrors.md deleted file mode 100644 index 8e9babc..0000000 --- a/docs/models/sdkerrors/loglineerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# LogLineErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/loglinelogerrors.md b/docs/models/sdkerrors/loglinelogerrors.md deleted file mode 100644 index 4831800..0000000 --- a/docs/models/sdkerrors/loglinelogerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# LogLineLogErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/loglineunauthorized.md b/docs/models/sdkerrors/loglineunauthorized.md deleted file mode 100644 index 71ceaff..0000000 --- a/docs/models/sdkerrors/loglineunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# LogLineUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.LogLineLogErrors](../../models/sdkerrors/loglinelogerrors.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/logmultilinebadrequest.md b/docs/models/sdkerrors/logmultilinebadrequest.md deleted file mode 100644 index 0160c23..0000000 --- a/docs/models/sdkerrors/logmultilinebadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# LogMultiLineBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/logmultilineerrors.md b/docs/models/sdkerrors/logmultilineerrors.md deleted file mode 100644 index 64ffbb3..0000000 --- a/docs/models/sdkerrors/logmultilineerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# LogMultiLineErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/logmultilinelogerrors.md b/docs/models/sdkerrors/logmultilinelogerrors.md deleted file mode 100644 index c5b4289..0000000 --- a/docs/models/sdkerrors/logmultilinelogerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# LogMultiLineLogErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/logmultilineunauthorized.md b/docs/models/sdkerrors/logmultilineunauthorized.md deleted file mode 100644 index 0b52e1e..0000000 --- a/docs/models/sdkerrors/logmultilineunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# LogMultiLineUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.LogMultiLineLogErrors](../../models/sdkerrors/logmultilinelogerrors.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/markplayedbadrequest.md b/docs/models/sdkerrors/markplayedbadrequest.md deleted file mode 100644 index 82995bb..0000000 --- a/docs/models/sdkerrors/markplayedbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# MarkPlayedBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/markplayederrors.md b/docs/models/sdkerrors/markplayederrors.md deleted file mode 100644 index 24a58d5..0000000 --- a/docs/models/sdkerrors/markplayederrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# MarkPlayedErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/markplayedmediaerrors.md b/docs/models/sdkerrors/markplayedmediaerrors.md deleted file mode 100644 index 6fed949..0000000 --- a/docs/models/sdkerrors/markplayedmediaerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# MarkPlayedMediaErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/markplayedunauthorized.md b/docs/models/sdkerrors/markplayedunauthorized.md deleted file mode 100644 index b55f9a4..0000000 --- a/docs/models/sdkerrors/markplayedunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# MarkPlayedUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.MarkPlayedMediaErrors](../../models/sdkerrors/markplayedmediaerrors.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/markunplayedbadrequest.md b/docs/models/sdkerrors/markunplayedbadrequest.md deleted file mode 100644 index 626e662..0000000 --- a/docs/models/sdkerrors/markunplayedbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# MarkUnplayedBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/markunplayederrors.md b/docs/models/sdkerrors/markunplayederrors.md deleted file mode 100644 index 3ebaa92..0000000 --- a/docs/models/sdkerrors/markunplayederrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# MarkUnplayedErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/markunplayedmediaerrors.md b/docs/models/sdkerrors/markunplayedmediaerrors.md deleted file mode 100644 index 81323c6..0000000 --- a/docs/models/sdkerrors/markunplayedmediaerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# MarkUnplayedMediaErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/markunplayedunauthorized.md b/docs/models/sdkerrors/markunplayedunauthorized.md deleted file mode 100644 index 2b3b12b..0000000 --- a/docs/models/sdkerrors/markunplayedunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# MarkUnplayedUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.MarkUnplayedMediaErrors](../../models/sdkerrors/markunplayedmediaerrors.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/performsearchbadrequest.md b/docs/models/sdkerrors/performsearchbadrequest.md deleted file mode 100644 index 2d78050..0000000 --- a/docs/models/sdkerrors/performsearchbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# PerformSearchBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/performsearcherrors.md b/docs/models/sdkerrors/performsearcherrors.md deleted file mode 100644 index 126ca41..0000000 --- a/docs/models/sdkerrors/performsearcherrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# PerformSearchErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/performsearchsearcherrors.md b/docs/models/sdkerrors/performsearchsearcherrors.md deleted file mode 100644 index 9dbb9d3..0000000 --- a/docs/models/sdkerrors/performsearchsearcherrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# PerformSearchSearchErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/performsearchunauthorized.md b/docs/models/sdkerrors/performsearchunauthorized.md deleted file mode 100644 index 3945ab7..0000000 --- a/docs/models/sdkerrors/performsearchunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# PerformSearchUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.PerformSearchSearchErrors](../../models/sdkerrors/performsearchsearcherrors.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/performvoicesearchbadrequest.md b/docs/models/sdkerrors/performvoicesearchbadrequest.md deleted file mode 100644 index 2fa18b0..0000000 --- a/docs/models/sdkerrors/performvoicesearchbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# PerformVoiceSearchBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/performvoicesearcherrors.md b/docs/models/sdkerrors/performvoicesearcherrors.md deleted file mode 100644 index bd70529..0000000 --- a/docs/models/sdkerrors/performvoicesearcherrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# PerformVoiceSearchErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/performvoicesearchsearcherrors.md b/docs/models/sdkerrors/performvoicesearchsearcherrors.md deleted file mode 100644 index 55279b6..0000000 --- a/docs/models/sdkerrors/performvoicesearchsearcherrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# PerformVoiceSearchSearchErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/performvoicesearchunauthorized.md b/docs/models/sdkerrors/performvoicesearchunauthorized.md deleted file mode 100644 index 70bc83b..0000000 --- a/docs/models/sdkerrors/performvoicesearchunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# PerformVoiceSearchUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.PerformVoiceSearchSearchErrors](../../models/sdkerrors/performvoicesearchsearcherrors.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/postuserssignindataauthenticationerrors.md b/docs/models/sdkerrors/postuserssignindataauthenticationerrors.md deleted file mode 100644 index bd72f3a..0000000 --- a/docs/models/sdkerrors/postuserssignindataauthenticationerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# PostUsersSignInDataAuthenticationErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/postuserssignindatabadrequest.md b/docs/models/sdkerrors/postuserssignindatabadrequest.md deleted file mode 100644 index 9110f5f..0000000 --- a/docs/models/sdkerrors/postuserssignindatabadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.PostUsersSignInDataErrors](../../models/sdkerrors/postuserssignindataerrors.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/postuserssignindataerrors.md b/docs/models/sdkerrors/postuserssignindataerrors.md deleted file mode 100644 index 42de438..0000000 --- a/docs/models/sdkerrors/postuserssignindataerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# PostUsersSignInDataErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/postuserssignindataunauthorized.md b/docs/models/sdkerrors/postuserssignindataunauthorized.md deleted file mode 100644 index dc6ee6b..0000000 --- a/docs/models/sdkerrors/postuserssignindataunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostUsersSignInDataUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.PostUsersSignInDataAuthenticationErrors](../../models/sdkerrors/postuserssignindataauthenticationerrors.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/startalltasksbadrequest.md b/docs/models/sdkerrors/startalltasksbadrequest.md deleted file mode 100644 index 1ed025d..0000000 --- a/docs/models/sdkerrors/startalltasksbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# StartAllTasksBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/startalltasksbutlererrors.md b/docs/models/sdkerrors/startalltasksbutlererrors.md deleted file mode 100644 index 05fb7f9..0000000 --- a/docs/models/sdkerrors/startalltasksbutlererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartAllTasksButlerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/startalltaskserrors.md b/docs/models/sdkerrors/startalltaskserrors.md deleted file mode 100644 index 5384e8a..0000000 --- a/docs/models/sdkerrors/startalltaskserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartAllTasksErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/startalltasksunauthorized.md b/docs/models/sdkerrors/startalltasksunauthorized.md deleted file mode 100644 index 80f84eb..0000000 --- a/docs/models/sdkerrors/startalltasksunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# StartAllTasksUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.StartAllTasksButlerErrors](../../models/sdkerrors/startalltasksbutlererrors.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/starttaskbadrequest.md b/docs/models/sdkerrors/starttaskbadrequest.md deleted file mode 100644 index 7d7609a..0000000 --- a/docs/models/sdkerrors/starttaskbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# StartTaskBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/starttaskbutlererrors.md b/docs/models/sdkerrors/starttaskbutlererrors.md deleted file mode 100644 index 0ba01b7..0000000 --- a/docs/models/sdkerrors/starttaskbutlererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartTaskButlerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/starttaskerrors.md b/docs/models/sdkerrors/starttaskerrors.md deleted file mode 100644 index f723769..0000000 --- a/docs/models/sdkerrors/starttaskerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartTaskErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/starttaskunauthorized.md b/docs/models/sdkerrors/starttaskunauthorized.md deleted file mode 100644 index 1c81b05..0000000 --- a/docs/models/sdkerrors/starttaskunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# StartTaskUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.StartTaskButlerErrors](../../models/sdkerrors/starttaskbutlererrors.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/startuniversaltranscodebadrequest.md b/docs/models/sdkerrors/startuniversaltranscodebadrequest.md deleted file mode 100644 index 799a84a..0000000 --- a/docs/models/sdkerrors/startuniversaltranscodebadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# StartUniversalTranscodeBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/startuniversaltranscodeerrors.md b/docs/models/sdkerrors/startuniversaltranscodeerrors.md deleted file mode 100644 index 94d9a42..0000000 --- a/docs/models/sdkerrors/startuniversaltranscodeerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartUniversalTranscodeErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/startuniversaltranscodeunauthorized.md b/docs/models/sdkerrors/startuniversaltranscodeunauthorized.md deleted file mode 100644 index 15ce155..0000000 --- a/docs/models/sdkerrors/startuniversaltranscodeunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# StartUniversalTranscodeUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.StartUniversalTranscodeVideoErrors](../../models/sdkerrors/startuniversaltranscodevideoerrors.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/startuniversaltranscodevideoerrors.md b/docs/models/sdkerrors/startuniversaltranscodevideoerrors.md deleted file mode 100644 index c8e9464..0000000 --- a/docs/models/sdkerrors/startuniversaltranscodevideoerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StartUniversalTranscodeVideoErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stopalltasksbadrequest.md b/docs/models/sdkerrors/stopalltasksbadrequest.md deleted file mode 100644 index 3716107..0000000 --- a/docs/models/sdkerrors/stopalltasksbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# StopAllTasksBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/stopalltasksbutlererrors.md b/docs/models/sdkerrors/stopalltasksbutlererrors.md deleted file mode 100644 index 270d666..0000000 --- a/docs/models/sdkerrors/stopalltasksbutlererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopAllTasksButlerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stopalltaskserrors.md b/docs/models/sdkerrors/stopalltaskserrors.md deleted file mode 100644 index 64e48b7..0000000 --- a/docs/models/sdkerrors/stopalltaskserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopAllTasksErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stopalltasksunauthorized.md b/docs/models/sdkerrors/stopalltasksunauthorized.md deleted file mode 100644 index a2b54af..0000000 --- a/docs/models/sdkerrors/stopalltasksunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# StopAllTasksUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Errors` | [][sdkerrors.StopAllTasksButlerErrors](../../models/sdkerrors/stopalltasksbutlererrors.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/stoptaskbadrequest.md b/docs/models/sdkerrors/stoptaskbadrequest.md deleted file mode 100644 index 2aa28d9..0000000 --- a/docs/models/sdkerrors/stoptaskbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# StopTaskBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/stoptaskbutlererrors.md b/docs/models/sdkerrors/stoptaskbutlererrors.md deleted file mode 100644 index ca34f22..0000000 --- a/docs/models/sdkerrors/stoptaskbutlererrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopTaskButlerErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptaskerrors.md b/docs/models/sdkerrors/stoptaskerrors.md deleted file mode 100644 index 3e57a7c..0000000 --- a/docs/models/sdkerrors/stoptaskerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopTaskErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptaskunauthorized.md b/docs/models/sdkerrors/stoptaskunauthorized.md deleted file mode 100644 index 2220fae..0000000 --- a/docs/models/sdkerrors/stoptaskunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# StopTaskUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.StopTaskButlerErrors](../../models/sdkerrors/stoptaskbutlererrors.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/stoptranscodesessionbadrequest.md b/docs/models/sdkerrors/stoptranscodesessionbadrequest.md deleted file mode 100644 index d4fda4f..0000000 --- a/docs/models/sdkerrors/stoptranscodesessionbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# StopTranscodeSessionBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/stoptranscodesessionerrors.md b/docs/models/sdkerrors/stoptranscodesessionerrors.md deleted file mode 100644 index d25826c..0000000 --- a/docs/models/sdkerrors/stoptranscodesessionerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopTranscodeSessionErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptranscodesessionsessionserrors.md b/docs/models/sdkerrors/stoptranscodesessionsessionserrors.md deleted file mode 100644 index db56d96..0000000 --- a/docs/models/sdkerrors/stoptranscodesessionsessionserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# StopTranscodeSessionSessionsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptranscodesessionunauthorized.md b/docs/models/sdkerrors/stoptranscodesessionunauthorized.md deleted file mode 100644 index cda491c..0000000 --- a/docs/models/sdkerrors/stoptranscodesessionunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# StopTranscodeSessionUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.StopTranscodeSessionSessionsErrors](../../models/sdkerrors/stoptranscodesessionsessionserrors.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/updateplaylistbadrequest.md b/docs/models/sdkerrors/updateplaylistbadrequest.md deleted file mode 100644 index 30546b9..0000000 --- a/docs/models/sdkerrors/updateplaylistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdatePlaylistBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/updateplaylisterrors.md b/docs/models/sdkerrors/updateplaylisterrors.md deleted file mode 100644 index b80814e..0000000 --- a/docs/models/sdkerrors/updateplaylisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdatePlaylistErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplaylistplaylistserrors.md b/docs/models/sdkerrors/updateplaylistplaylistserrors.md deleted file mode 100644 index 7ba9768..0000000 --- a/docs/models/sdkerrors/updateplaylistplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdatePlaylistPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplaylistunauthorized.md b/docs/models/sdkerrors/updateplaylistunauthorized.md deleted file mode 100644 index 00a8466..0000000 --- a/docs/models/sdkerrors/updateplaylistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdatePlaylistUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.UpdatePlaylistPlaylistsErrors](../../models/sdkerrors/updateplaylistplaylistserrors.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/updateplayprogressbadrequest.md b/docs/models/sdkerrors/updateplayprogressbadrequest.md deleted file mode 100644 index 5a4b0ce..0000000 --- a/docs/models/sdkerrors/updateplayprogressbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdatePlayProgressBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/updateplayprogresserrors.md b/docs/models/sdkerrors/updateplayprogresserrors.md deleted file mode 100644 index a2e53e5..0000000 --- a/docs/models/sdkerrors/updateplayprogresserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdatePlayProgressErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplayprogressmediaerrors.md b/docs/models/sdkerrors/updateplayprogressmediaerrors.md deleted file mode 100644 index 29f49bb..0000000 --- a/docs/models/sdkerrors/updateplayprogressmediaerrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdatePlayProgressMediaErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplayprogressunauthorized.md b/docs/models/sdkerrors/updateplayprogressunauthorized.md deleted file mode 100644 index 6a70c8e..0000000 --- a/docs/models/sdkerrors/updateplayprogressunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdatePlayProgressUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.UpdatePlayProgressMediaErrors](../../models/sdkerrors/updateplayprogressmediaerrors.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/uploadplaylistbadrequest.md b/docs/models/sdkerrors/uploadplaylistbadrequest.md deleted file mode 100644 index 314b206..0000000 --- a/docs/models/sdkerrors/uploadplaylistbadrequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# UploadPlaylistBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - - -## 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/models/sdkerrors/uploadplaylisterrors.md b/docs/models/sdkerrors/uploadplaylisterrors.md deleted file mode 100644 index 6abc62d..0000000 --- a/docs/models/sdkerrors/uploadplaylisterrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# UploadPlaylistErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1000 | -| `Message` | **string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `Status` | **int* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/sdkerrors/uploadplaylistplaylistserrors.md b/docs/models/sdkerrors/uploadplaylistplaylistserrors.md deleted file mode 100644 index 70a5ed2..0000000 --- a/docs/models/sdkerrors/uploadplaylistplaylistserrors.md +++ /dev/null @@ -1,10 +0,0 @@ -# UploadPlaylistPlaylistsErrors - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Code` | **int* | :heavy_minus_sign: | N/A | 1001 | -| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | -| `Status` | **int* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/uploadplaylistunauthorized.md b/docs/models/sdkerrors/uploadplaylistunauthorized.md deleted file mode 100644 index 701c6c6..0000000 --- a/docs/models/sdkerrors/uploadplaylistunauthorized.md +++ /dev/null @@ -1,11 +0,0 @@ -# UploadPlaylistUnauthorized - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `Errors` | [][sdkerrors.UploadPlaylistPlaylistsErrors](../../models/sdkerrors/uploadplaylistplaylistserrors.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 index 8cac3ba..f17be4b 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -3,27 +3,25 @@ ## 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 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 are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. ### Available Operations -* [GetServerActivities](#getserveractivities) - Get Server Activities -* [CancelServerActivities](#cancelserveractivities) - Cancel Server Activities +* [ListActivities](#listactivities) - Get all activities +* [CancelActivity](#cancelactivity) - Cancel a running activity -## GetServerActivities +## ListActivities -Get Server Activities +List all activities on the server. Admins can see all activities but other users can only see their own ### Example Usage - + ```go package main @@ -40,7 +38,7 @@ func main() { plexgo.WithSecurity(""), ) - res, err := s.Activities.GetServerActivities(ctx) + res, err := s.Activities.ListActivities(ctx) if err != nil { log.Fatal(err) } @@ -59,29 +57,29 @@ func main() { ### Response -**[*operations.GetServerActivitiesResponse](../../models/operations/getserveractivitiesresponse.md), error** +**[*operations.ListActivitiesResponse](../../models/operations/listactivitiesresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.GetServerActivitiesBadRequest | 400 | application/json | -| sdkerrors.GetServerActivitiesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## CancelServerActivities +## CancelActivity -Cancel Server Activities +Cancel a running activity. Admins can cancel all activities but other users can only cancel their own ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -89,10 +87,23 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Activities.CancelServerActivities(ctx, "25b71ed5-0f9d-461c-baa7-d404e9e10d3e") + res, err := s.Activities.CancelActivity(ctx, operations.CancelActivityRequest{ + ActivityID: "d6199ba1-fb5e-4cae-bf17-1a5369c1cf1e", + }) if err != nil { log.Fatal(err) } @@ -104,20 +115,18 @@ func main() { ### 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. | | -| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| 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.CancelActivityRequest](../../models/operations/cancelactivityrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.CancelServerActivitiesResponse](../../models/operations/cancelserveractivitiesresponse.md), error** +**[*operations.CancelActivityResponse](../../models/operations/cancelactivityresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| sdkerrors.CancelServerActivitiesBadRequest | 400 | application/json | -| sdkerrors.CancelServerActivitiesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md deleted file mode 100644 index 6326c4d..0000000 --- a/docs/sdks/authentication/README.md +++ /dev/null @@ -1,240 +0,0 @@ -# Authentication -(*Authentication*) - -## Overview - -API Calls regarding authentication for Plex Media Server - - -### Available Operations - -* [GetTransientToken](#gettransienttoken) - Get a Transient Token -* [GetSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information -* [GetTokenDetails](#gettokendetails) - Get Token Details -* [PostUsersSignInData](#postuserssignindata) - Get User Sign In Data - -## 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( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Authentication.GetTransientToken(ctx, operations.GetTransientTokenQueryParamTypeDelegation, operations.ScopeAll) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `type_` | [operations.GetTransientTokenQueryParamType](../../models/operations/gettransienttokenqueryparamtype.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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetTransientTokenResponse](../../models/operations/gettransienttokenresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| sdkerrors.GetTransientTokenBadRequest | 400 | application/json | -| sdkerrors.GetTransientTokenUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Authentication.GetSourceConnectionInformation(ctx, "server://client-identifier") - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `source` | *string* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetSourceConnectionInformationResponse](../../models/operations/getsourceconnectioninformationresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| sdkerrors.GetSourceConnectionInformationBadRequest | 400 | application/json | -| sdkerrors.GetSourceConnectionInformationUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetTokenDetails - -Get the User data from the provided X-Plex-Token - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Authentication.GetTokenDetails(ctx) - if err != nil { - log.Fatal(err) - } - if res.UserPlexAccount != 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetTokenDetailsResponse](../../models/operations/gettokendetailsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.GetTokenDetailsBadRequest | 400 | application/json | -| sdkerrors.GetTokenDetailsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## PostUsersSignInData - -Sign in user with username and password and return user data with Plex authentication token - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Authentication.PostUsersSignInData(ctx, operations.PostUsersSignInDataRequest{ - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), - RequestBody: &operations.PostUsersSignInDataRequestBody{ - Login: "username@email.com", - Password: "password123", - VerificationCode: plexgo.Pointer("123456"), - }, - }) - if err != nil { - log.Fatal(err) - } - if res.UserPlexAccount != 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. | -| `request` | [operations.PostUsersSignInDataRequest](../../models/operations/postuserssignindatarequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.PostUsersSignInDataResponse](../../models/operations/postuserssignindataresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.PostUsersSignInDataBadRequest | 400 | application/json | -| sdkerrors.PostUsersSignInDataUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index 7bd7683..4c4197b 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -3,24 +3,23 @@ ## Overview -Butler is the task manager of the Plex Media Server Ecosystem. - +The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks. ### 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 +* [StopTasks](#stoptasks) - Stop all Butler tasks +* [GetTasks](#gettasks) - Get all Butler tasks +* [StartTasks](#starttasks) - Start all Butler tasks * [StopTask](#stoptask) - Stop a single Butler task +* [StartTask](#starttask) - Start a single Butler task -## GetButlerTasks +## StopTasks -Returns a list of butler tasks +This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. ### Example Usage - + ```go package main @@ -37,7 +36,58 @@ func main() { plexgo.WithSecurity(""), ) - res, err := s.Butler.GetButlerTasks(ctx) + res, err := s.Butler.StopTasks(ctx) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StopTasksResponse](../../models/operations/stoptasksresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetTasks + +Get the list of butler tasks and their scheduling + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Butler.GetTasks(ctx) if err != nil { log.Fatal(err) } @@ -56,28 +106,27 @@ func main() { ### Response -**[*operations.GetButlerTasksResponse](../../models/operations/getbutlertasksresponse.md), error** +**[*operations.GetTasksResponse](../../models/operations/gettasksresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.GetButlerTasksBadRequest | 400 | application/json | -| sdkerrors.GetButlerTasksUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## StartAllTasks +## StartTasks 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. + + 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 @@ -94,7 +143,7 @@ func main() { plexgo.WithSecurity(""), ) - res, err := s.Butler.StartAllTasks(ctx) + res, err := s.Butler.StartTasks(ctx) if err != nil { log.Fatal(err) } @@ -113,141 +162,28 @@ func main() { ### Response -**[*operations.StartAllTasksResponse](../../models/operations/startalltasksresponse.md), error** +**[*operations.StartTasksResponse](../../models/operations/starttasksresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.StartAllTasksBadRequest | 400 | application/json | -| sdkerrors.StartAllTasksUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Butler.StopAllTasks(ctx) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.StopAllTasksResponse](../../models/operations/stopalltasksresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| sdkerrors.StopAllTasksBadRequest | 400 | application/json | -| sdkerrors.StopAllTasksUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Butler.StartTask(ctx, operations.TaskNameRefreshPeriodicMetadata) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `taskName` | [operations.TaskName](../../models/operations/taskname.md) | :heavy_check_mark: | the name of the task to be started. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.StartTaskResponse](../../models/operations/starttaskresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| sdkerrors.StartTaskBadRequest | 400 | application/json | -| sdkerrors.StartTaskUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| 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. +This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -257,10 +193,23 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Butler.StopTask(ctx, operations.PathParamTaskNameCleanOldCacheFiles) + res, err := s.Butler.StopTask(ctx, operations.StopTaskRequest{ + Task: operations.TaskCleanOldBundles, + }) if err != nil { log.Fatal(err) } @@ -272,11 +221,11 @@ func main() { ### 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| 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.StopTaskRequest](../../models/operations/stoptaskrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -284,8 +233,73 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| sdkerrors.StopTaskBadRequest | 400 | application/json | -| sdkerrors.StopTaskUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StartTask + +This endpoint will attempt to start a specific Butler task by name. + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Butler.StartTask(ctx, operations.StartTaskRequest{ + Task: operations.PathParamTaskRefreshLocalMedia, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.StartTaskRequest](../../models/operations/starttaskrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StartTaskResponse](../../models/operations/starttaskresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/collections/README.md b/docs/sdks/collections/README.md new file mode 100644 index 0000000..3f7625c --- /dev/null +++ b/docs/sdks/collections/README.md @@ -0,0 +1,76 @@ +# Collections +(*Collections*) + +## Overview + +API Operations against the Collections + +### Available Operations + +* [CreateCollection](#createcollection) - Create collection + +## CreateCollection + +Create a collection in the library + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Collections.CreateCollection(ctx, operations.CreateCollectionRequest{ + SectionID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.CreateCollectionRequest](../../models/operations/createcollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateCollectionResponse](../../models/operations/createcollectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/content/README.md b/docs/sdks/content/README.md new file mode 100644 index 0000000..c1cc16b --- /dev/null +++ b/docs/sdks/content/README.md @@ -0,0 +1,892 @@ +# Content +(*Content*) + +## Overview + +The actual content of the media provider + +### Available Operations + +* [GetCollectionItems](#getcollectionitems) - Get items in a collection +* [GetMetadataItem](#getmetadataitem) - Get a metadata item +* [GetAlbums](#getalbums) - Set section albums +* [ListContent](#listcontent) - Get items in the section +* [GetAllLeaves](#getallleaves) - Set section leaves +* [GetArts](#getarts) - Set section artwork +* [GetCategories](#getcategories) - Set section categories +* [GetCluster](#getcluster) - Set section clusters +* [GetSonicPath](#getsonicpath) - Similar tracks to transition from one to another +* [GetFolders](#getfolders) - Get all folder locations +* [ListMoments](#listmoments) - Set section moments +* [GetSonicallySimilar](#getsonicallysimilar) - The nearest audio tracks +* [GetCollectionImage](#getcollectionimage) - Get a collection's image + +## GetCollectionItems + +Get items in a collection. Note if this collection contains more than 100 items, paging must be used. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetCollectionItems(ctx, operations.GetCollectionItemsRequest{ + CollectionID: 314585, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetCollectionItemsRequest](../../models/operations/getcollectionitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCollectionItemsResponse](../../models/operations/getcollectionitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetMetadataItem + +Get one or more metadata items. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetMetadataItem(ctx, operations.GetMetadataItemRequest{ + Ids: []string{}, + AsyncCheckFiles: components.BoolIntOne.ToPointer(), + AsyncRefreshLocalMediaAgent: components.BoolIntOne.ToPointer(), + AsyncRefreshAnalysis: components.BoolIntOne.ToPointer(), + CheckFiles: components.BoolIntOne.ToPointer(), + SkipRefresh: components.BoolIntOne.ToPointer(), + CheckFileAvailability: components.BoolIntOne.ToPointer(), + AsyncAugmentMetadata: components.BoolIntOne.ToPointer(), + AugmentCount: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetMetadataItemRequest](../../models/operations/getmetadataitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetMetadataItemResponse](../../models/operations/getmetadataitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetAlbums + +Get all albums in a music section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetAlbums(ctx, operations.GetAlbumsRequest{ + SectionID: 817133, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetAlbumsRequest](../../models/operations/getalbumsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAlbumsResponse](../../models/operations/getalbumsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListContent + +Get the items in a section, potentially filtering them + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.ListContent(ctx, operations.ListContentRequest{ + SectionID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.ListContentRequest](../../models/operations/listcontentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListContentResponse](../../models/operations/listcontentresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetAllLeaves + +Get all leaves in a section (such as episodes in a show section) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetAllLeaves(ctx, operations.GetAllLeavesRequest{ + SectionID: 633197, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetAllLeavesRequest](../../models/operations/getallleavesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAllLeavesResponse](../../models/operations/getallleavesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetArts + +Get artwork for a library section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetArts(ctx, operations.GetArtsRequest{ + SectionID: 859200, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != 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. | +| `request` | [operations.GetArtsRequest](../../models/operations/getartsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetArtsResponse](../../models/operations/getartsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCategories + +Get categories in a library section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetCategories(ctx, operations.GetCategoriesRequest{ + SectionID: 21841, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != 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. | +| `request` | [operations.GetCategoriesRequest](../../models/operations/getcategoriesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCategoriesResponse](../../models/operations/getcategoriesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCluster + +Get clusters in a library section (typically for photos) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetCluster(ctx, operations.GetClusterRequest{ + SectionID: 138560, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != 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. | +| `request` | [operations.GetClusterRequest](../../models/operations/getclusterrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetClusterResponse](../../models/operations/getclusterresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSonicPath + +Get a list of audio tracks starting at one and ending at another which are similar across the path + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetSonicPath(ctx, operations.GetSonicPathRequest{ + SectionID: 914549, + StartID: 629990, + EndID: 687740, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetSonicPathRequest](../../models/operations/getsonicpathrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSonicPathResponse](../../models/operations/getsonicpathresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetFolders + +Get all folder locations of the media in a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetFolders(ctx, operations.GetFoldersRequest{ + SectionID: 892532, + }) + 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. | +| `request` | [operations.GetFoldersRequest](../../models/operations/getfoldersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetFoldersResponse](../../models/operations/getfoldersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListMoments + +Get moments in a library section (typically for photos) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.ListMoments(ctx, operations.ListMomentsRequest{ + SectionID: 403239, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != 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. | +| `request` | [operations.ListMomentsRequest](../../models/operations/listmomentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListMomentsResponse](../../models/operations/listmomentsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSonicallySimilar + +Get the nearest audio tracks to a particular analysis + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetSonicallySimilar(ctx, operations.GetSonicallySimilarRequest{ + SectionID: 525956, + Values: []int64{}, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetSonicallySimilarRequest](../../models/operations/getsonicallysimilarrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSonicallySimilarResponse](../../models/operations/getsonicallysimilarresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCollectionImage + +Get an image for the collection based on the items within + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Content.GetCollectionImage(ctx, operations.GetCollectionImageRequest{ + CollectionID: 474227, + UpdatedAt: 759379, + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.GetCollectionImageRequest](../../models/operations/getcollectionimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCollectionImageResponse](../../models/operations/getcollectionimageresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/devices/README.md b/docs/sdks/devices/README.md new file mode 100644 index 0000000..5ebb534 --- /dev/null +++ b/docs/sdks/devices/README.md @@ -0,0 +1,903 @@ +# Devices +(*Devices*) + +## Overview + +Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices + +Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below. + +Example SSDP output +``` + + + 1 + 0 + + + urn:plex-tv:device:Media:1 + Turing Hopper 3000 + Plex, Inc. + https://plex.tv/ + Turing Hopper 3000 Media Grabber + Plex Media Grabber + 1 + https://plex.tv + uuid:42fde8e4-93b6-41e5-8a63-12d848655811 + + + http://10.0.0.5:8088 + urn:plex-tv:service:MediaGrabber:1 + urn:plex-tv:serviceId:MediaGrabber + + + + +``` + + - UDN: (string) A UUID for the device. This should be unique across models of a device at minimum. + - URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted. + + +### Available Operations + +* [GetAvailableGrabbers](#getavailablegrabbers) - Get available grabbers +* [ListDevices](#listdevices) - Get all devices +* [AddDevice](#adddevice) - Add a device +* [DiscoverDevices](#discoverdevices) - Tell grabbers to discover devices +* [RemoveDevice](#removedevice) - Remove a device +* [GetDeviceDetails](#getdevicedetails) - Get device details +* [ModifyDevice](#modifydevice) - Enable or disable a device +* [SetChannelmap](#setchannelmap) - Set a device's channel mapping +* [GetDevicesChannels](#getdeviceschannels) - Get a device's channels +* [SetDevicePreferences](#setdevicepreferences) - Set device preferences +* [StopScan](#stopscan) - Tell a device to stop scanning for channels +* [Scan](#scan) - Tell a device to scan for channels +* [GetThumb](#getthumb) - Get device thumb + +## GetAvailableGrabbers + +Get available grabbers visible to the server + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetAvailableGrabbers(ctx, operations.GetAvailableGrabbersRequest{ + Protocol: plexgo.Pointer("livetv"), + }) + 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. | +| `request` | [operations.GetAvailableGrabbersRequest](../../models/operations/getavailablegrabbersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAvailableGrabbersResponse](../../models/operations/getavailablegrabbersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListDevices + +Get the list of all devices present + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.ListDevices(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListDevicesResponse](../../models/operations/listdevicesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddDevice + +This endpoint adds a device to an existing grabber. The device is identified, and added to the correct grabber. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.AddDevice(ctx, operations.AddDeviceRequest{ + URI: plexgo.Pointer("http://10.0.0.5"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `request` | [operations.AddDeviceRequest](../../models/operations/adddevicerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddDeviceResponse](../../models/operations/adddeviceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DiscoverDevices + +Tell grabbers to discover devices + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.DiscoverDevices(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DiscoverDevicesResponse](../../models/operations/discoverdevicesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RemoveDevice + +Remove a devices by its id along with its channel mappings + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.RemoveDevice(ctx, operations.RemoveDeviceRequest{ + DeviceID: 685908, + }) + 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. | +| `request` | [operations.RemoveDeviceRequest](../../models/operations/removedevicerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RemoveDeviceResponse](../../models/operations/removedeviceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetDeviceDetails + +Get a device's details by its id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetDeviceDetails(ctx, operations.GetDeviceDetailsRequest{ + DeviceID: 170949, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `request` | [operations.GetDeviceDetailsRequest](../../models/operations/getdevicedetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetDeviceDetailsResponse](../../models/operations/getdevicedetailsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ModifyDevice + +Enable or disable a device by its id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.ModifyDevice(ctx, operations.ModifyDeviceRequest{ + DeviceID: 879135, + Enabled: components.BoolIntOne.ToPointer(), + }) + 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. | +| `request` | [operations.ModifyDeviceRequest](../../models/operations/modifydevicerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ModifyDeviceResponse](../../models/operations/modifydeviceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetChannelmap + +Set a device's channel mapping + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.SetChannelmap(ctx, operations.SetChannelmapRequest{ + DeviceID: 937661, + ChannelMapping: &operations.ChannelMapping{}, + ChannelMappingByKey: &operations.ChannelMappingByKey{}, + ChannelsEnabled: []string{ + "4", + "6", + ".", + "1", + ",", + "4", + "4", + ".", + "1", + ",", + "4", + "5", + ".", + "1", + }, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `request` | [operations.SetChannelmapRequest](../../models/operations/setchannelmaprequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetChannelmapResponse](../../models/operations/setchannelmapresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetDevicesChannels + +Get a device's channels by its id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetDevicesChannels(ctx, operations.GetDevicesChannelsRequest{ + DeviceID: 517209, + }) + 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. | +| `request` | [operations.GetDevicesChannelsRequest](../../models/operations/getdeviceschannelsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetDevicesChannelsResponse](../../models/operations/getdeviceschannelsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetDevicePreferences + +Set device preferences by its id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.SetDevicePreferences(ctx, operations.SetDevicePreferencesRequest{ + DeviceID: 420973, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetDevicePreferencesRequest](../../models/operations/setdevicepreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetDevicePreferencesResponse](../../models/operations/setdevicepreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StopScan + +Tell a device to stop scanning for channels + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.StopScan(ctx, operations.StopScanRequest{ + DeviceID: 576494, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `request` | [operations.StopScanRequest](../../models/operations/stopscanrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StopScanResponse](../../models/operations/stopscanresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Scan + +Tell a device to scan for channels + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.Scan(ctx, operations.ScanRequest{ + DeviceID: 57391, + Source: plexgo.Pointer("Cable"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDevice != 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. | +| `request` | [operations.ScanRequest](../../models/operations/scanrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ScanResponse](../../models/operations/scanresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetThumb + +Get a device's thumb for display to the user + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Devices.GetThumb(ctx, operations.GetThumbRequest{ + DeviceID: 960617, + VersionPathParameter: 1025, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetThumbRequest](../../models/operations/getthumbrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetThumbResponse](../../models/operations/getthumbresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/downloadqueue/README.md b/docs/sdks/downloadqueue/README.md new file mode 100644 index 0000000..1b14dae --- /dev/null +++ b/docs/sdks/downloadqueue/README.md @@ -0,0 +1,666 @@ +# DownloadQueue +(*DownloadQueue*) + +## Overview + +API Operations against the Download Queue + +### Available Operations + +* [CreateDownloadQueue](#createdownloadqueue) - Create download queue +* [GetDownloadQueue](#getdownloadqueue) - Get a download queue +* [AddDownloadQueueItems](#adddownloadqueueitems) - Add to download queue +* [ListDownloadQueueItems](#listdownloadqueueitems) - Get download queue items +* [GetItemDecision](#getitemdecision) - Grab download queue item decision +* [GetDownloadQueueMedia](#getdownloadqueuemedia) - Grab download queue media +* [RemoveDownloadQueueItems](#removedownloadqueueitems) - Delete download queue items +* [GetDownloadQueueItems](#getdownloadqueueitems) - Get download queue items +* [RestartProcessingDownloadQueueItems](#restartprocessingdownloadqueueitems) - Restart processing of items from the decision + +## CreateDownloadQueue + +Available: 0.2.0 + +Creates a download queue for this client if one doesn't exist, or returns the existing queue for this client and user. + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.CreateDownloadQueue(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateDownloadQueueResponse](../../models/operations/createdownloadqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetDownloadQueue + +Available: 0.2.0 + +Get a download queue by its id + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetDownloadQueue(ctx, operations.GetDownloadQueueRequest{ + QueueID: 922802, + }) + 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. | +| `request` | [operations.GetDownloadQueueRequest](../../models/operations/getdownloadqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetDownloadQueueResponse](../../models/operations/getdownloadqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddDownloadQueueItems + +Available: 0.2.0 + +Add items to the download queue + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.AddDownloadQueueItems(ctx, operations.AddDownloadQueueItemsRequest{ + QueueID: 984925, + Keys: []string{ + "/library/metadata/3", + "/library/metadata/6", + }, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: components.LocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: components.ProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + }) + 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. | +| `request` | [operations.AddDownloadQueueItemsRequest](../../models/operations/adddownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddDownloadQueueItemsResponse](../../models/operations/adddownloadqueueitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListDownloadQueueItems + +Available: 0.2.0 + +Get items from a download queue + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.ListDownloadQueueItems(ctx, operations.ListDownloadQueueItemsRequest{ + QueueID: 524138, + }) + 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. | +| `request` | [operations.ListDownloadQueueItemsRequest](../../models/operations/listdownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListDownloadQueueItemsResponse](../../models/operations/listdownloadqueueitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetItemDecision + +Available: 0.2.0 + +Grab the decision for a download queue item + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetItemDecision(ctx, operations.GetItemDecisionRequest{ + QueueID: 231605, + ItemID: 32, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDecision != 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. | +| `request` | [operations.GetItemDecisionRequest](../../models/operations/getitemdecisionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetItemDecisionResponse](../../models/operations/getitemdecisionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetDownloadQueueMedia + +Available: 0.2.0 + +Grab the media for a download queue item + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetDownloadQueueMedia(ctx, operations.GetDownloadQueueMediaRequest{ + QueueID: 663184, + ItemID: 32, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetDownloadQueueMediaRequest](../../models/operations/getdownloadqueuemediarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetDownloadQueueMediaResponse](../../models/operations/getdownloadqueuemediaresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RemoveDownloadQueueItems + +delete items from a download queue + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.RemoveDownloadQueueItems(ctx, operations.RemoveDownloadQueueItemsRequest{ + QueueID: 946275, + ItemID: []int64{ + 32, + 345, + 23, + }, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.RemoveDownloadQueueItemsRequest](../../models/operations/removedownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RemoveDownloadQueueItemsResponse](../../models/operations/removedownloadqueueitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetDownloadQueueItems + +Available: 0.2.0 + +Get items from a download queue + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.GetDownloadQueueItems(ctx, operations.GetDownloadQueueItemsRequest{ + QueueID: 809886, + ItemID: []int64{ + 32, + 345, + 23, + }, + }) + 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. | +| `request` | [operations.GetDownloadQueueItemsRequest](../../models/operations/getdownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetDownloadQueueItemsResponse](../../models/operations/getdownloadqueueitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RestartProcessingDownloadQueueItems + +Available: 0.2.0 + +Reprocess download queue items with previous decision parameters + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DownloadQueue.RestartProcessingDownloadQueueItems(ctx, operations.RestartProcessingDownloadQueueItemsRequest{ + QueueID: 713001, + ItemID: []int64{ + 32, + 345, + 23, + }, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.RestartProcessingDownloadQueueItemsRequest](../../models/operations/restartprocessingdownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RestartProcessingDownloadQueueItemsResponse](../../models/operations/restartprocessingdownloadqueueitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/dvrs/README.md b/docs/sdks/dvrs/README.md new file mode 100644 index 0000000..225b26c --- /dev/null +++ b/docs/sdks/dvrs/README.md @@ -0,0 +1,859 @@ +# DVRs +(*DVRs*) + +## Overview + +The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself + + +### Available Operations + +* [ListDVRs](#listdvrs) - Get DVRs +* [CreateDVR](#createdvr) - Create a DVR +* [DeleteDVR](#deletedvr) - Delete a single DVR +* [GetDVR](#getdvr) - Get a single DVR +* [DeleteLineup](#deletelineup) - Delete a DVR Lineup +* [AddLineup](#addlineup) - Add a DVR Lineup +* [SetDVRPreferences](#setdvrpreferences) - Set DVR preferences +* [StopDVRReload](#stopdvrreload) - Tell a DVR to stop reloading program guide +* [ReloadGuide](#reloadguide) - Tell a DVR to reload program guide +* [TuneChannel](#tunechannel) - Tune a channel on a DVR +* [RemoveDeviceFromDVR](#removedevicefromdvr) - Remove a device from an existing DVR +* [AddDeviceToDVR](#adddevicetodvr) - Add a device to an existing DVR + +## ListDVRs + +Get the list of all available DVRs + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.ListDVRs(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListDVRsResponse](../../models/operations/listdvrsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CreateDVR + +Creation of a DVR, after creation of a devcie and a lineup is selected + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.CreateDVR(ctx, operations.CreateDVRRequest{ + Lineup: plexgo.Pointer("lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT"), + DeviceQueryParameter: []string{ + "d", + "e", + "v", + "i", + "c", + "e", + "[", + "]", + "=", + "d", + "e", + "v", + "i", + "c", + "e", + ":", + "/", + "/", + "t", + "v", + ".", + "p", + "l", + "e", + "x", + ".", + "g", + "r", + "a", + "b", + "b", + "e", + "r", + "s", + ".", + "h", + "d", + "h", + "o", + "m", + "e", + "r", + "u", + "n", + "/", + "1", + "0", + "5", + "3", + "C", + "0", + "C", + "A", + }, + Language: plexgo.Pointer("eng"), + }) + if err != nil { + log.Fatal(err) + } + if res.DvrRequestHandlerSlashGetResponses200 != 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. | +| `request` | [operations.CreateDVRRequest](../../models/operations/createdvrrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateDVRResponse](../../models/operations/createdvrresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteDVR + +Delete a single DVR by its id (key) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.DeleteDVR(ctx, operations.DeleteDVRRequest{ + DvrID: 855088, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteDVRRequest](../../models/operations/deletedvrrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteDVRResponse](../../models/operations/deletedvrresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetDVR + +Get a single DVR by its id (key) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.GetDVR(ctx, operations.GetDVRRequest{ + DvrID: 973518, + }) + 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. | +| `request` | [operations.GetDVRRequest](../../models/operations/getdvrrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetDVRResponse](../../models/operations/getdvrresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteLineup + +Deletes a DVR device's lineup. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.DeleteLineup(ctx, operations.DeleteLineupRequest{ + DvrID: 454470, + Lineup: "", + }) + 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. | +| `request` | [operations.DeleteLineupRequest](../../models/operations/deletelineuprequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteLineupResponse](../../models/operations/deletelineupresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddLineup + +Add a lineup to a DVR device's set of lineups. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.AddLineup(ctx, operations.AddLineupRequest{ + DvrID: 945235, + Lineup: "", + }) + 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. | +| `request` | [operations.AddLineupRequest](../../models/operations/addlineuprequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddLineupResponse](../../models/operations/addlineupresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetDVRPreferences + +Set DVR preferences by name avd value + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.SetDVRPreferences(ctx, operations.SetDVRPreferencesRequest{ + DvrID: 116357, + }) + 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. | +| `request` | [operations.SetDVRPreferencesRequest](../../models/operations/setdvrpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetDVRPreferencesResponse](../../models/operations/setdvrpreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StopDVRReload + +Tell a DVR to stop reloading program guide + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.StopDVRReload(ctx, operations.StopDVRReloadRequest{ + DvrID: 348053, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.StopDVRReloadRequest](../../models/operations/stopdvrreloadrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StopDVRReloadResponse](../../models/operations/stopdvrreloadresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ReloadGuide + +Tell a DVR to reload program guide + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.ReloadGuide(ctx, operations.ReloadGuideRequest{ + DvrID: 140753, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.ReloadGuideRequest](../../models/operations/reloadguiderequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ReloadGuideResponse](../../models/operations/reloadguideresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## TuneChannel + +Tune a channel on a DVR to the provided channel + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.TuneChannel(ctx, operations.TuneChannelRequest{ + DvrID: 834281, + Channel: "2.1", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.TuneChannelRequest](../../models/operations/tunechannelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.TuneChannelResponse](../../models/operations/tunechannelresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RemoveDeviceFromDVR + +Remove a device from an existing DVR + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.RemoveDeviceFromDVR(ctx, operations.RemoveDeviceFromDVRRequest{ + DvrID: 945416, + DeviceID: 260761, + }) + 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. | +| `request` | [operations.RemoveDeviceFromDVRRequest](../../models/operations/removedevicefromdvrrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RemoveDeviceFromDVRResponse](../../models/operations/removedevicefromdvrresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddDeviceToDVR + +Add a device to an existing DVR + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.DVRs.AddDeviceToDVR(ctx, operations.AddDeviceToDVRRequest{ + DvrID: 334755, + DeviceID: 852930, + }) + 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. | +| `request` | [operations.AddDeviceToDVRRequest](../../models/operations/adddevicetodvrrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddDeviceToDVRResponse](../../models/operations/adddevicetodvrresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/epg/README.md b/docs/sdks/epg/README.md new file mode 100644 index 0000000..d6024b8 --- /dev/null +++ b/docs/sdks/epg/README.md @@ -0,0 +1,590 @@ +# Epg +(*Epg*) + +## Overview + +The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when + + +### Available Operations + +* [ComputeChannelMap](#computechannelmap) - Compute the best channel map +* [GetChannels](#getchannels) - Get channels for a lineup +* [GetCountries](#getcountries) - Get all countries +* [GetAllLanguages](#getalllanguages) - Get all languages +* [GetLineup](#getlineup) - Compute the best lineup +* [GetLineupChannels](#getlineupchannels) - Get the channels for mulitple lineups +* [GetCountriesLineups](#getcountrieslineups) - Get lineups for a country via postal code +* [GetCountryRegions](#getcountryregions) - Get regions for a country +* [ListLineups](#listlineups) - Get lineups for a region + +## ComputeChannelMap + +Compute the best channel map, given device and lineup + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.ComputeChannelMap(ctx, operations.ComputeChannelMapRequest{ + DeviceQueryParameter: "", + Lineup: "", + }) + 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. | +| `request` | [operations.ComputeChannelMapRequest](../../models/operations/computechannelmaprequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ComputeChannelMapResponse](../../models/operations/computechannelmapresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetChannels + +Get channels for a lineup within an EPG provider + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetChannels(ctx, operations.GetChannelsRequest{ + Lineup: "", + }) + 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. | +| `request` | [operations.GetChannelsRequest](../../models/operations/getchannelsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetChannelsResponse](../../models/operations/getchannelsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCountries + +This endpoint returns a list of countries which EPG data is available for. There are three flavors, as specfied by the `flavor` attribute + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetCountries(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCountriesResponse](../../models/operations/getcountriesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetAllLanguages + +Returns a list of all possible languages for EPG data. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetAllLanguages(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAllLanguagesResponse](../../models/operations/getalllanguagesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetLineup + +Compute the best lineup, given lineup group and device + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetLineup(ctx, operations.GetLineupRequest{ + DeviceQueryParameter: "", + LineupGroup: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetLineupRequest](../../models/operations/getlineuprequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetLineupResponse](../../models/operations/getlineupresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetLineupChannels + +Get the channels across multiple lineups + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetLineupChannels(ctx, operations.GetLineupChannelsRequest{ + Lineup: []string{ + "", + "", + }, + }) + 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. | +| `request` | [operations.GetLineupChannelsRequest](../../models/operations/getlineupchannelsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetLineupChannelsResponse](../../models/operations/getlineupchannelsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCountriesLineups + +Returns a list of lineups for a given country, EPG provider and postal code + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetCountriesLineups(ctx, operations.GetCountriesLineupsRequest{ + Country: "Malawi", + EpgID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithLineup != 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. | +| `request` | [operations.GetCountriesLineupsRequest](../../models/operations/getcountrieslineupsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCountriesLineupsResponse](../../models/operations/getcountrieslineupsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCountryRegions + +Get regions for a country within an EPG provider + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.GetCountryRegions(ctx, operations.GetCountryRegionsRequest{ + Country: "Morocco", + EpgID: "", + }) + 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. | +| `request` | [operations.GetCountryRegionsRequest](../../models/operations/getcountryregionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCountryRegionsResponse](../../models/operations/getcountryregionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListLineups + +Get lineups for a region within an EPG provider + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Epg.ListLineups(ctx, operations.ListLineupsRequest{ + Country: "Vanuatu", + EpgID: "", + Region: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithLineup != 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. | +| `request` | [operations.ListLineupsRequest](../../models/operations/listlineupsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListLineupsResponse](../../models/operations/listlineupsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md new file mode 100644 index 0000000..e5c6b7a --- /dev/null +++ b/docs/sdks/events/README.md @@ -0,0 +1,142 @@ +# Events +(*Events*) + +## Overview + +The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported. + +Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket. + + +### Available Operations + +* [GetNotifications](#getnotifications) - Connect to Eventsource +* [ConnectWebSocket](#connectwebsocket) - Connect to WebSocket + +## GetNotifications + +Connect to the event source to get a stream of events + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Events.GetNotifications(ctx, operations.GetNotificationsRequest{}) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.GetNotificationsRequest](../../models/operations/getnotificationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetNotificationsResponse](../../models/operations/getnotificationsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ConnectWebSocket + +Connect to the web socket to get a stream of events + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Events.ConnectWebSocket(ctx, operations.ConnectWebSocketRequest{}) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.ConnectWebSocketRequest](../../models/operations/connectwebsocketrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ConnectWebSocketResponse](../../models/operations/connectwebsocketresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/general/README.md b/docs/sdks/general/README.md new file mode 100644 index 0000000..daf187a --- /dev/null +++ b/docs/sdks/general/README.md @@ -0,0 +1,260 @@ +# General +(*General*) + +## Overview + +General endpoints for basic PMS operation not specific to any media provider + +### Available Operations + +* [GetServerInfo](#getserverinfo) - Get PMS info +* [GetIdentity](#getidentity) - Get PMS identity +* [GetSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information +* [GetTransientToken](#gettransienttoken) - Get Transient Tokens + +## GetServerInfo + +Information about this PMS setup and configuration + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDirectory != 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. | +| `request` | [operations.GetServerInfoRequest](../../models/operations/getserverinforequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetServerInfoResponse](../../models/operations/getserverinforesponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetIdentity + +Get details about this PMS's identity + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New() + + res, err := s.General.GetIdentity(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetIdentityResponse](../../models/operations/getidentityresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| 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. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.General.GetSourceConnectionInformation(ctx, operations.GetSourceConnectionInformationRequest{ + Source: "server://client-identifier", + Refresh: components.BoolIntOne.ToPointer(), + }) + 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. | +| `request` | [operations.GetSourceConnectionInformationRequest](../../models/operations/getsourceconnectioninformationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSourceConnectionInformationResponse](../../models/operations/getsourceconnectioninformationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## 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. +Note: This endpoint responds to all HTTP verbs but POST in preferred + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.General.GetTransientToken(ctx, operations.GetTransientTokenRequest{ + Type: operations.QueryParamTypeDelegation, + Scope: operations.ScopeAll, + }) + 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. | +| `request` | [operations.GetTransientTokenRequest](../../models/operations/gettransienttokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetTransientTokenResponse](../../models/operations/gettransienttokenresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 2c2a8e5..fdfb26d 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -3,82 +3,38 @@ ## Overview -Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. - +The hubs within a media provider ### Available Operations -* [GetGlobalHubs](#getglobalhubs) - Get Global Hubs -* [GetRecentlyAdded](#getrecentlyadded) - Get Recently Added -* [GetLibraryHubs](#getlibraryhubs) - Get library specific hubs +* [GetAllHubs](#getallhubs) - Get global hubs +* [GetContinueWatching](#getcontinuewatching) - Get the continue watching hub +* [GetHubItems](#gethubitems) - Get a hub's items +* [GetPromotedHubs](#getpromotedhubs) - Get the hubs which are promoted +* [GetMetadataHubs](#getmetadatahubs) - Get hubs for section by metadata item +* [GetPostplayHubs](#getpostplayhubs) - Get postplay hubs +* [GetRelatedHubs](#getrelatedhubs) - Get related hubs +* [GetSectionHubs](#getsectionhubs) - Get section hubs +* [ResetSectionDefaults](#resetsectiondefaults) - Reset hubs to defaults +* [ListHubs](#listhubs) - Get hubs +* [CreateCustomHub](#createcustomhub) - Create a custom hub +* [MoveHub](#movehub) - Move Hub +* [DeleteCustomHub](#deletecustomhub) - Delete a custom hub +* [UpdateHubVisibility](#updatehubvisibility) - Change hub visibility -## GetGlobalHubs +## GetAllHubs -Get Global Hubs filtered by the parameters provided. +Get the global hubs in this PMS ### Example Usage - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Hubs.GetGlobalHubs(ctx, nil, nil) - 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. | -| `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). | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetGlobalHubsResponse](../../models/operations/getglobalhubsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.GetGlobalHubsBadRequest | 400 | application/json | -| sdkerrors.GetGlobalHubsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetRecentlyAdded - -This endpoint will return the recently added content. - - -### Example Usage - - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -88,14 +44,22 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Hubs.GetRecentlyAdded(ctx, operations.GetRecentlyAddedRequest{ - ContentDirectoryID: 39486, - SectionID: plexgo.Pointer[int64](2), - Type: operations.TypeTvShow, - IncludeMeta: operations.IncludeMetaEnable.ToPointer(), + res, err := s.Hubs.GetAllHubs(ctx, operations.GetAllHubsRequest{ + OnlyTransient: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) @@ -108,15 +72,15 @@ func main() { ### 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.GetRecentlyAddedRequest](../../models/operations/getrecentlyaddedrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| 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.GetAllHubsRequest](../../models/operations/getallhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetRecentlyAddedResponse](../../models/operations/getrecentlyaddedresponse.md), error** +**[*operations.GetAllHubsResponse](../../models/operations/getallhubsresponse.md), error** ### Errors @@ -124,20 +88,21 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## GetLibraryHubs - -This endpoint will return a list of library specific hubs +## GetContinueWatching +Get the global continue watching hub ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -145,10 +110,21 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Hubs.GetLibraryHubs(ctx, 492.74, nil, nil) + res, err := s.Hubs.GetContinueWatching(ctx, operations.GetContinueWatchingRequest{}) if err != nil { log.Fatal(err) } @@ -160,22 +136,826 @@ func main() { ### 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). | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| 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.GetContinueWatchingRequest](../../models/operations/getcontinuewatchingrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetLibraryHubsResponse](../../models/operations/getlibraryhubsresponse.md), error** +**[*operations.GetContinueWatchingResponse](../../models/operations/getcontinuewatchingresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.GetLibraryHubsBadRequest | 400 | application/json | -| sdkerrors.GetLibraryHubsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetHubItems + +Get the items within a single hub specified by identifier + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetHubItems(ctx, operations.GetHubItemsRequest{ + Identifier: []string{ + "", + "", + "", + }, + }) + 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. | +| `request` | [operations.GetHubItemsRequest](../../models/operations/gethubitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetHubItemsResponse](../../models/operations/gethubitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPromotedHubs + +Get the global hubs which are promoted (should be displayed on the home screen) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetPromotedHubs(ctx, operations.GetPromotedHubsRequest{}) + 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. | +| `request` | [operations.GetPromotedHubsRequest](../../models/operations/getpromotedhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPromotedHubsResponse](../../models/operations/getpromotedhubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetMetadataHubs + +Get the hubs for a section by metadata item. Currently only for music sections + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetMetadataHubs(ctx, operations.GetMetadataHubsRequest{ + MetadataID: 605482, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithHubs != 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. | +| `request` | [operations.GetMetadataHubsRequest](../../models/operations/getmetadatahubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetMetadataHubsResponse](../../models/operations/getmetadatahubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPostplayHubs + +Get the hubs for a metadata to be displayed in post play + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetPostplayHubs(ctx, operations.GetPostplayHubsRequest{ + MetadataID: 441419, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithHubs != 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. | +| `request` | [operations.GetPostplayHubsRequest](../../models/operations/getpostplayhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPostplayHubsResponse](../../models/operations/getpostplayhubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetRelatedHubs + +Get the hubs for a metadata related to the provided metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetRelatedHubs(ctx, operations.GetRelatedHubsRequest{ + MetadataID: 8858, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithHubs != 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. | +| `request` | [operations.GetRelatedHubsRequest](../../models/operations/getrelatedhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetRelatedHubsResponse](../../models/operations/getrelatedhubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSectionHubs + +Get the hubs for a single section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.GetSectionHubs(ctx, operations.GetSectionHubsRequest{ + SectionID: 336924, + OnlyTransient: components.BoolIntOne.ToPointer(), + }) + 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. | +| `request` | [operations.GetSectionHubsRequest](../../models/operations/getsectionhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSectionHubsResponse](../../models/operations/getsectionhubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ResetSectionDefaults + +Reset hubs for this section to defaults and delete custom hubs + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.ResetSectionDefaults(ctx, operations.ResetSectionDefaultsRequest{ + SectionID: 383022, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.ResetSectionDefaultsRequest](../../models/operations/resetsectiondefaultsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ResetSectionDefaultsResponse](../../models/operations/resetsectiondefaultsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListHubs + +Get the list of hubs including both built-in and custom + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.ListHubs(ctx, operations.ListHubsRequest{ + SectionID: 442546, + }) + 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. | +| `request` | [operations.ListHubsRequest](../../models/operations/listhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListHubsResponse](../../models/operations/listhubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CreateCustomHub + +Create a custom hub based on a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.CreateCustomHub(ctx, operations.CreateCustomHubRequest{ + SectionID: 869922, + MetadataItemID: 703843, + PromotedToRecommended: components.BoolIntOne.ToPointer(), + PromotedToOwnHome: components.BoolIntOne.ToPointer(), + PromotedToSharedHome: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.CreateCustomHubRequest](../../models/operations/createcustomhubrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateCustomHubResponse](../../models/operations/createcustomhubresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MoveHub + +Changed the ordering of a hub among others hubs + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.MoveHub(ctx, operations.MoveHubRequest{ + SectionID: 755710, + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res.GetResponses200 != 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. | +| `request` | [operations.MoveHubRequest](../../models/operations/movehubrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MoveHubResponse](../../models/operations/movehubresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteCustomHub + +Delete a custom hub from the server + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.DeleteCustomHub(ctx, operations.DeleteCustomHubRequest{ + SectionID: 625677, + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteCustomHubRequest](../../models/operations/deletecustomhubrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteCustomHubResponse](../../models/operations/deletecustomhubresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## UpdateHubVisibility + +Changed the visibility of a hub for both the admin and shared users + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Hubs.UpdateHubVisibility(ctx, operations.UpdateHubVisibilityRequest{ + SectionID: 341650, + Identifier: "", + PromotedToRecommended: components.BoolIntOne.ToPointer(), + PromotedToOwnHome: components.BoolIntOne.ToPointer(), + PromotedToSharedHome: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UpdateHubVisibilityRequest](../../models/operations/updatehubvisibilityrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UpdateHubVisibilityResponse](../../models/operations/updatehubvisibilityresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index d49e7ff..3d62d74 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -3,398 +3,103 @@ ## Overview -API Calls interacting with Plex Media Server Libraries - +Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc). ### Available Operations -* [GetFileHash](#getfilehash) - Get Hash Value -* [GetRecentlyAddedLibrary](#getrecentlyaddedlibrary) - Get Recently Added -* [GetAllLibraries](#getalllibraries) - Get All Libraries -* [GetLibraryDetails](#getlibrarydetails) - Get Library Details -* [DeleteLibrary](#deletelibrary) - Delete Library Section -* [GetLibraryItems](#getlibraryitems) - Get Library Items -* [GetLibrarySectionsAll](#getlibrarysectionsall) - Get Library section media by tag ALL -* [GetRefreshLibraryMetadata](#getrefreshlibrarymetadata) - Refresh Metadata Of The Library -* [GetSearchLibrary](#getsearchlibrary) - Search Library -* [GetGenresLibrary](#getgenreslibrary) - Get Genres of library media -* [GetCountriesLibrary](#getcountrieslibrary) - Get Countries of library media -* [GetActorsLibrary](#getactorslibrary) - Get Actors of library media -* [GetSearchAllLibraries](#getsearchalllibraries) - Search All Libraries -* [GetMediaMetaData](#getmediametadata) - Get Media Metadata -* [GetMediaArts](#getmediaarts) - Get Media Background Artwork -* [PostMediaArts](#postmediaarts) - Upload Media Background Artwork -* [GetMediaPosters](#getmediaposters) - Get Media Posters -* [PostMediaPoster](#postmediaposter) - Upload Media Poster -* [GetMetadataChildren](#getmetadatachildren) - Get Items Children -* [GetTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content - -## GetFileHash - -This resource returns hash values for local files - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetFileHash(ctx, "file://C:\\Image.png&type=13", nil) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `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 | | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetFileHashResponse](../../models/operations/getfilehashresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| sdkerrors.GetFileHashBadRequest | 400 | application/json | -| sdkerrors.GetFileHashUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetRecentlyAddedLibrary - -This endpoint will return the recently added content. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetRecentlyAddedLibrary(ctx, operations.GetRecentlyAddedLibraryRequest{ - ContentDirectoryID: plexgo.Pointer[int64](2), - PinnedContentDirectoryID: []int64{ - 3, - 5, - 7, - 13, - 12, - 1, - 6, - 14, - 2, - 10, - 16, - 17, - }, - SectionID: plexgo.Pointer[int64](2), - Type: operations.QueryParamTypeTvShow, - IncludeMeta: operations.QueryParamIncludeMetaEnable.ToPointer(), - }) - 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. | -| `request` | [operations.GetRecentlyAddedLibraryRequest](../../models/operations/getrecentlyaddedlibraryrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetRecentlyAddedLibraryResponse](../../models/operations/getrecentlyaddedlibraryresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| sdkerrors.GetRecentlyAddedLibraryBadRequest | 400 | application/json | -| sdkerrors.GetRecentlyAddedLibraryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetAllLibraries - -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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetAllLibraries(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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetAllLibrariesResponse](../../models/operations/getalllibrariesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.GetAllLibrariesBadRequest | 400 | application/json | -| sdkerrors.GetAllLibrariesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetLibraryDetails - -## Library Details Endpoint - -This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. - -The details include: - -### Directories -Organized into three categories: - -- **Primary Directories**: - - Used in some clients for quick access to media subsets (e.g., "All", "On Deck"). - - Most can be replicated via media queries. - - Customizable by users. - -- **Secondary Directories**: - - Marked with `secondary="1"`. - - Used in older clients for structured navigation. - -- **Special Directories**: - - Includes a "By Folder" entry for filesystem-based browsing. - - Contains an obsolete `search="1"` entry for on-the-fly search dialog creation. - -### Types -Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: - -- **Type Object Attributes**: - - `key`: Endpoint for the media list of this type. - - `type`: Metadata type (if standard Plex type). - - `title`: Title for this content type (e.g., "Movies"). - -- **Filter Objects**: - - Subset of the media query language. - - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. - -- **Sort Objects**: - - Description of sort fields. - - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. - -> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetLibraryDetails(ctx, 9518, operations.IncludeDetailsZero.ToPointer()) - 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `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.
| | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetLibraryDetailsResponse](../../models/operations/getlibrarydetailsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| sdkerrors.GetLibraryDetailsBadRequest | 400 | application/json | -| sdkerrors.GetLibraryDetailsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## DeleteLibrary - -Delete a library using a specific section id - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.DeleteLibrary(ctx, 9518) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.DeleteLibraryResponse](../../models/operations/deletelibraryresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.DeleteLibraryBadRequest | 400 | application/json | -| sdkerrors.DeleteLibraryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +* [GetLibraryItems](#getlibraryitems) - Get all items in library +* [DeleteCaches](#deletecaches) - Delete library caches +* [CleanBundles](#cleanbundles) - Clean bundles +* [IngestTransientItem](#ingesttransientitem) - Ingest a transient item +* [GetLibraryMatches](#getlibrarymatches) - Get library matches +* [OptimizeDatabase](#optimizedatabase) - Optimize the Database +* [GetRandomArtwork](#getrandomartwork) - Get random artwork +* [GetSections](#getsections) - Get library sections (main Media Provider Only) +* [AddSection](#addsection) - Add a library section +* [StopAllRefreshes](#stopallrefreshes) - Stop refresh +* [GetSectionsPrefs](#getsectionsprefs) - Get section prefs +* [RefreshSectionsMetadata](#refreshsectionsmetadata) - Refresh all sections +* [GetTags](#gettags) - Get all library tags of a type +* [DeleteMetadataItem](#deletemetadataitem) - Delete a metadata item +* [EditMetadataItem](#editmetadataitem) - Edit a metadata item +* [DetectAds](#detectads) - Ad-detect an item +* [GetAllItemLeaves](#getallitemleaves) - Get the leaves of an item +* [AnalyzeMetadata](#analyzemetadata) - Analyze an item +* [GenerateThumbs](#generatethumbs) - Generate thumbs of chapters for an item +* [DetectCredits](#detectcredits) - Credit detect a metadata item +* [GetExtras](#getextras) - Get an item's extras +* [AddExtras](#addextras) - Add to an item's extras +* [GetFile](#getfile) - Get a file from a metadata or media bundle +* [StartBifGeneration](#startbifgeneration) - Start BIF generation of an item +* [DetectIntros](#detectintros) - Intro detect an item +* [CreateMarker](#createmarker) - Create a marker +* [MatchItem](#matchitem) - Match a metadata item +* [ListMatches](#listmatches) - Get metadata matches for an item +* [MergeItems](#mergeitems) - Merge a metadata item +* [ListSonicallySimilar](#listsonicallysimilar) - Get nearest tracks to metadata item +* [SetItemPreferences](#setitempreferences) - Set metadata preferences +* [RefreshItemsMetadata](#refreshitemsmetadata) - Refresh a metadata item +* [GetRelatedItems](#getrelateditems) - Get related items +* [ListSimilar](#listsimilar) - Get similar items +* [SplitItem](#splititem) - Split a metadata item +* [AddSubtitles](#addsubtitles) - Add subtitles +* [GetItemTree](#getitemtree) - Get metadata items as a tree +* [Unmatch](#unmatch) - Unmatch a metadata item +* [ListTopUsers](#listtopusers) - Get metadata top users +* [DetectVoiceActivity](#detectvoiceactivity) - Detect voice activity +* [GetAugmentationStatus](#getaugmentationstatus) - Get augmentation status +* [SetStreamSelection](#setstreamselection) - Set stream selection +* [GetPerson](#getperson) - Get person details +* [ListPersonMedia](#listpersonmedia) - Get media for a person +* [DeleteLibrarySection](#deletelibrarysection) - Delete a library section +* [GetLibraryDetails](#getlibrarydetails) - Get a library section by id +* [EditSection](#editsection) - Edit a library section +* [UpdateItems](#updateitems) - Set the fields of the filtered items +* [StartAnalysis](#startanalysis) - Analyze a section +* [Autocomplete](#autocomplete) - Get autocompletions for search +* [GetCollections](#getcollections) - Get collections in a section +* [GetCommon](#getcommon) - Get common fields for items +* [EmptyTrash](#emptytrash) - Empty section trash +* [GetSectionFilters](#getsectionfilters) - Get section filters +* [GetFirstCharacters](#getfirstcharacters) - Get list of first characters +* [DeleteIndexes](#deleteindexes) - Delete section indexes +* [DeleteIntros](#deleteintros) - Delete section intro markers +* [GetSectionPreferences](#getsectionpreferences) - Get section prefs +* [SetSectionPreferences](#setsectionpreferences) - Set section prefs +* [CancelRefresh](#cancelrefresh) - Cancel section refresh +* [RefreshSection](#refreshsection) - Refresh section +* [GetAvailableSorts](#getavailablesorts) - Get a section sorts +* [GetStreamLevels](#getstreamlevels) - Get loudness about a stream in json +* [GetStreamLoudness](#getstreamloudness) - Get loudness about a stream +* [GetChapterImage](#getchapterimage) - Get a chapter image +* [SetItemArtwork](#setitemartwork) - Set an item's artwork, theme, etc +* [UpdateItemArtwork](#updateitemartwork) - Set an item's artwork, theme, etc +* [DeleteMarker](#deletemarker) - Delete a marker +* [EditMarker](#editmarker) - Edit a marker +* [DeleteMediaItem](#deletemediaitem) - Delete a media item +* [GetPartIndex](#getpartindex) - Get BIF index for a part +* [DeleteCollection](#deletecollection) - Delete a collection +* [GetSectionImage](#getsectionimage) - Get a section composite image +* [DeleteStream](#deletestream) - Delete a stream +* [GetStream](#getstream) - Get a stream +* [SetStreamOffset](#setstreamoffset) - Set a stream offset +* [GetItemArtwork](#getitemartwork) - Get an item's artwork, theme, etc +* [GetMediaPart](#getmediapart) - Get a media part +* [GetImageFromBif](#getimagefrombif) - Get an image from part BIF ## GetLibraryItems -Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: -- `all`: All items in the section. -- `unwatched`: Items that have not been played. -- `newest`: Items that are recently released. -- `recentlyAdded`: Items that are recently added to the library. -- `recentlyViewed`: Items that were recently viewed. -- `onDeck`: Items to continue watching. -- `collection`: Items categorized by collection. -- `edition`: Items categorized by edition. -- `genre`: Items categorized by genre. -- `year`: Items categorized by year of release. -- `decade`: Items categorized by decade. -- `director`: Items categorized by director. -- `actor`: Items categorized by starring actor. -- `country`: Items categorized by country of origin. -- `contentRating`: Items categorized by content rating. -- `rating`: Items categorized by rating. -- `resolution`: Items categorized by resolution. -- `firstCharacter`: Items categorized by the first letter. -- `folder`: Items categorized by folder. -- `albums`: Items categorized by album. - +Request all metadata items according to a query. ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -404,20 +109,25 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{ - Tag: operations.TagNewest, - IncludeGuids: operations.IncludeGuidsEnable.ToPointer(), - Type: operations.GetLibraryItemsQueryParamTypeTvShow, - SectionKey: 9518, - IncludeMeta: operations.GetLibraryItemsQueryParamIncludeMetaEnable.ToPointer(), - }) + res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{}) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithMetadata != nil { // handle response } } @@ -437,27 +147,23 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.GetLibraryItemsBadRequest | 400 | application/json | -| sdkerrors.GetLibraryItemsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## GetLibrarySectionsAll - -Retrieves a list of all general media data for this library. +## DeleteCaches +Delete the hub caches so they are recomputed on next request ### Example Usage - + ```go package main import( "context" "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -468,70 +174,7 @@ func main() { plexgo.WithSecurity(""), ) - res, err := s.Library.GetLibrarySectionsAll(ctx, operations.GetLibrarySectionsAllRequest{ - SectionKey: 9518, - Type: operations.GetLibrarySectionsAllQueryParamTypeTvShow, - IncludeMeta: operations.GetLibrarySectionsAllQueryParamIncludeMetaEnable.ToPointer(), - IncludeGuids: operations.QueryParamIncludeGuidsEnable.ToPointer(), - IncludeAdvanced: operations.IncludeAdvancedEnable.ToPointer(), - IncludeCollections: operations.QueryParamIncludeCollectionsEnable.ToPointer(), - IncludeExternalMedia: operations.QueryParamIncludeExternalMediaEnable.ToPointer(), - }) - 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. | -| `request` | [operations.GetLibrarySectionsAllRequest](../../models/operations/getlibrarysectionsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetLibrarySectionsAllResponse](../../models/operations/getlibrarysectionsallresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| sdkerrors.GetLibrarySectionsAllBadRequest | 400 | application/json | -| sdkerrors.GetLibrarySectionsAllUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetRefreshLibraryMetadata - -This endpoint Refreshes all the Metadata of the library. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetRefreshLibraryMetadata(ctx, 9518, operations.ForceZero.ToPointer()) + res, err := s.Library.DeleteCaches(ctx) if err != nil { log.Fatal(err) } @@ -543,57 +186,34 @@ func main() { ### 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `force` | [*operations.Force](../../models/operations/force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetRefreshLibraryMetadataResponse](../../models/operations/getrefreshlibrarymetadataresponse.md), error** +**[*operations.DeleteCachesResponse](../../models/operations/deletecachesresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -| sdkerrors.GetRefreshLibraryMetadataBadRequest | 400 | application/json | -| sdkerrors.GetRefreshLibraryMetadataUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## GetSearchLibrary - -Search for content within a specific section of the library. - -### Types -Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: - -- **Type Object Attributes**: - - `type`: Metadata type (if standard Plex type). - - `title`: Title for this content type (e.g., "Movies"). - -- **Filter Objects**: - - Subset of the media query language. - - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. - -- **Sort Objects**: - - Description of sort fields. - - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. - -> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. +## CleanBundles +Clean out any now unused bundles. Bundles can become unused when media is deleted ### Example Usage - + ```go package main import( "context" "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -604,11 +224,11 @@ func main() { plexgo.WithSecurity(""), ) - res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.GetSearchLibraryQueryParamTypeTvShow) + res, err := s.Library.CleanBundles(ctx) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res != nil { // handle response } } @@ -616,38 +236,35 @@ func main() { ### 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `type_` | [operations.GetSearchLibraryQueryParamType](../../models/operations/getsearchlibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetSearchLibraryResponse](../../models/operations/getsearchlibraryresponse.md), error** +**[*operations.CleanBundlesResponse](../../models/operations/cleanbundlesresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.GetSearchLibraryBadRequest | 400 | application/json | -| sdkerrors.GetSearchLibraryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## GetGenresLibrary - -Retrieves a list of all the genres that are found for the media in this library. +## IngestTransientItem +This endpoint takes a file path specified in the `url` parameter, matches it using the scanner's match mechanism, downloads rich metadata, and then ingests the item as a transient item (without a library section). In the case where the file represents an episode, the entire tree (show, season, and episode) is added as transient items. At this time, movies and episodes are the only supported types, which are gleaned automatically from the file path. +Note that any of the parameters passed to the metadata details endpoint (e.g. `includeExtras=1`) work here. ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -657,190 +274,30 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetGenresLibrary(ctx, 9518, operations.GetGenresLibraryQueryParamTypeTvShow) - 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `type_` | [operations.GetGenresLibraryQueryParamType](../../models/operations/getgenreslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetGenresLibraryResponse](../../models/operations/getgenreslibraryresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.GetGenresLibraryBadRequest | 400 | application/json | -| sdkerrors.GetGenresLibraryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetCountriesLibrary - -Retrieves a list of all the countries that are found for the media in this library. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetCountriesLibrary(ctx, 9518, operations.GetCountriesLibraryQueryParamTypeTvShow) - 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `type_` | [operations.GetCountriesLibraryQueryParamType](../../models/operations/getcountrieslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetCountriesLibraryResponse](../../models/operations/getcountrieslibraryresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.GetCountriesLibraryBadRequest | 400 | application/json | -| sdkerrors.GetCountriesLibraryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetActorsLibrary - -Retrieves a list of all the actors that are found for the media in this library. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetActorsLibrary(ctx, 9518, operations.GetActorsLibraryQueryParamTypeTvShow) - 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. | | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `type_` | [operations.GetActorsLibraryQueryParamType](../../models/operations/getactorslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetActorsLibraryResponse](../../models/operations/getactorslibraryresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.GetActorsLibraryBadRequest | 400 | application/json | -| sdkerrors.GetActorsLibraryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetSearchAllLibraries - -Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetSearchAllLibraries(ctx, operations.GetSearchAllLibrariesRequest{ - Query: "", - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - SearchTypes: []operations.SearchTypes{ - operations.SearchTypesPeople, - }, - IncludeCollections: operations.GetSearchAllLibrariesQueryParamIncludeCollectionsEnable.ToPointer(), - IncludeExternalMedia: operations.GetSearchAllLibrariesQueryParamIncludeExternalMediaEnable.ToPointer(), + res, err := s.Library.IngestTransientItem(ctx, operations.IngestTransientItemRequest{ + URL: plexgo.Pointer("file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv"), + VirtualFilePath: plexgo.Pointer("/Avatar.mkv"), + ComputeHashes: components.BoolIntOne.ToPointer(), + IngestNonMatches: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithMetadata != nil { // handle response } } @@ -848,38 +305,39 @@ func main() { ### 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.GetSearchAllLibrariesRequest](../../models/operations/getsearchalllibrariesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| 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.IngestTransientItemRequest](../../models/operations/ingesttransientitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetSearchAllLibrariesResponse](../../models/operations/getsearchalllibrariesresponse.md), error** +**[*operations.IngestTransientItemResponse](../../models/operations/ingesttransientitemresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| sdkerrors.GetSearchAllLibrariesBadRequest | 400 | application/json | -| sdkerrors.GetSearchAllLibrariesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## GetMediaMetaData - -This endpoint will return all the (meta)data of one or more library items specified by the ratingKey. -Multiple rating keys can be provided as a comma-separated list (e.g., "21119,21617"). +## GetLibraryMatches +The matches endpoint is used to match content external to the library with content inside the library. This is done by passing a series of semantic "hints" about the content (its type, name, or release year). Each type (e.g. movie) has a canonical set of minimal required hints. +This ability to match content is useful in a variety of scenarios. For example, in the DVR, the EPG uses the endpoint to match recording rules against airing content. And in the cloud, the UMP uses the endpoint to match up a piece of media with rich metadata. +The endpoint response can including multiple matches, if there is ambiguity, each one containing a `score` from 0 to 100. For somewhat historical reasons, anything over 85 is considered a positive match (we prefer false negatives over false positives in general for matching). +The `guid` hint is somewhat special, in that it generally represents a unique identity for a piece of media (e.g. the IMDB `ttXXX`) identifier, in contrast with other hints which can be much more ambiguous (e.g. a title of `Jane Eyre`, which could refer to the 1943 or the 2011 version). +Episodes require either a season/episode pair, or an air date (or both). Either the path must be sent, or the show title ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -889,29 +347,95 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetMediaMetaData(ctx, operations.GetMediaMetaDataRequest{ - RatingKey: "21119,21617", - IncludeConcerts: plexgo.Pointer(true), - IncludeExtras: plexgo.Pointer(true), - IncludeOnDeck: plexgo.Pointer(true), - IncludePopularLeaves: plexgo.Pointer(true), - IncludePreferences: plexgo.Pointer(true), - IncludeReviews: plexgo.Pointer(true), - IncludeChapters: plexgo.Pointer(true), - IncludeStations: plexgo.Pointer(true), - IncludeExternalMedia: plexgo.Pointer(true), - AsyncAugmentMetadata: plexgo.Pointer(true), - AsyncCheckFiles: plexgo.Pointer(true), - AsyncRefreshAnalysis: plexgo.Pointer(true), - AsyncRefreshLocalMediaAgent: plexgo.Pointer(true), + res, err := s.Library.GetLibraryMatches(ctx, operations.GetLibraryMatchesRequest{ + IncludeFullMetadata: components.BoolIntOne.ToPointer(), + IncludeAncestorMetadata: components.BoolIntOne.ToPointer(), + IncludeAlternateMetadataSources: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetLibraryMatchesRequest](../../models/operations/getlibrarymatchesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetLibraryMatchesResponse](../../models/operations/getlibrarymatchesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## OptimizeDatabase + +Initiate optimize on the database. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.OptimizeDatabase(ctx, operations.OptimizeDatabaseRequest{ + Async: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { // handle response } } @@ -922,65 +446,12 @@ func main() { | 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.GetMediaMetaDataRequest](../../models/operations/getmediametadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [operations.OptimizeDatabaseRequest](../../models/operations/optimizedatabaserequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetMediaMetaDataResponse](../../models/operations/getmediametadataresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.GetMediaMetaDataBadRequest | 400 | application/json | -| sdkerrors.GetMediaMetaDataUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetMediaArts - -Returns the background artwork for a library item. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetMediaArts(ctx, 16099) - 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. | | -| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetMediaArtsResponse](../../models/operations/getmediaartsresponse.md), error** +**[*operations.OptimizeDatabaseResponse](../../models/operations/optimizedatabaseresponse.md), error** ### Errors @@ -988,231 +459,22 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## PostMediaArts +## GetRandomArtwork + +Get random artwork across sections. This is commonly used for a screensaver. + +This retrieves 100 random artwork paths in the specified sections and returns them. Restrictions are put in place to not return artwork for items the user is not allowed to access. Artwork will be for Movies, Shows, and Artists only. -Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL ### Example Usage - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.PostMediaArts(ctx, 2268, plexgo.Pointer("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | -| `url_` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `requestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.PostMediaArtsResponse](../../models/operations/postmediaartsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetMediaPosters - -Returns the available posters for a library item. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetMediaPosters(ctx, 16099) - 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. | | -| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetMediaPostersResponse](../../models/operations/getmediapostersresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## PostMediaPoster - -Uploads a poster to a library item, either from a local file or a remote URL - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.PostMediaPoster(ctx, 2268, plexgo.Pointer("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | -| `url_` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `requestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.PostMediaPosterResponse](../../models/operations/postmediaposterresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Library.GetMetadataChildren(ctx, 2403.67, plexgo.Pointer("Stream")) - 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. | -| `ratingKey` | *float64* | :heavy_check_mark: | the id of the library item to return the children of. | -| `includeElements` | **string* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)
| -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetMetadataChildrenResponse](../../models/operations/getmetadatachildrenresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.GetMetadataChildrenBadRequest | 400 | application/json | -| sdkerrors.GetMetadataChildrenUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetTopWatchedContent - -This endpoint will return the top watched content from libraries of a certain type - - -### Example Usage - - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" @@ -1222,10 +484,78 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Library.GetTopWatchedContent(ctx, operations.GetTopWatchedContentQueryParamTypeTvShow, operations.GetTopWatchedContentQueryParamIncludeGuidsEnable.ToPointer()) + res, err := s.Library.GetRandomArtwork(ctx, operations.GetRandomArtworkRequest{ + Sections: []int64{ + 5, + 6, + }, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithArtwork != 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. | +| `request` | [operations.GetRandomArtworkRequest](../../models/operations/getrandomartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetRandomArtworkResponse](../../models/operations/getrandomartworkresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSections + +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( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSections(ctx) if err != nil { log.Fatal(err) } @@ -1237,21 +567,4800 @@ func main() { ### 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. | | -| `type_` | [operations.GetTopWatchedContentQueryParamType](../../models/operations/gettopwatchedcontentqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `includeGuids` | [*operations.GetTopWatchedContentQueryParamIncludeGuids](../../models/operations/gettopwatchedcontentqueryparamincludeguids.md) | :heavy_minus_sign: | Adds the Guid object to the response
| 1 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetTopWatchedContentResponse](../../models/operations/gettopwatchedcontentresponse.md), error** +**[*operations.GetSectionsResponse](../../models/operations/getsectionsresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| sdkerrors.GetTopWatchedContentBadRequest | 400 | application/json | -| sdkerrors.GetTopWatchedContentUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddSection + +Add a new library section to the server + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AddSection(ctx, operations.AddSectionRequest{ + Name: "", + Type: 39544, + Agent: "", + Language: "", + Locations: []string{ + "O:\fatboy\\Media\\Ripped\\Music", + "O:\fatboy\\Media\\My Music", + }, + Prefs: &operations.QueryParamPrefs{}, + Relative: components.BoolIntOne.ToPointer(), + ImportFromiTunes: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.SlashGetResponses200 != 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. | +| `request` | [operations.AddSectionRequest](../../models/operations/addsectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddSectionResponse](../../models/operations/addsectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StopAllRefreshes + +Stop all refreshes across all sections + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Library.StopAllRefreshes(ctx) + if err != nil { + log.Fatal(err) + } + if res.RequestHandlerSlashGetResponses200 != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StopAllRefreshesResponse](../../models/operations/stopallrefreshesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSectionsPrefs + +Get a section's preferences for a metadata type + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionsPrefs(ctx, operations.GetSectionsPrefsRequest{ + Type: 460221, + }) + if err != nil { + log.Fatal(err) + } + if res.RequestHandlerSlashGetResponses200 != 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. | +| `request` | [operations.GetSectionsPrefsRequest](../../models/operations/getsectionsprefsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSectionsPrefsResponse](../../models/operations/getsectionsprefsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RefreshSectionsMetadata + +Tell PMS to refresh all section metadata + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.RefreshSectionsMetadata(ctx, operations.RefreshSectionsMetadataRequest{}) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.RefreshSectionsMetadataRequest](../../models/operations/refreshsectionsmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RefreshSectionsMetadataResponse](../../models/operations/refreshsectionsmetadataresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetTags + +Get all library tags of a type + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetTags(ctx, operations.GetTagsRequest{}) + 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. | +| `request` | [operations.GetTagsRequest](../../models/operations/gettagsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetTagsResponse](../../models/operations/gettagsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteMetadataItem + +Delete a single metadata item from the library, deleting media as well + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteMetadataItem(ctx, operations.DeleteMetadataItemRequest{ + Ids: "", + Proxy: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteMetadataItemRequest](../../models/operations/deletemetadataitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteMetadataItemResponse](../../models/operations/deletemetadataitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## EditMetadataItem + +Edit metadata items setting fields + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EditMetadataItem(ctx, operations.EditMetadataItemRequest{ + Ids: []string{ + "", + "", + }, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.EditMetadataItemRequest](../../models/operations/editmetadataitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.EditMetadataItemResponse](../../models/operations/editmetadataitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DetectAds + +Start the detection of ads in a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectAds(ctx, operations.DetectAdsRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DetectAdsRequest](../../models/operations/detectadsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DetectAdsResponse](../../models/operations/detectadsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetAllItemLeaves + +Get the leaves for a metadata item such as the episodes in a show + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetAllItemLeaves(ctx, operations.GetAllItemLeavesRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetAllItemLeavesRequest](../../models/operations/getallitemleavesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAllItemLeavesResponse](../../models/operations/getallitemleavesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AnalyzeMetadata + +Start the analysis of a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AnalyzeMetadata(ctx, operations.AnalyzeMetadataRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.AnalyzeMetadataRequest](../../models/operations/analyzemetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AnalyzeMetadataResponse](../../models/operations/analyzemetadataresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GenerateThumbs + +Start the chapter thumb generation for an item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GenerateThumbs(ctx, operations.GenerateThumbsRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GenerateThumbsRequest](../../models/operations/generatethumbsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GenerateThumbsResponse](../../models/operations/generatethumbsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DetectCredits + +Start credit detection on a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectCredits(ctx, operations.DetectCreditsRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + Manual: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DetectCreditsRequest](../../models/operations/detectcreditsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DetectCreditsResponse](../../models/operations/detectcreditsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetExtras + +Get the extras for a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetExtras(ctx, operations.GetExtrasRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetExtrasRequest](../../models/operations/getextrasrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetExtrasResponse](../../models/operations/getextrasresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddExtras + +Add an extra to a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AddExtras(ctx, operations.AddExtrasRequest{ + Ids: "", + URL: "https://super-mortise.biz/", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.AddExtrasRequest](../../models/operations/addextrasrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddExtrasResponse](../../models/operations/addextrasresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetFile + +Get a bundle file for a metadata or media item. This is either an image or a mp3 (for a show's theme) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetFile(ctx, operations.GetFileRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.TwoHundredAudioMpeg3ResponseStream != 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. | +| `request` | [operations.GetFileRequest](../../models/operations/getfilerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetFileResponse](../../models/operations/getfileresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StartBifGeneration + +Start the indexing (BIF generation) of an item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.StartBifGeneration(ctx, operations.StartBifGenerationRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.StartBifGenerationRequest](../../models/operations/startbifgenerationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StartBifGenerationResponse](../../models/operations/startbifgenerationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DetectIntros + +Start the detection of intros in a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectIntros(ctx, operations.DetectIntrosRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DetectIntrosRequest](../../models/operations/detectintrosrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DetectIntrosResponse](../../models/operations/detectintrosresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CreateMarker + +Create a marker for this user on the metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.CreateMarker(ctx, operations.CreateMarkerRequest{ + Ids: "", + Type: 248391, + StartTimeOffset: 535191, + Attributes: &operations.Attributes{}, + }) + 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. | +| `request` | [operations.CreateMarkerRequest](../../models/operations/createmarkerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateMarkerResponse](../../models/operations/createmarkerresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MatchItem + +Match a metadata item to a guid + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.MatchItem(ctx, operations.MatchItemRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.MatchItemRequest](../../models/operations/matchitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MatchItemResponse](../../models/operations/matchitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListMatches + +Get the list of metadata matches for a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListMatches(ctx, operations.ListMatchesRequest{ + Ids: "", + Manual: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.ListMatchesRequest](../../models/operations/listmatchesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListMatchesResponse](../../models/operations/listmatchesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MergeItems + +Merge a metadata item with other items + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.MergeItems(ctx, operations.MergeItemsRequest{ + IdsPathParameter: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.MergeItemsRequest](../../models/operations/mergeitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MergeItemsResponse](../../models/operations/mergeitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListSonicallySimilar + +Get the nearest tracks, sonically, to the provided track + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListSonicallySimilar(ctx, operations.ListSonicallySimilarRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.ListSonicallySimilarRequest](../../models/operations/listsonicallysimilarrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListSonicallySimilarResponse](../../models/operations/listsonicallysimilarresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetItemPreferences + +Set the preferences on a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetItemPreferences(ctx, operations.SetItemPreferencesRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetItemPreferencesRequest](../../models/operations/setitempreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetItemPreferencesResponse](../../models/operations/setitempreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RefreshItemsMetadata + +Refresh a metadata item from the agent + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.RefreshItemsMetadata(ctx, operations.RefreshItemsMetadataRequest{ + Ids: "", + MarkUpdated: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.RefreshItemsMetadataRequest](../../models/operations/refreshitemsmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RefreshItemsMetadataResponse](../../models/operations/refreshitemsmetadataresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetRelatedItems + +Get a hub of related items to a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetRelatedItems(ctx, operations.GetRelatedItemsRequest{ + Ids: "", + }) + 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. | +| `request` | [operations.GetRelatedItemsRequest](../../models/operations/getrelateditemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetRelatedItemsResponse](../../models/operations/getrelateditemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListSimilar + +Get a list of similar items to a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListSimilar(ctx, operations.ListSimilarRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.ListSimilarRequest](../../models/operations/listsimilarrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListSimilarResponse](../../models/operations/listsimilarresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SplitItem + +Split a metadata item into multiple items + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SplitItem(ctx, operations.SplitItemRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SplitItemRequest](../../models/operations/splititemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SplitItemResponse](../../models/operations/splititemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddSubtitles + +Add a subtitle to a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.AddSubtitles(ctx, operations.AddSubtitlesRequest{ + Ids: "", + Forced: components.BoolIntOne.ToPointer(), + HearingImpaired: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.AddSubtitlesRequest](../../models/operations/addsubtitlesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddSubtitlesResponse](../../models/operations/addsubtitlesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetItemTree + +Get a tree of metadata items, such as the seasons/episodes of a show + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetItemTree(ctx, operations.GetItemTreeRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithNestedMetadata != 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. | +| `request` | [operations.GetItemTreeRequest](../../models/operations/getitemtreerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetItemTreeResponse](../../models/operations/getitemtreeresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Unmatch + +Unmatch a metadata item to info fetched from the agent + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.Unmatch(ctx, operations.UnmatchRequest{ + Ids: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UnmatchRequest](../../models/operations/unmatchrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UnmatchResponse](../../models/operations/unmatchresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListTopUsers + +Get the list of users which have played this item starting with the most + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListTopUsers(ctx, operations.ListTopUsersRequest{ + Ids: "", + }) + 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. | +| `request` | [operations.ListTopUsersRequest](../../models/operations/listtopusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListTopUsersResponse](../../models/operations/listtopusersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DetectVoiceActivity + +Start the detection of voice in a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DetectVoiceActivity(ctx, operations.DetectVoiceActivityRequest{ + Ids: "", + Force: components.BoolIntOne.ToPointer(), + Manual: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DetectVoiceActivityRequest](../../models/operations/detectvoiceactivityrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DetectVoiceActivityResponse](../../models/operations/detectvoiceactivityresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetAugmentationStatus + +Get augmentation status and potentially wait for completion + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetAugmentationStatus(ctx, operations.GetAugmentationStatusRequest{ + AugmentationID: "", + Wait: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetAugmentationStatusRequest](../../models/operations/getaugmentationstatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAugmentationStatusResponse](../../models/operations/getaugmentationstatusresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetStreamSelection + +Set which streams (audio/subtitle) are selected by this user + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetStreamSelection(ctx, operations.SetStreamSelectionRequest{ + PartID: 360489, + AllParts: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetStreamSelectionRequest](../../models/operations/setstreamselectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetStreamSelectionResponse](../../models/operations/setstreamselectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPerson + +Get details for a single actor. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetPerson(ctx, operations.GetPersonRequest{ + PersonID: "", + }) + 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. | +| `request` | [operations.GetPersonRequest](../../models/operations/getpersonrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPersonResponse](../../models/operations/getpersonresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListPersonMedia + +Get all the media for a single actor. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.ListPersonMedia(ctx, operations.ListPersonMediaRequest{ + PersonID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.ListPersonMediaRequest](../../models/operations/listpersonmediarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListPersonMediaResponse](../../models/operations/listpersonmediaresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteLibrarySection + +Delete a library section by id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteLibrarySection(ctx, operations.DeleteLibrarySectionRequest{ + SectionID: "", + Async: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteLibrarySectionRequest](../../models/operations/deletelibrarysectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteLibrarySectionResponse](../../models/operations/deletelibrarysectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetLibraryDetails + +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. It often contains a list of `Directory` metadata objects: These used to be used by clients to build a menuing system. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetLibraryDetails(ctx, operations.GetLibraryDetailsRequest{ + SectionID: "", + IncludeDetails: components.BoolIntOne.ToPointer(), + }) + 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. | +| `request` | [operations.GetLibraryDetailsRequest](../../models/operations/getlibrarydetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetLibraryDetailsResponse](../../models/operations/getlibrarydetailsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## EditSection + +Edit a library section by id setting parameters + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EditSection(ctx, operations.EditSectionRequest{ + SectionID: "", + Agent: "", + Locations: []string{ + "O:\fatboy\\Media\\Ripped\\Music", + "O:\fatboy\\Media\\My Music", + }, + Prefs: &operations.EditSectionQueryParamPrefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.EditSectionRequest](../../models/operations/editsectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.EditSectionResponse](../../models/operations/editsectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## UpdateItems + +This endpoint takes an large possible set of values. Here are some examples. +- **Parameters, extra documentation** + - artist.title.value + - When used with track, both artist.title.value and album.title.value need to be specified + - title.value usage + - Summary + - Tracks always rename and never merge + - Albums and Artists + - if single item and item without title does not exist, it is renamed. + - if single item and item with title does exist they are merged. + - if multiple they are always merged. + - Tracks + - Works as expected will update the track's title + - Single track: `/library/sections/{id}/all?type=10&id=42&title.value=NewName` + - Multiple tracks: `/library/sections/{id}/all?type=10&id=42,43,44&title.value=NewName` + - All tracks: `/library/sections/{id}/all?type=10&title.value=NewName` + - Albums + - Functionality changes depending on the existence of an album with the same title + - Album exists + - Single album: `/library/sections/{id}/all?type=9&id=42&title.value=Album 2` + - Album with id 42 is merged into album titled "Album 2" + - Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=Moo Album` + - All albums are merged into the existing album titled "Moo Album" + - Album does not exist + - Single album: `/library/sections/{id}/all?type=9&id=42&title.value=NewAlbumTitle` + - Album with id 42 has title modified to "NewAlbumTitle" + - Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=NewAlbumTitle` + - All albums are merged into a new album with title="NewAlbumTitle" + - Artists + - Functionaly changes depending on the existence of an artist with the same title. + - Artist exists + - Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=Artist 2` + - Artist with id 42 is merged into existing artist titled "Artist 2" + - Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=Artist 3` + - All artists are merged into the existing artist titled "Artist 3" + - Artist does not exist + - Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=NewArtistTitle` + - Artist with id 42 has title modified to "NewArtistTitle" + - Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=NewArtistTitle` + - All artists are merged into a new artist with title="NewArtistTitle" + +- **Notes** + - Technically square brackets are not allowed in an URI except the Internet Protocol Literal Address + - RFC3513: A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax. + - Escaped square brackets are allowed, but don't render well + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.UpdateItems(ctx, operations.UpdateItemsRequest{ + SectionID: "", + FieldLocked: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UpdateItemsRequest](../../models/operations/updateitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UpdateItemsResponse](../../models/operations/updateitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StartAnalysis + +Start analysis of all items in a section. If BIF generation is enabled, this will also be started on this section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.StartAnalysis(ctx, operations.StartAnalysisRequest{ + SectionID: 158829, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.StartAnalysisRequest](../../models/operations/startanalysisrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StartAnalysisResponse](../../models/operations/startanalysisresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Autocomplete + +The field to autocomplete on is specified by the {field}.query parameter. For example `genre.query` or `title.query`. +Returns a set of items from the filtered items whose {field} starts with {field}.query. In the results, a {field}.queryRange will be present to express the range of the match + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.Autocomplete(ctx, operations.AutocompleteRequest{ + SectionID: 942007, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.AutocompleteRequest](../../models/operations/autocompleterequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AutocompleteResponse](../../models/operations/autocompleteresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCollections + +Get all collections in a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetCollections(ctx, operations.GetCollectionsRequest{ + SectionID: 348838, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetCollectionsRequest](../../models/operations/getcollectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCollectionsResponse](../../models/operations/getcollectionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetCommon + +Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter +Fields which are not common will be expressed in the `mixedFields` field + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetCommon(ctx, operations.GetCommonRequest{ + SectionID: 298154, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetCommonRequest](../../models/operations/getcommonrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetCommonResponse](../../models/operations/getcommonresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## EmptyTrash + +Empty trash in the section, permanently deleting media/metadata for missing media + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EmptyTrash(ctx, operations.EmptyTrashRequest{ + SectionID: 30052, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.EmptyTrashRequest](../../models/operations/emptytrashrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.EmptyTrashResponse](../../models/operations/emptytrashresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSectionFilters + +Get common filters on a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionFilters(ctx, operations.GetSectionFiltersRequest{ + SectionID: 380557, + }) + 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. | +| `request` | [operations.GetSectionFiltersRequest](../../models/operations/getsectionfiltersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSectionFiltersResponse](../../models/operations/getsectionfiltersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetFirstCharacters + +Get list of first characters in this section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetFirstCharacters(ctx, operations.GetFirstCharactersRequest{ + SectionID: 3947, + }) + 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. | +| `request` | [operations.GetFirstCharactersRequest](../../models/operations/getfirstcharactersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetFirstCharactersResponse](../../models/operations/getfirstcharactersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteIndexes + +Delete all the indexes in a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteIndexes(ctx, operations.DeleteIndexesRequest{ + SectionID: 588437, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteIndexesRequest](../../models/operations/deleteindexesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteIndexesResponse](../../models/operations/deleteindexesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteIntros + +Delete all the intro markers in a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteIntros(ctx, operations.DeleteIntrosRequest{ + SectionID: 498656, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteIntrosRequest](../../models/operations/deleteintrosrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteIntrosResponse](../../models/operations/deleteintrosresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSectionPreferences + +Get the prefs for a section by id and potentially overriding the agent + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionPreferences(ctx, operations.GetSectionPreferencesRequest{ + SectionID: 754869, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSettings != 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. | +| `request` | [operations.GetSectionPreferencesRequest](../../models/operations/getsectionpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSectionPreferencesResponse](../../models/operations/getsectionpreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetSectionPreferences + +Set the prefs for a section by id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetSectionPreferences(ctx, operations.SetSectionPreferencesRequest{ + SectionID: 349936, + Prefs: operations.SetSectionPreferencesQueryParamPrefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetSectionPreferencesRequest](../../models/operations/setsectionpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetSectionPreferencesResponse](../../models/operations/setsectionpreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CancelRefresh + +Cancel the refresh of a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.CancelRefresh(ctx, operations.CancelRefreshRequest{ + SectionID: 326852, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.CancelRefreshRequest](../../models/operations/cancelrefreshrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CancelRefreshResponse](../../models/operations/cancelrefreshresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RefreshSection + +Start a refresh of this section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.RefreshSection(ctx, operations.RefreshSectionRequest{ + SectionID: 450300, + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.RefreshSectionRequest](../../models/operations/refreshsectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RefreshSectionResponse](../../models/operations/refreshsectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetAvailableSorts + +Get the sort mechanisms available in a section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetAvailableSorts(ctx, operations.GetAvailableSortsRequest{ + SectionID: 212498, + }) + 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. | +| `request` | [operations.GetAvailableSortsRequest](../../models/operations/getavailablesortsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAvailableSortsResponse](../../models/operations/getavailablesortsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetStreamLevels + +The the loudness of a stream in db, one entry per 100ms + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetStreamLevels(ctx, operations.GetStreamLevelsRequest{ + StreamID: 447611, + }) + 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. | +| `request` | [operations.GetStreamLevelsRequest](../../models/operations/getstreamlevelsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetStreamLevelsResponse](../../models/operations/getstreamlevelsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetStreamLoudness + +The the loudness of a stream in db, one number per line, one entry per 100ms + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetStreamLoudness(ctx, operations.GetStreamLoudnessRequest{ + StreamID: 277271, + }) + if err != nil { + log.Fatal(err) + } + if res.Res != 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. | +| `request` | [operations.GetStreamLoudnessRequest](../../models/operations/getstreamloudnessrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetStreamLoudnessResponse](../../models/operations/getstreamloudnessresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetChapterImage + +Get a single chapter image for a piece of media + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetChapterImage(ctx, operations.GetChapterImageRequest{ + MediaID: 892563, + Chapter: 48348, + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.GetChapterImageRequest](../../models/operations/getchapterimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetChapterImageResponse](../../models/operations/getchapterimageresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetItemArtwork + +Set the artwork, thumb, element for a metadata item +Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetItemArtwork(ctx, operations.SetItemArtworkRequest{ + Ids: "", + Element: operations.ElementBanner, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetItemArtworkRequest](../../models/operations/setitemartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetItemArtworkResponse](../../models/operations/setitemartworkresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## UpdateItemArtwork + +Set the artwork, thumb, element for a metadata item +Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.UpdateItemArtwork(ctx, operations.UpdateItemArtworkRequest{ + Ids: "", + Element: operations.PathParamElementClearLogo, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UpdateItemArtworkRequest](../../models/operations/updateitemartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UpdateItemArtworkResponse](../../models/operations/updateitemartworkresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteMarker + +Delete a marker for this user on the metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteMarker(ctx, operations.DeleteMarkerRequest{ + Ids: "", + Marker: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteMarkerRequest](../../models/operations/deletemarkerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteMarkerResponse](../../models/operations/deletemarkerresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## EditMarker + +Edit a marker for this user on the metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.EditMarker(ctx, operations.EditMarkerRequest{ + Ids: "", + Marker: "", + Type: 884347, + StartTimeOffset: 517251, + Attributes: &operations.QueryParamAttributes{}, + }) + if err != nil { + log.Fatal(err) + } + if res.PostResponses200 != 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. | +| `request` | [operations.EditMarkerRequest](../../models/operations/editmarkerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.EditMarkerResponse](../../models/operations/editmarkerresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteMediaItem + +Delete a single media from a metadata item in the library + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteMediaItem(ctx, operations.DeleteMediaItemRequest{ + Ids: "", + MediaItem: "", + Proxy: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteMediaItemRequest](../../models/operations/deletemediaitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteMediaItemResponse](../../models/operations/deletemediaitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPartIndex + +Get BIF index for a part by index type + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetPartIndex(ctx, operations.GetPartIndexRequest{ + PartID: 724750, + Index: operations.IndexSd, + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.GetPartIndexRequest](../../models/operations/getpartindexrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPartIndexResponse](../../models/operations/getpartindexresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteCollection + +Delete a library collection from the PMS + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteCollection(ctx, operations.DeleteCollectionRequest{ + SectionID: 283619, + CollectionID: 680895, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteCollectionRequest](../../models/operations/deletecollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteCollectionResponse](../../models/operations/deletecollectionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSectionImage + +Get a composite image of images in this section + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetSectionImage(ctx, operations.GetSectionImageRequest{ + SectionID: 925611, + UpdatedAt: 117413, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetSectionImageRequest](../../models/operations/getsectionimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSectionImageResponse](../../models/operations/getsectionimageresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteStream + +Delete a stream. Only applies to downloaded subtitle streams or a sidecar subtitle when media deletion is enabled. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.DeleteStream(ctx, operations.DeleteStreamRequest{ + StreamID: 841510, + Ext: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteStreamRequest](../../models/operations/deletestreamrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteStreamResponse](../../models/operations/deletestreamresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetStream + +Get a stream (such as a sidecar subtitle stream) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetStream(ctx, operations.GetStreamRequest{ + StreamID: 314506, + Ext: "", + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetStreamRequest](../../models/operations/getstreamrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetStreamResponse](../../models/operations/getstreamresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetStreamOffset + +Set a stream offset in ms. This may not be respected by all clients + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.SetStreamOffset(ctx, operations.SetStreamOffsetRequest{ + StreamID: 606295, + Ext: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetStreamOffsetRequest](../../models/operations/setstreamoffsetrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetStreamOffsetResponse](../../models/operations/setstreamoffsetresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetItemArtwork + +Get the artwork, thumb, element for a metadata item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetItemArtwork(ctx, operations.GetItemArtworkRequest{ + Ids: "", + Element: operations.GetItemArtworkPathParamElementPoster, + Timestamp: 999555, + }) + if err != nil { + log.Fatal(err) + } + if res.TwoHundredAudioMpeg3ResponseStream != 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. | +| `request` | [operations.GetItemArtworkRequest](../../models/operations/getitemartworkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetItemArtworkResponse](../../models/operations/getitemartworkresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetMediaPart + +Get a media part for streaming or download. + - streaming: This is the default scenario. Bandwidth usage on this endpoint will be guaranteed (on the server's end) to be at least the bandwidth reservation given in the decision. If no decision exists, an ad-hoc decision will be created if sufficient bandwidth exists. Clients should not rely on ad-hoc decisions being made as this may be removed in the future. + - download: Indicated if the query parameter indicates this is a download. Bandwidth will be prioritized behind playbacks and will get a fair share of what remains. + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetMediaPart(ctx, operations.GetMediaPartRequest{ + PartID: 877105, + Changestamp: 970622, + Filename: "example.file", + Download: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetMediaPartRequest](../../models/operations/getmediapartrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetMediaPartResponse](../../models/operations/getmediapartresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetImageFromBif + +Extract an image from the BIF for a part at a particular offset + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Library.GetImageFromBif(ctx, operations.GetImageFromBifRequest{ + PartID: 304273, + Index: operations.PathParamIndexSd, + Offset: 939569, + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.GetImageFromBifRequest](../../models/operations/getimagefrombifrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetImageFromBifResponse](../../models/operations/getimagefrombifresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/librarycollections/README.md b/docs/sdks/librarycollections/README.md new file mode 100644 index 0000000..c294599 --- /dev/null +++ b/docs/sdks/librarycollections/README.md @@ -0,0 +1,213 @@ +# LibraryCollections +(*LibraryCollections*) + +## Overview + +Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well. + +### Available Operations + +* [AddCollectionItems](#addcollectionitems) - Add items to a collection +* [DeleteCollectionItem](#deletecollectionitem) - Delete an item from a collection +* [MoveCollectionItem](#movecollectionitem) - Reorder an item in the collection + +## AddCollectionItems + +Add items to a collection by uri + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryCollections.AddCollectionItems(ctx, operations.AddCollectionItemsRequest{ + CollectionID: 338144, + URI: "https://expensive-bakeware.com", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.AddCollectionItemsRequest](../../models/operations/addcollectionitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddCollectionItemsResponse](../../models/operations/addcollectionitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteCollectionItem + +Delete an item from a collection + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryCollections.DeleteCollectionItem(ctx, operations.DeleteCollectionItemRequest{ + CollectionID: 320928, + ItemID: 406983, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.DeleteCollectionItemRequest](../../models/operations/deletecollectionitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteCollectionItemResponse](../../models/operations/deletecollectionitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MoveCollectionItem + +Reorder items in a collection with one item after another + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryCollections.MoveCollectionItem(ctx, operations.MoveCollectionItemRequest{ + CollectionID: 239532, + ItemID: 513864, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.MoveCollectionItemRequest](../../models/operations/movecollectionitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MoveCollectionItemResponse](../../models/operations/movecollectionitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/libraryplaylists/README.md b/docs/sdks/libraryplaylists/README.md new file mode 100644 index 0000000..121bb73 --- /dev/null +++ b/docs/sdks/libraryplaylists/README.md @@ -0,0 +1,904 @@ +# LibraryPlaylists +(*LibraryPlaylists*) + +## Overview + +Endpoints for manipulating playlists. + +### Available Operations + +* [CreatePlaylist](#createplaylist) - Create a Playlist +* [UploadPlaylist](#uploadplaylist) - Upload +* [DeletePlaylist](#deleteplaylist) - Delete a Playlist +* [UpdatePlaylist](#updateplaylist) - Editing a Playlist +* [GetPlaylistGenerators](#getplaylistgenerators) - Get a playlist's generators +* [ClearPlaylistItems](#clearplaylistitems) - Clearing a playlist +* [AddPlaylistItems](#addplaylistitems) - Adding to a Playlist +* [DeletePlaylistItem](#deleteplaylistitem) - Delete a Generator +* [GetPlaylistGenerator](#getplaylistgenerator) - Get a playlist generator +* [ModifyPlaylistGenerator](#modifyplaylistgenerator) - Modify a Generator +* [GetPlaylistGeneratorItems](#getplaylistgeneratoritems) - Get a playlist generator's items +* [MovePlaylistItem](#moveplaylistitem) - Moving items in a playlist +* [RefreshPlaylist](#refreshplaylist) - Reprocess a generator + +## CreatePlaylist + +Create a new playlist. By default the playlist is blank. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ + URI: plexgo.Pointer("https://short-term-disconnection.name/"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.CreatePlaylistRequest](../../models/operations/createplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreatePlaylistResponse](../../models/operations/createplaylistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| 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( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.UploadPlaylist(ctx, operations.UploadPlaylistRequest{ + Path: plexgo.Pointer("/home/barkley/playlist.m3u"), + Force: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UploadPlaylistRequest](../../models/operations/uploadplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UploadPlaylistResponse](../../models/operations/uploadplaylistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeletePlaylist + +Deletes a playlist by provided id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.DeletePlaylist(ctx, operations.DeletePlaylistRequest{ + PlaylistID: 343293, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeletePlaylistRequest](../../models/operations/deleteplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeletePlaylistResponse](../../models/operations/deleteplaylistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## UpdatePlaylist + +Edits a playlist in the same manner as [editing metadata](#tag/Provider/operation/metadataPutItem) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.UpdatePlaylist(ctx, operations.UpdatePlaylistRequest{ + PlaylistID: 157966, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UpdatePlaylistRequest](../../models/operations/updateplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UpdatePlaylistResponse](../../models/operations/updateplaylistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPlaylistGenerators + +Get all the generators in a playlist + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.GetPlaylistGenerators(ctx, operations.GetPlaylistGeneratorsRequest{ + PlaylistID: 162342, + }) + 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. | +| `request` | [operations.GetPlaylistGeneratorsRequest](../../models/operations/getplaylistgeneratorsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPlaylistGeneratorsResponse](../../models/operations/getplaylistgeneratorsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ClearPlaylistItems + +Clears a playlist, only works with dumb playlists. Returns the playlist. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.ClearPlaylistItems(ctx, operations.ClearPlaylistItemsRequest{ + PlaylistID: 552140, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.ClearPlaylistItemsRequest](../../models/operations/clearplaylistitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ClearPlaylistItemsResponse](../../models/operations/clearplaylistitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddPlaylistItems + +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( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.AddPlaylistItems(ctx, operations.AddPlaylistItemsRequest{ + PlaylistID: 533723, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.AddPlaylistItemsRequest](../../models/operations/addplaylistitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddPlaylistItemsResponse](../../models/operations/addplaylistitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeletePlaylistItem + +Deletes an item from a playlist. Only works with dumb playlists. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.DeletePlaylistItem(ctx, operations.DeletePlaylistItemRequest{ + PlaylistID: 981646, + GeneratorID: 194010, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.DeletePlaylistItemRequest](../../models/operations/deleteplaylistitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeletePlaylistItemResponse](../../models/operations/deleteplaylistitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPlaylistGenerator + +Get a playlist's generator. Only used for optimized versions + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.GetPlaylistGenerator(ctx, operations.GetPlaylistGeneratorRequest{ + PlaylistID: 744880, + GeneratorID: 322168, + }) + 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. | +| `request` | [operations.GetPlaylistGeneratorRequest](../../models/operations/getplaylistgeneratorrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPlaylistGeneratorResponse](../../models/operations/getplaylistgeneratorresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ModifyPlaylistGenerator + +Modify a playlist generator. Only used for optimizer + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.ModifyPlaylistGenerator(ctx, operations.ModifyPlaylistGeneratorRequest{ + PlaylistID: 972007, + GeneratorID: 208334, + Item: &operations.Item{ + Location: &operations.ModifyPlaylistGeneratorQueryParamLocation{ + URI: plexgo.Pointer("library://82503060-0d68-4603-b594-8b071d54819e/item/%2Flibrary%2Fmetadata%2F146"), + }, + LocationID: plexgo.Pointer[int64](-1), + Policy: &operations.Policy{ + Value: plexgo.Pointer[int64](), + Scope: operations.QueryParamScopeAll.ToPointer(), + Unwatched: components.BoolIntZero.ToPointer(), + }, + Target: plexgo.Pointer(""), + TargetTagID: plexgo.Pointer[int64](1), + Title: plexgo.Pointer("Jack-Jack Attack"), + Type: plexgo.Pointer[int64](42), + }, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.ModifyPlaylistGeneratorRequest](../../models/operations/modifyplaylistgeneratorrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ModifyPlaylistGeneratorResponse](../../models/operations/modifyplaylistgeneratorresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPlaylistGeneratorItems + +Get a playlist generator's items + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.GetPlaylistGeneratorItems(ctx, operations.GetPlaylistGeneratorItemsRequest{ + PlaylistID: 77230, + GeneratorID: 979714, + }) + 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. | +| `request` | [operations.GetPlaylistGeneratorItemsRequest](../../models/operations/getplaylistgeneratoritemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPlaylistGeneratorItemsResponse](../../models/operations/getplaylistgeneratoritemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MovePlaylistItem + +Moves an item in a playlist. Only works with dumb playlists. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.MovePlaylistItem(ctx, operations.MovePlaylistItemRequest{ + PlaylistID: 940298, + PlaylistItemID: 375626, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.MovePlaylistItemRequest](../../models/operations/moveplaylistitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MovePlaylistItemResponse](../../models/operations/moveplaylistitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RefreshPlaylist + +Make a generator reprocess (refresh) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LibraryPlaylists.RefreshPlaylist(ctx, operations.RefreshPlaylistRequest{ + PlaylistID: 895314, + GeneratorID: 629742, + MetadataID: 724422, + Action: operations.ActionDisable, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.RefreshPlaylistRequest](../../models/operations/refreshplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RefreshPlaylistResponse](../../models/operations/refreshplaylistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/livetv/README.md b/docs/sdks/livetv/README.md new file mode 100644 index 0000000..99793e9 --- /dev/null +++ b/docs/sdks/livetv/README.md @@ -0,0 +1,265 @@ +# LiveTV +(*LiveTV*) + +## Overview + +LiveTV contains the playback sessions of a channel from a DVR device + + +### Available Operations + +* [GetSessions](#getsessions) - Get all sessions +* [GetLiveTVSession](#getlivetvsession) - Get a single session +* [GetSessionPlaylistIndex](#getsessionplaylistindex) - Get a session playlist index +* [GetSessionSegment](#getsessionsegment) - Get a single session segment + +## GetSessions + +Get all livetv sessions and metadata + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetSessions(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSessionsResponse](../../models/operations/getsessionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetLiveTVSession + +Get a single livetv session and metadata + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetLiveTVSession(ctx, operations.GetLiveTVSessionRequest{ + SessionID: "", + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetLiveTVSessionRequest](../../models/operations/getlivetvsessionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetLiveTVSessionResponse](../../models/operations/getlivetvsessionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSessionPlaylistIndex + +Get a playlist index for playing this session + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetSessionPlaylistIndex(ctx, operations.GetSessionPlaylistIndexRequest{ + SessionID: "", + ConsumerID: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetSessionPlaylistIndexRequest](../../models/operations/getsessionplaylistindexrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSessionPlaylistIndexResponse](../../models/operations/getsessionplaylistindexresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSessionSegment + +Get a single LiveTV session segment + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.LiveTV.GetSessionSegment(ctx, operations.GetSessionSegmentRequest{ + SessionID: "", + ConsumerID: "", + SegmentID: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.GetSessionSegmentRequest](../../models/operations/getsessionsegmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSessionSegmentResponse](../../models/operations/getsessionsegmentresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 8b777a8..9ce2ec3 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -3,29 +3,89 @@ ## Overview -Submit logs to the Log Handler for Plex Media Server - +Logging mechanism to allow clients to log to the server ### Available Operations -* [LogLine](#logline) - Logging a single line message. -* [LogMultiLine](#logmultiline) - Logging a multi-line message -* [EnablePaperTrail](#enablepapertrail) - Enabling Papertrail +* [WriteLog](#writelog) - Logging a multi-line message to the Plex Media Server log +* [WriteMessage](#writemessage) - Logging a single-line message to the Plex Media Server log +* [EnablePapertrail](#enablepapertrail) - Enabling Papertrail -## LogLine +## WriteLog -This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. +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 PUT endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above. ### Example Usage - + ```go package main import( "context" "github.com/LukeHagar/plexgo" + "os" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + example, fileErr := os.Open("example.file") + if fileErr != nil { + panic(fileErr) + } + + res, err := s.Log.WriteLog(ctx, example) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [any](../../.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.WriteLogResponse](../../models/operations/writelogresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## WriteMessage + +This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. + +Note: This endpoint responds to all HTTP verbs **except POST** but PUT is preferred + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -34,10 +94,21 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Log.LogLine(ctx, operations.LevelThree, "Test log message", "Postman") + res, err := s.Log.WriteMessage(ctx, operations.WriteMessageRequest{}) if err != nil { log.Fatal(err) } @@ -49,60 +120,40 @@ func main() { ### 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. | Test log message | -| `source` | *string* | :heavy_check_mark: | a string indicating the source of the message. | Postman | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| 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.WriteMessageRequest](../../models/operations/writemessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.LogLineResponse](../../models/operations/loglineresponse.md), error** +**[*operations.WriteMessageResponse](../../models/operations/writemessageresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| sdkerrors.LogLineBadRequest | 400 | application/json | -| sdkerrors.LogLineUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | -## LogMultiLine +## EnablePapertrail -This endpoint allows for the batch addition of log entries to the main Plex Media Server log. -It accepts a text/plain request body, where each line represents a distinct log entry. -Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. +This endpoint will enable all Plex Media Server logs to be sent to the Papertrail networked logging site for a period of time -Log entries are separated by a newline character (`\n`). -Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. -This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. - -The 'level' parameter specifies the log entry's severity or importance, with the following integer values: -- `0`: Error - Critical issues that require immediate attention. -- `1`: Warning - Important events that are not critical but may indicate potential issues. -- `2`: Info - General informational messages about system operation. -- `3`: Debug - Detailed information useful for debugging purposes. -- `4`: Verbose - Highly detailed diagnostic information for in-depth analysis. - -The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module). - -Example of a single log entry format: -`level=4&message=Sample%20log%20entry&source=applicationName` - -Ensure each parameter is properly URL-encoded to avoid interpretation issues. +Note: This endpoint responds to all HTTP verbs but POST is preferred ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -110,12 +161,21 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Log.LogMultiLine(ctx, "level=4&message=Test%20message%201&source=postman\n" + - "level=3&message=Test%20message%202&source=postman\n" + - "level=1&message=Test%20message%203&source=postman") + res, err := s.Log.EnablePapertrail(ctx, operations.EnablePapertrailRequest{}) if err != nil { log.Fatal(err) } @@ -127,73 +187,18 @@ func main() { ### 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` | [string](../../.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| 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.EnablePapertrailRequest](../../models/operations/enablepapertrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.LogMultiLineResponse](../../models/operations/logmultilineresponse.md), error** +**[*operations.EnablePapertrailResponse](../../models/operations/enablepapertrailresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| sdkerrors.LogMultiLineBadRequest | 400 | application/json | -| sdkerrors.LogMultiLineUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Log.EnablePaperTrail(ctx) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.EnablePaperTrailResponse](../../models/operations/enablepapertrailresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.EnablePaperTrailBadRequest | 400 | application/json | -| sdkerrors.EnablePaperTrailUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md deleted file mode 100644 index ef6f106..0000000 --- a/docs/sdks/media/README.md +++ /dev/null @@ -1,299 +0,0 @@ -# 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 -* [GetBannerImage](#getbannerimage) - Get Banner Image -* [GetThumbImage](#getthumbimage) - Get Thumb Image - -## MarkPlayed - -This will mark the provided media key as Played. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.MarkPlayed(ctx, 59398) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `key` | *float64* | :heavy_check_mark: | The media key to mark as played | 59398 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.MarkPlayedResponse](../../models/operations/markplayedresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------- | -------------------------------- | -------------------------------- | -| sdkerrors.MarkPlayedBadRequest | 400 | application/json | -| sdkerrors.MarkPlayedUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## MarkUnplayed - -This will mark the provided media key as Unplayed. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.MarkUnplayed(ctx, 59398) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `key` | *float64* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.MarkUnplayedResponse](../../models/operations/markunplayedresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| sdkerrors.MarkUnplayedBadRequest | 400 | application/json | -| sdkerrors.MarkUnplayedUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.UpdatePlayProgress(ctx, "", 90000, "played") - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `key` | *string* | :heavy_check_mark: | the media key | | -| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 | -| `state` | *string* | :heavy_check_mark: | The playback state of the media item. | played | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.UpdatePlayProgressResponse](../../models/operations/updateplayprogressresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| sdkerrors.UpdatePlayProgressBadRequest | 400 | application/json | -| sdkerrors.UpdatePlayProgressUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetBannerImage - -Gets the banner image of the media item - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.GetBannerImage(ctx, operations.GetBannerImageRequest{ - RatingKey: 9518, - Width: 396, - Height: 396, - MinSize: 1, - Upscale: 1, - XPlexToken: "CV5xoxjTpFKUzBTShsaf", - }) - if err != nil { - log.Fatal(err) - } - if res.ResponseStream != 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. | -| `request` | [operations.GetBannerImageRequest](../../models/operations/getbannerimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetBannerImageResponse](../../models/operations/getbannerimageresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.GetBannerImageBadRequest | 400 | application/json | -| sdkerrors.GetBannerImageUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetThumbImage - -Gets the thumbnail image of the media item - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Media.GetThumbImage(ctx, operations.GetThumbImageRequest{ - RatingKey: 9518, - Width: 396, - Height: 396, - MinSize: 1, - Upscale: 1, - XPlexToken: "CV5xoxjTpFKUzBTShsaf", - }) - if err != nil { - log.Fatal(err) - } - if res.ResponseStream != 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. | -| `request` | [operations.GetThumbImageRequest](../../models/operations/getthumbimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetThumbImageResponse](../../models/operations/getthumbimageresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.GetThumbImageBadRequest | 400 | application/json | -| sdkerrors.GetThumbImageUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/playlist/README.md b/docs/sdks/playlist/README.md new file mode 100644 index 0000000..59a5dd9 --- /dev/null +++ b/docs/sdks/playlist/README.md @@ -0,0 +1,209 @@ +# Playlist +(*Playlist*) + +## Overview + +Media playlists that can be created and played back + +### Available Operations + +* [ListPlaylists](#listplaylists) - List playlists +* [GetPlaylist](#getplaylist) - Retrieve Playlist +* [GetPlaylistItems](#getplaylistitems) - Retrieve Playlist Contents + +## ListPlaylists + +Gets a list of playlists and playlist folders for a user. General filters are permitted, such as `sort=lastViewedAt:desc`. A flat playlist list can be retrieved using `type=15` to limit the collection to just playlists. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Playlist.ListPlaylists(ctx, operations.ListPlaylistsRequest{}) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.ListPlaylistsRequest](../../models/operations/listplaylistsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListPlaylistsResponse](../../models/operations/listplaylistsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| 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( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Playlist.GetPlaylist(ctx, operations.GetPlaylistRequest{ + PlaylistID: 841953, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.GetPlaylistRequest](../../models/operations/getplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPlaylistResponse](../../models/operations/getplaylistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPlaylistItems + +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( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Playlist.GetPlaylistItems(ctx, operations.GetPlaylistItemsRequest{ + PlaylistID: 118195, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithMetadata != 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. | +| `request` | [operations.GetPlaylistItemsRequest](../../models/operations/getplaylistitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPlaylistItemsResponse](../../models/operations/getplaylistitemsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md deleted file mode 100644 index b4ea4fa..0000000 --- a/docs/sdks/playlists/README.md +++ /dev/null @@ -1,530 +0,0 @@ -# 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. `server://1234/com.plexapp.plugins.library/library/metadata/1`). -- `playQueueID` - To create a playlist from an existing play queue. - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ - Title: "", - Type: operations.CreatePlaylistQueryParamTypeAudio, - Smart: operations.SmartOne, - URI: "https://short-term-disconnection.name/", - }) - 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. | -| `request` | [operations.CreatePlaylistRequest](../../models/operations/createplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.CreatePlaylistResponse](../../models/operations/createplaylistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.CreatePlaylistBadRequest | 400 | application/json | -| sdkerrors.CreatePlaylistUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetPlaylists - -Get All Playlists given the specified filters. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.GetPlaylists(ctx, nil, nil) - 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. | -| `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). | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetPlaylistsResponse](../../models/operations/getplaylistsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| sdkerrors.GetPlaylistsBadRequest | 400 | application/json | -| sdkerrors.GetPlaylistsUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.GetPlaylist(ctx, 8419.53) - 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. | -| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetPlaylistResponse](../../models/operations/getplaylistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| sdkerrors.GetPlaylistBadRequest | 400 | application/json | -| sdkerrors.GetPlaylistUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## DeletePlaylist - -This endpoint will delete a playlist - - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.DeletePlaylist(ctx, 3432.93) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.DeletePlaylistResponse](../../models/operations/deleteplaylistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.DeletePlaylistBadRequest | 400 | application/json | -| sdkerrors.DeletePlaylistUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.UpdatePlaylist(ctx, 1579.66, nil, nil) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | -| `title` | **string* | :heavy_minus_sign: | name of the playlist | -| `summary` | **string* | :heavy_minus_sign: | summary description of the playlist | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.UpdatePlaylistResponse](../../models/operations/updateplaylistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.UpdatePlaylistBadRequest | 400 | application/json | -| sdkerrors.UpdatePlaylistUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.GetPlaylistContents(ctx, 5535.42, operations.GetPlaylistContentsQueryParamTypeTvShow) - 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. | | -| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | | -| `type_` | [operations.GetPlaylistContentsQueryParamType](../../models/operations/getplaylistcontentsqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetPlaylistContentsResponse](../../models/operations/getplaylistcontentsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.GetPlaylistContentsBadRequest | 400 | application/json | -| sdkerrors.GetPlaylistContentsUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.ClearPlaylistContents(ctx, 4137.37) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.ClearPlaylistContentsResponse](../../models/operations/clearplaylistcontentsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| sdkerrors.ClearPlaylistContentsBadRequest | 400 | application/json | -| sdkerrors.ClearPlaylistContentsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## AddPlaylistContents - -Adds a generator to a playlist, same parameters as the POST to create. 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.AddPlaylistContents(ctx, 7013.44, "server://12345/com.plexapp.plugins.library/library/metadata/1", plexgo.Pointer[float64](123)) - 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. | | -| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | | -| `uri` | *string* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 | -| `playQueueID` | **float64* | :heavy_minus_sign: | the play queue to add to a playlist | 123 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.AddPlaylistContentsResponse](../../models/operations/addplaylistcontentsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.AddPlaylistContentsBadRequest | 400 | application/json | -| sdkerrors.AddPlaylistContentsUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Playlists.UploadPlaylist(ctx, "/home/barkley/playlist.m3u", operations.QueryParamForceOne, 1) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `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.QueryParamForce](../../models/operations/queryparamforce.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.
| | -| `sectionID` | *int64* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.UploadPlaylistResponse](../../models/operations/uploadplaylistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.UploadPlaylistBadRequest | 400 | application/json | -| sdkerrors.UploadPlaylistUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/playqueue/README.md b/docs/sdks/playqueue/README.md new file mode 100644 index 0000000..2a44094 --- /dev/null +++ b/docs/sdks/playqueue/README.md @@ -0,0 +1,629 @@ +# PlayQueue +(*PlayQueue*) + +## Overview + +The playqueue feature within a media provider +A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue. +Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed. +You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion. +All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area. +The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item. + +### Available Operations + +* [CreatePlayQueue](#createplayqueue) - Create a play queue +* [GetPlayQueue](#getplayqueue) - Retrieve a play queue +* [AddToPlayQueue](#addtoplayqueue) - Add a generator or playlist to a play queue +* [ClearPlayQueue](#clearplayqueue) - Clear a play queue +* [ResetPlayQueue](#resetplayqueue) - Reset a play queue +* [Shuffle](#shuffle) - Shuffle a play queue +* [Unshuffle](#unshuffle) - Unshuffle a play queue +* [DeletePlayQueueItem](#deleteplayqueueitem) - Delete an item from a play queue +* [MovePlayQueueItem](#moveplayqueueitem) - Move an item in a play queue + +## CreatePlayQueue + +Makes a new play queue for a device. The source of the playqueue can either be a URI, or a playlist. The response is a media container with the initial items in the queue. Each item in the queue will be a regular item but with `playQueueItemID` - a unique ID since the queue could have repeated items with the same `ratingKey`. +Note: Either `uri` or `playlistID` must be specified + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.CreatePlayQueue(ctx, operations.CreatePlayQueueRequest{ + Type: operations.TypeAudio, + Shuffle: components.BoolIntOne.ToPointer(), + Repeat: components.BoolIntOne.ToPointer(), + Continuous: components.BoolIntOne.ToPointer(), + Recursive: components.BoolIntOne.ToPointer(), + OnDeck: components.BoolIntOne.ToPointer(), + }) + 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. | +| `request` | [operations.CreatePlayQueueRequest](../../models/operations/createplayqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreatePlayQueueResponse](../../models/operations/createplayqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPlayQueue + +Retrieves the play queue, centered at current item. This can be treated as a regular container by play queue-oblivious clients, but they may wish to request a large window onto the queue since they won't know to refresh. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.GetPlayQueue(ctx, operations.GetPlayQueueRequest{ + PlayQueueID: 210646, + Own: components.BoolIntOne.ToPointer(), + IncludeBefore: components.BoolIntOne.ToPointer(), + IncludeAfter: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.GetPlayQueueRequest](../../models/operations/getplayqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPlayQueueResponse](../../models/operations/getplayqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddToPlayQueue + +Adds an item to a play queue (e.g. party mode). Increments the version of the play queue. Takes the following parameters (`uri` and `playlistID` are mutually exclusive). Returns the modified play queue. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.AddToPlayQueue(ctx, operations.AddToPlayQueueRequest{ + PlayQueueID: 919248, + Next: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.AddToPlayQueueRequest](../../models/operations/addtoplayqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddToPlayQueueResponse](../../models/operations/addtoplayqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ClearPlayQueue + +Deletes all items in the play queue, and increases the version of the play queue. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.ClearPlayQueue(ctx, operations.ClearPlayQueueRequest{ + PlayQueueID: 86357, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.ClearPlayQueueRequest](../../models/operations/clearplayqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ClearPlayQueueResponse](../../models/operations/clearplayqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ResetPlayQueue + +Reset a play queue to the first item being the current item + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.ResetPlayQueue(ctx, operations.ResetPlayQueueRequest{ + PlayQueueID: 581891, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.ResetPlayQueueRequest](../../models/operations/resetplayqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ResetPlayQueueResponse](../../models/operations/resetplayqueueresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Shuffle + +Shuffle a play queue (or reshuffles if already shuffled). The currently selected item is maintained. Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.Shuffle(ctx, operations.ShuffleRequest{ + PlayQueueID: 316150, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.ShuffleRequest](../../models/operations/shufflerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ShuffleResponse](../../models/operations/shuffleresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Unshuffle + +Unshuffles a play queue and restores "natural order". Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.Unshuffle(ctx, operations.UnshuffleRequest{ + PlayQueueID: 484388, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.UnshuffleRequest](../../models/operations/unshufflerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UnshuffleResponse](../../models/operations/unshuffleresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeletePlayQueueItem + +Deletes an item in a play queue. Increments the version of the play queue. Returns the modified play queue. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.DeletePlayQueueItem(ctx, operations.DeletePlayQueueItemRequest{ + PlayQueueID: 285738, + PlayQueueItemID: 464354, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.DeletePlayQueueItemRequest](../../models/operations/deleteplayqueueitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeletePlayQueueItemResponse](../../models/operations/deleteplayqueueitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MovePlayQueueItem + +Moves an item in a play queue, and increases the version of the play queue. Returns the modified play queue. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.PlayQueue.MovePlayQueueItem(ctx, operations.MovePlayQueueItemRequest{ + PlayQueueID: 31341, + PlayQueueItemID: 495865, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithPlaylistMetadata != 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. | +| `request` | [operations.MovePlayQueueItemRequest](../../models/operations/moveplayqueueitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MovePlayQueueItemResponse](../../models/operations/moveplayqueueitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md deleted file mode 100644 index 49b1a6b..0000000 --- a/docs/sdks/plex/README.md +++ /dev/null @@ -1,396 +0,0 @@ -# Plex -(*Plex*) - -## Overview - -API Calls that perform operations directly against https://Plex.tv - - -### Available Operations - -* [GetCompanionsData](#getcompanionsdata) - Get Companions Data -* [GetUserFriends](#getuserfriends) - Get list of friends of the user logged in -* [GetGeoData](#getgeodata) - Get Geo Data -* [GetHomeData](#gethomedata) - Get Plex Home Data -* [GetServerResources](#getserverresources) - Get Server Resources -* [GetPin](#getpin) - Get a Pin -* [GetTokenByPinID](#gettokenbypinid) - Get Access Token by PinId - -## GetCompanionsData - -Get Companions Data - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Plex.GetCompanionsData(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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetCompanionsDataResponse](../../models/operations/getcompanionsdataresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| sdkerrors.GetCompanionsDataBadRequest | 400 | application/json | -| sdkerrors.GetCompanionsDataUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetUserFriends - -Get friends of provided auth token. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Plex.GetUserFriends(ctx) - if err != nil { - log.Fatal(err) - } - if res.Friends != 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetUserFriendsResponse](../../models/operations/getuserfriendsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| sdkerrors.GetUserFriendsBadRequest | 400 | application/json | -| sdkerrors.GetUserFriendsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetGeoData - -Returns the geolocation and locale data of the caller - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Plex.GetGeoData(ctx) - if err != nil { - log.Fatal(err) - } - if res.GeoData != 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetGeoDataResponse](../../models/operations/getgeodataresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------- | -------------------------------- | -------------------------------- | -| sdkerrors.GetGeoDataBadRequest | 400 | application/json | -| sdkerrors.GetGeoDataUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetHomeData - -Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Plex.GetHomeData(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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetHomeDataResponse](../../models/operations/gethomedataresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| sdkerrors.GetHomeDataBadRequest | 400 | application/json | -| sdkerrors.GetHomeDataUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetServerResources - -Get Plex server access tokens and server connections - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Plex.GetServerResources(ctx, "3381b62b-9ab7-4e37-827b-203e9809eb58", operations.IncludeHTTPSEnable.ToPointer(), operations.IncludeRelayEnable.ToPointer(), operations.IncludeIPv6Enable.ToPointer()) - if err != nil { - log.Fatal(err) - } - if res.PlexDevices != 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. | | -| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `includeHTTPS` | [*operations.IncludeHTTPS](../../models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | -| `includeRelay` | [*operations.IncludeRelay](../../models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | -| `includeIPv6` | [*operations.IncludeIPv6](../../models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetServerResourcesResponse](../../models/operations/getserverresourcesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| sdkerrors.GetServerResourcesBadRequest | 400 | application/json | -| sdkerrors.GetServerResourcesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetPin - -Retrieve a Pin ID from Plex.tv to use for authentication flows - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{ - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), - }) - if err != nil { - log.Fatal(err) - } - if res.AuthPinContainer != 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. | -| `request` | [operations.GetPinRequest](../../models/operations/getpinrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetPinResponse](../../models/operations/getpinresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| sdkerrors.GetPinBadRequest | 400 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetTokenByPinID - -Retrieve an Access Token from Plex.tv after the Pin has been authenticated - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Plex.GetTokenByPinID(ctx, operations.GetTokenByPinIDRequest{ - PinID: 232248, - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), - }) - if err != nil { - log.Fatal(err) - } - if res.AuthPinContainer != 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. | -| `request` | [operations.GetTokenByPinIDRequest](../../models/operations/gettokenbypinidrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetTokenByPinIDResponse](../../models/operations/gettokenbypinidresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.GetTokenByPinIDBadRequest | 400 | application/json | -| sdkerrors.GetTokenByPinIDResponseBody | 404 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md deleted file mode 100644 index 1e395e4..0000000 --- a/docs/sdks/plexapi/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# PlexAPI SDK - -## Overview - -# Plex Media Server OpenAPI Specification - -An Open Source OpenAPI Specification for Plex Media Server - -Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) - -## Documentation - -[API Documentation](https://plexapi.dev) - -## SDKs - -The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). - -| Language | Repository | Releases | Other | -| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | -| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | -| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | -| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | -| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | -| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | -| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | -| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | -| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - - - -### Available Operations diff --git a/docs/sdks/preferences/README.md b/docs/sdks/preferences/README.md new file mode 100644 index 0000000..ae0b37d --- /dev/null +++ b/docs/sdks/preferences/README.md @@ -0,0 +1,192 @@ +# Preferences +(*Preferences*) + +## Overview + +API Operations against the Preferences + +### Available Operations + +* [GetAllPreferences](#getallpreferences) - Get all preferences +* [SetPreferences](#setpreferences) - Set preferences +* [GetPreference](#getpreference) - Get a preferences + +## GetAllPreferences + +Get the list of all preferences + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Preferences.GetAllPreferences(ctx) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSettings != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAllPreferencesResponse](../../models/operations/getallpreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## SetPreferences + +Set a set of preferences in query parameters + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Preferences.SetPreferences(ctx, operations.SetPreferencesRequest{ + Prefs: operations.Prefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetPreferencesRequest](../../models/operations/setpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetPreferencesResponse](../../models/operations/setpreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetPreference + +Get a single preference and value + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Preferences.GetPreference(ctx, operations.GetPreferenceRequest{}) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSettings != 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. | +| `request` | [operations.GetPreferenceRequest](../../models/operations/getpreferencerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetPreferenceResponse](../../models/operations/getpreferenceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/provider/README.md b/docs/sdks/provider/README.md new file mode 100644 index 0000000..565aae0 --- /dev/null +++ b/docs/sdks/provider/README.md @@ -0,0 +1,245 @@ +# Provider +(*Provider*) + +## Overview + +Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers. + +### Available Operations + +* [ListProviders](#listproviders) - Get the list of available media providers +* [AddProvider](#addprovider) - Add a media provider +* [RefreshProviders](#refreshproviders) - Refresh media providers +* [DeleteMediaProvider](#deletemediaprovider) - Delete a media provider + +## ListProviders + +Get the list of all available media providers for this PMS. This will generally include the library provider and possibly EPG if DVR is set up. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Provider.ListProviders(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListProvidersResponse](../../models/operations/listprovidersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## AddProvider + +This endpoint registers a media provider with the server. Once registered, the media server acts as a reverse proxy to the provider, allowing both local and remote providers to work. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Provider.AddProvider(ctx, operations.AddProviderRequest{ + URL: "https://steep-obedience.name/", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.AddProviderRequest](../../models/operations/addproviderrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AddProviderResponse](../../models/operations/addproviderresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## RefreshProviders + +Refresh all known media providers. This is useful in case a provider has updated features. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Provider.RefreshProviders(ctx) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.RefreshProvidersResponse](../../models/operations/refreshprovidersresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteMediaProvider + +Deletes a media provider with the given id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Provider.DeleteMediaProvider(ctx, operations.DeleteMediaProviderRequest{ + Provider: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteMediaProviderRequest](../../models/operations/deletemediaproviderrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteMediaProviderResponse](../../models/operations/deletemediaproviderresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/rate/README.md b/docs/sdks/rate/README.md new file mode 100644 index 0000000..6161b90 --- /dev/null +++ b/docs/sdks/rate/README.md @@ -0,0 +1,79 @@ +# Rate +(*Rate*) + +## Overview + +Operations for rating media items (thumbs up/down, star ratings, etc.) + +### Available Operations + +* [SetRating](#setrating) - Rate an item + +## SetRating + +Set the rating on an item. +This API does respond to the GET verb but applications should use PUT + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Rate.SetRating(ctx, operations.SetRatingRequest{ + Identifier: "", + Key: "", + Rating: 8722.46, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.SetRatingRequest](../../models/operations/setratingrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.SetRatingResponse](../../models/operations/setratingresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 124b6c3..a4a980a 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -3,16 +3,16 @@ ## Overview -API Calls that perform search operations with Plex Media Server - +The search feature within a media provider ### Available Operations -* [PerformSearch](#performsearch) - Perform a search -* [PerformVoiceSearch](#performvoicesearch) - Perform a voice search -* [GetSearchResults](#getsearchresults) - Get Search Results +* [SearchHubs](#searchhubs) - Search Hub +* [VoiceSearchHubs](#voicesearchhubs) - Voice Search Hub -## PerformSearch +## SearchHubs + +Perform a search and get the result as hubs 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). @@ -30,13 +30,15 @@ This request is intended to be very fast, and called as the user types. ### Example Usage - + ```go package main import( "context" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -44,124 +46,24 @@ func main() { ctx := context.Background() s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) - res, err := s.Search.PerformSearch(ctx, "arnold", nil, plexgo.Pointer[float64](5)) - if err != nil { - log.Fatal(err) - } - if res != 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 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 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.PerformSearchResponse](../../models/operations/performsearchresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.PerformSearchBadRequest | 400 | application/json | -| sdkerrors.PerformSearchUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Search.PerformVoiceSearch(ctx, "dead+poop", nil, plexgo.Pointer[float64](5)) - if err != nil { - log.Fatal(err) - } - if res != 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 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 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.PerformVoiceSearchResponse](../../models/operations/performvoicesearchresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| sdkerrors.PerformVoiceSearchBadRequest | 400 | application/json | -| sdkerrors.PerformVoiceSearchUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetSearchResults - -This will search the database for the string provided. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Search.GetSearchResults(ctx, "110") + res, err := s.Search.SearchHubs(ctx, operations.SearchHubsRequest{ + Query: "", + SectionID: plexgo.Pointer[int64](1), + }) if err != nil { log.Fatal(err) } @@ -173,20 +75,89 @@ func main() { ### 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 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| 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.SearchHubsRequest](../../models/operations/searchhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.GetSearchResultsResponse](../../models/operations/getsearchresultsresponse.md), error** +**[*operations.SearchHubsResponse](../../models/operations/searchhubsresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.GetSearchResultsBadRequest | 400 | application/json | -| sdkerrors.GetSearchResultsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## VoiceSearchHubs + +Perform a search tailored to voice input and get the result as hubs + +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( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Search.VoiceSearchHubs(ctx, operations.VoiceSearchHubsRequest{ + Query: "", + }) + 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. | +| `request` | [operations.VoiceSearchHubsRequest](../../models/operations/voicesearchhubsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.VoiceSearchHubsResponse](../../models/operations/voicesearchhubsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md deleted file mode 100644 index 4c15051..0000000 --- a/docs/sdks/server/README.md +++ /dev/null @@ -1,495 +0,0 @@ -# Server -(*Server*) - -## Overview - -Operations against the Plex Media Server System. - - -### Available Operations - -* [GetServerCapabilities](#getservercapabilities) - Get 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 -* [GetMediaProviders](#getmediaproviders) - Get Media Providers -* [GetServerList](#getserverlist) - Get Server List - -## GetServerCapabilities - -Get Server Capabilities - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetServerCapabilitiesResponse](../../models/operations/getservercapabilitiesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| sdkerrors.GetServerCapabilitiesBadRequest | 400 | application/json | -| sdkerrors.GetServerCapabilitiesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetServerPreferences - -Get Server Preferences - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetServerPreferences(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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetServerPreferencesResponse](../../models/operations/getserverpreferencesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| sdkerrors.GetServerPreferencesBadRequest | 400 | application/json | -| sdkerrors.GetServerPreferencesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetAvailableClients - -Get Available Clients - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetAvailableClients(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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetAvailableClientsResponse](../../models/operations/getavailableclientsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.GetAvailableClientsBadRequest | 400 | application/json | -| sdkerrors.GetAvailableClientsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetDevices - -Get Devices - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetDevicesResponse](../../models/operations/getdevicesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------- | -------------------------------- | -------------------------------- | -| sdkerrors.GetDevicesBadRequest | 400 | application/json | -| sdkerrors.GetDevicesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetServerIdentity - -This request is useful to determine if the server is online or offline - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New() - - 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetServerIdentityResponse](../../models/operations/getserveridentityresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| sdkerrors.GetServerIdentityRequestTimeout | 408 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetMyPlexAccount - -Returns MyPlex Account Information - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetMyPlexAccountResponse](../../models/operations/getmyplexaccountresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.GetMyPlexAccountBadRequest | 400 | application/json | -| sdkerrors.GetMyPlexAccountUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetResizedPhoto(ctx, operations.GetResizedPhotoRequest{ - Width: 110, - Height: 165, - Blur: 0, - MinSize: operations.MinSizeZero, - Upscale: operations.UpscaleZero, - URL: "/library/metadata/49564/thumb/1654258204", - }) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `request` | [operations.GetResizedPhotoRequest](../../models/operations/getresizedphotorequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetResizedPhotoResponse](../../models/operations/getresizedphotoresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.GetResizedPhotoBadRequest | 400 | application/json | -| sdkerrors.GetResizedPhotoUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetMediaProviders - -Retrieves media providers and their features from the Plex server. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Server.GetMediaProviders(ctx, "CV5xoxjTpFKUzBTShsaf") - 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. | | -| `xPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetMediaProvidersResponse](../../models/operations/getmediaprovidersresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| sdkerrors.GetMediaProvidersBadRequest | 400 | application/json | -| sdkerrors.GetMediaProvidersUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetServerList - -Get Server List - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetServerListResponse](../../models/operations/getserverlistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.GetServerListBadRequest | 400 | application/json | -| sdkerrors.GetServerListUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md deleted file mode 100644 index 390a7f2..0000000 --- a/docs/sdks/sessions/README.md +++ /dev/null @@ -1,228 +0,0 @@ -# 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( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Sessions.GetSessions(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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetSessionsResponse](../../models/operations/getsessionsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| sdkerrors.GetSessionsBadRequest | 400 | application/json | -| sdkerrors.GetSessionsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetSessionHistory - -This will Retrieve a listing of all history views. - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Sessions.GetSessionHistory(ctx, plexgo.Pointer("viewedAt:desc"), plexgo.Pointer[int64](1), &operations.QueryParamFilter{}, plexgo.Pointer[int64](12)) - 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. | | -| `sort` | **string* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | -| `accountID` | **int64* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| 1 | -| `filter` | [*operations.QueryParamFilter](../../models/operations/queryparamfilter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | -| `librarySectionID` | **int64* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| 12 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetSessionHistoryResponse](../../models/operations/getsessionhistoryresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| sdkerrors.GetSessionHistoryBadRequest | 400 | application/json | -| sdkerrors.GetSessionHistoryUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetTranscodeSessions - -Get Transcode Sessions - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - 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. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetTranscodeSessionsResponse](../../models/operations/gettranscodesessionsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| sdkerrors.GetTranscodeSessionsBadRequest | 400 | application/json | -| sdkerrors.GetTranscodeSessionsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## StopTranscodeSession - -Stop a Transcode Session - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Sessions.StopTranscodeSession(ctx, "zz7llzqlx8w9vnrsbnwhbmep") - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `sessionKey` | *string* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.StopTranscodeSessionResponse](../../models/operations/stoptranscodesessionresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| sdkerrors.StopTranscodeSessionBadRequest | 400 | application/json | -| sdkerrors.StopTranscodeSessionUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md deleted file mode 100644 index f48ff68..0000000 --- a/docs/sdks/statistics/README.md +++ /dev/null @@ -1,172 +0,0 @@ -# Statistics -(*Statistics*) - -## Overview - -API Calls that perform operations with Plex Media Server Statistics - - -### Available Operations - -* [GetStatistics](#getstatistics) - Get Media Statistics -* [GetResourcesStatistics](#getresourcesstatistics) - Get Resources Statistics -* [GetBandwidthStatistics](#getbandwidthstatistics) - Get Bandwidth Statistics - -## GetStatistics - -This will return the media statistics for the server - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Statistics.GetStatistics(ctx, plexgo.Pointer[int64](4)) - 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. | | -| `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetStatisticsResponse](../../models/operations/getstatisticsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| sdkerrors.GetStatisticsBadRequest | 400 | application/json | -| sdkerrors.GetStatisticsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetResourcesStatistics - -This will return the resources for the server - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Statistics.GetResourcesStatistics(ctx, plexgo.Pointer[int64](4)) - 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. | | -| `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetResourcesStatisticsResponse](../../models/operations/getresourcesstatisticsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| sdkerrors.GetResourcesStatisticsBadRequest | 400 | application/json | -| sdkerrors.GetResourcesStatisticsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## GetBandwidthStatistics - -This will return the bandwidth statistics for the server - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Statistics.GetBandwidthStatistics(ctx, plexgo.Pointer[int64](4)) - 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. | | -| `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.GetBandwidthStatisticsResponse](../../models/operations/getbandwidthstatisticsresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| sdkerrors.GetBandwidthStatisticsBadRequest | 400 | application/json | -| sdkerrors.GetBandwidthStatisticsUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/status/README.md b/docs/sdks/status/README.md new file mode 100644 index 0000000..62bc791 --- /dev/null +++ b/docs/sdks/status/README.md @@ -0,0 +1,405 @@ +# Status +(*Status*) + +## Overview + +The status endpoints give you information about current playbacks, play history, and even terminating sessions. + +### Available Operations + +* [ListSessions](#listsessions) - List Sessions +* [GetBackgroundTasks](#getbackgroundtasks) - Get background tasks +* [ListPlaybackHistory](#listplaybackhistory) - List Playback History +* [TerminateSession](#terminatesession) - Terminate a session +* [DeleteHistory](#deletehistory) - Delete Single History Item +* [GetHistoryItem](#gethistoryitem) - Get Single History Item + +## ListSessions + +List all current playbacks on this server + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Status.ListSessions(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListSessionsResponse](../../models/operations/listsessionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetBackgroundTasks + +Get the list of all background tasks + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Status.GetBackgroundTasks(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetBackgroundTasksResponse](../../models/operations/getbackgroundtasksresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ListPlaybackHistory + +List all playback history (Admin can see all users, others can only see their own). +Pagination should be used on this endpoint. Additionally this endpoint supports `includeFields`, `excludeFields`, `includeElements`, and `excludeElements` parameters. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Status.ListPlaybackHistory(ctx, operations.ListPlaybackHistoryRequest{ + Sort: []string{ + "v", + "i", + "e", + "w", + "e", + "d", + "A", + "t", + ":", + "d", + "e", + "s", + "c", + ",", + "a", + "c", + "c", + "o", + "u", + "n", + "t", + "I", + "D", + }, + }) + 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. | +| `request` | [operations.ListPlaybackHistoryRequest](../../models/operations/listplaybackhistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListPlaybackHistoryResponse](../../models/operations/listplaybackhistoryresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## TerminateSession + +Terminate a playback session kicking off the user + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Status.TerminateSession(ctx, operations.TerminateSessionRequest{ + SessionID: "cdefghijklmnopqrstuvwxyz", + Reason: plexgo.Pointer("Stop Playing"), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.TerminateSessionRequest](../../models/operations/terminatesessionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.TerminateSessionResponse](../../models/operations/terminatesessionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteHistory + +Delete a single history item by id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Status.DeleteHistory(ctx, operations.DeleteHistoryRequest{ + HistoryID: 953579, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainer != 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. | +| `request` | [operations.DeleteHistoryRequest](../../models/operations/deletehistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteHistoryResponse](../../models/operations/deletehistoryresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetHistoryItem + +Get a single history item by id + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Status.GetHistoryItem(ctx, operations.GetHistoryItemRequest{ + HistoryID: 832213, + }) + if err != nil { + log.Fatal(err) + } + if res.HistoryAllGetResponses200 != 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. | +| `request` | [operations.GetHistoryItemRequest](../../models/operations/gethistoryitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetHistoryItemResponse](../../models/operations/gethistoryitemresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/subscriptions/README.md b/docs/sdks/subscriptions/README.md new file mode 100644 index 0000000..ad6a8ec --- /dev/null +++ b/docs/sdks/subscriptions/README.md @@ -0,0 +1,658 @@ +# Subscriptions +(*Subscriptions*) + +## Overview + +Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available + + +### Available Operations + +* [GetAllSubscriptions](#getallsubscriptions) - Get all subscriptions +* [CreateSubscription](#createsubscription) - Create a subscription +* [ProcessSubscriptions](#processsubscriptions) - Process all subscriptions +* [GetScheduledRecordings](#getscheduledrecordings) - Get all scheduled recordings +* [GetTemplate](#gettemplate) - Get the subscription template +* [CancelGrab](#cancelgrab) - Cancel an existing grab +* [DeleteSubscription](#deletesubscription) - Delete a subscription +* [GetSubscription](#getsubscription) - Get a single subscription +* [EditSubscriptionPreferences](#editsubscriptionpreferences) - Edit a subscription +* [ReorderSubscription](#reordersubscription) - Re-order a subscription + +## GetAllSubscriptions + +Get all subscriptions and potentially the grabs too + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetAllSubscriptions(ctx, operations.GetAllSubscriptionsRequest{ + IncludeGrabs: components.BoolIntOne.ToPointer(), + IncludeStorage: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != 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. | +| `request` | [operations.GetAllSubscriptionsRequest](../../models/operations/getallsubscriptionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAllSubscriptionsResponse](../../models/operations/getallsubscriptionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CreateSubscription + +Create a subscription. The query parameters should be mostly derived from the [template](#tag/Subscriptions/operation/mediaSubscriptionsGetTemplate) + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.CreateSubscription(ctx, operations.CreateSubscriptionRequest{ + TargetLibrarySectionID: plexgo.Pointer[int64](1), + TargetSectionLocationID: plexgo.Pointer[int64](3), + Type: plexgo.Pointer[int64](2), + Hints: &operations.Hints{}, + Prefs: &operations.CreateSubscriptionQueryParamPrefs{}, + Params: &operations.Params{}, + }) + 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. | +| `request` | [operations.CreateSubscriptionRequest](../../models/operations/createsubscriptionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateSubscriptionResponse](../../models/operations/createsubscriptionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ProcessSubscriptions + +Process all subscriptions asynchronously + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.ProcessSubscriptions(ctx) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ProcessSubscriptionsResponse](../../models/operations/processsubscriptionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetScheduledRecordings + +Get all scheduled recordings across all subscriptions + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetScheduledRecordings(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. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetScheduledRecordingsResponse](../../models/operations/getscheduledrecordingsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetTemplate + +Get the templates for a piece of media which could include fetching one airing, season, the whole show, etc. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetTemplate(ctx, operations.GetTemplateRequest{ + GUID: plexgo.Pointer("plex://episode/5fc70265c40548002d539d23"), + }) + 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. | +| `request` | [operations.GetTemplateRequest](../../models/operations/gettemplaterequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetTemplateResponse](../../models/operations/gettemplateresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CancelGrab + +Cancels an existing media grab (recording). It can be used to resolve a conflict which exists for a rolling subscription. +Note: This cancellation does not persist across a server restart, but neither does a rolling subscription itself. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.CancelGrab(ctx, operations.CancelGrabRequest{ + OperationID: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.CancelGrabRequest](../../models/operations/cancelgrabrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CancelGrabResponse](../../models/operations/cancelgrabresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## DeleteSubscription + +Delete a subscription, cancelling all of its grabs as well + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.DeleteSubscription(ctx, operations.DeleteSubscriptionRequest{ + SubscriptionID: 974618, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.DeleteSubscriptionRequest](../../models/operations/deletesubscriptionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.DeleteSubscriptionResponse](../../models/operations/deletesubscriptionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetSubscription + +Get a single subscription and potentially the grabs too + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.GetSubscription(ctx, operations.GetSubscriptionRequest{ + SubscriptionID: 186713, + IncludeGrabs: components.BoolIntOne.ToPointer(), + IncludeStorage: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != 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. | +| `request` | [operations.GetSubscriptionRequest](../../models/operations/getsubscriptionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetSubscriptionResponse](../../models/operations/getsubscriptionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## EditSubscriptionPreferences + +Edit a subscription's preferences + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.EditSubscriptionPreferences(ctx, operations.EditSubscriptionPreferencesRequest{ + SubscriptionID: 673918, + Prefs: &operations.EditSubscriptionPreferencesQueryParamPrefs{}, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != 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. | +| `request` | [operations.EditSubscriptionPreferencesRequest](../../models/operations/editsubscriptionpreferencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.EditSubscriptionPreferencesResponse](../../models/operations/editsubscriptionpreferencesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## ReorderSubscription + +Re-order a subscription to change its priority + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Subscriptions.ReorderSubscription(ctx, operations.ReorderSubscriptionRequest{ + SubscriptionID: 440634, + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithSubscription != 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. | +| `request` | [operations.ReorderSubscriptionRequest](../../models/operations/reordersubscriptionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ReorderSubscriptionResponse](../../models/operations/reordersubscriptionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/timeline/README.md b/docs/sdks/timeline/README.md new file mode 100644 index 0000000..3538d4c --- /dev/null +++ b/docs/sdks/timeline/README.md @@ -0,0 +1,227 @@ +# Timeline +(*Timeline*) + +## Overview + +The actions feature within a media provider + +### Available Operations + +* [MarkPlayed](#markplayed) - Mark an item as played +* [Report](#report) - Report media timeline +* [Unscrobble](#unscrobble) - Mark an item as unplayed + +## MarkPlayed + +Mark an item as played. Note, this does not create any view history of this item but rather just sets the state as played. The client must provide either the `key` or `uri` query parameter +This API does respond to the GET verb but applications should use PUT + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Timeline.MarkPlayed(ctx, operations.MarkPlayedRequest{ + Identifier: "", + Key: plexgo.Pointer("59398"), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.MarkPlayedRequest](../../models/operations/markplayedrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MarkPlayedResponse](../../models/operations/markplayedresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Report + +This endpoint is hit during media playback for an item. It must be hit whenever the play state changes, or in the absence of a play state change, in a regular fashion (generally this means every 10 seconds on a LAN/WAN, and every 20 seconds over cellular). + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Timeline.Report(ctx, operations.ReportRequest{ + Key: plexgo.Pointer("/foo"), + RatingKey: plexgo.Pointer("xyz"), + State: operations.StatePlaying.ToPointer(), + PlayQueueItemID: plexgo.Pointer("123"), + Time: plexgo.Pointer[int64](0), + Duration: plexgo.Pointer[int64](10000), + Continuing: components.BoolIntOne.ToPointer(), + Updated: plexgo.Pointer[int64](14200000), + Offline: components.BoolIntOne.ToPointer(), + TimeToFirstFrame: plexgo.Pointer[int64](1000), + TimeStalled: plexgo.Pointer[int64](1000), + Bandwidth: plexgo.Pointer[int64](100), + BufferedTime: plexgo.Pointer[int64](100), + BufferedSize: plexgo.Pointer[int64](1024), + }) + 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. | +| `request` | [operations.ReportRequest](../../models/operations/reportrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ReportResponse](../../models/operations/reportresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## Unscrobble + +Mark an item as unplayed. The client must provide either the `key` or `uri` query parameter +This API does respond to the GET verb but applications should use PUT + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Timeline.Unscrobble(ctx, operations.UnscrobbleRequest{ + Identifier: "", + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.UnscrobbleRequest](../../models/operations/unscrobblerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UnscrobbleResponse](../../models/operations/unscrobbleresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/transcoder/README.md b/docs/sdks/transcoder/README.md new file mode 100644 index 0000000..1a616fb --- /dev/null +++ b/docs/sdks/transcoder/README.md @@ -0,0 +1,431 @@ +# Transcoder +(*Transcoder*) + +## Overview + +API Operations against the Transcoder + +### Available Operations + +* [TranscodeImage](#transcodeimage) - Transcode an image +* [MakeDecision](#makedecision) - Make a decision on media playback +* [TriggerFallback](#triggerfallback) - Manually trigger a transcoder fallback +* [TranscodeSubtitles](#transcodesubtitles) - Transcode subtitles +* [StartTranscodeSession](#starttranscodesession) - Start A Transcoding Session + +## TranscodeImage + +Transcode an image, possibly changing format or size + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.TranscodeImage(ctx, operations.TranscodeImageRequest{ + URL: plexgo.Pointer("/library/metadata/265/thumb/1715112705"), + Background: plexgo.Pointer("#ff5522"), + Upscale: components.BoolIntOne.ToPointer(), + MinSize: components.BoolIntOne.ToPointer(), + Rotate: components.BoolIntOne.ToPointer(), + BlendColor: plexgo.Pointer("#ff5522"), + }) + if err != nil { + log.Fatal(err) + } + if res.TwoHundredImageJpegResponseStream != 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. | +| `request` | [operations.TranscodeImageRequest](../../models/operations/transcodeimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.TranscodeImageResponse](../../models/operations/transcodeimageresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## MakeDecision + +Make a decision on media playback based on client profile, and requested settings such as bandwidth and resolution. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.MakeDecision(ctx, operations.MakeDecisionRequest{ + TranscodeType: components.TranscodeTypeMusic, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.LocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.ProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) + if err != nil { + log.Fatal(err) + } + if res.MediaContainerWithDecision != 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. | +| `request` | [operations.MakeDecisionRequest](../../models/operations/makedecisionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.MakeDecisionResponse](../../models/operations/makedecisionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## TriggerFallback + +Manually trigger a transcoder fallback ex: HEVC to h.264 or hw to sw + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.TriggerFallback(ctx, operations.TriggerFallbackRequest{ + TranscodeType: components.TranscodeTypeAudio, + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.TriggerFallbackRequest](../../models/operations/triggerfallbackrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.TriggerFallbackResponse](../../models/operations/triggerfallbackresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## TranscodeSubtitles + +Only transcode subtitle streams. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.TranscodeSubtitles(ctx, operations.TranscodeSubtitlesRequest{ + TranscodeType: components.TranscodeTypeAudio, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.QueryParamLocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.QueryParamProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.TranscodeSubtitlesRequest](../../models/operations/transcodesubtitlesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.TranscodeSubtitlesResponse](../../models/operations/transcodesubtitlesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## StartTranscodeSession + +Starts the transcoder and returns the corresponding streaming resource document. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Transcoder.StartTranscodeSession(ctx, operations.StartTranscodeSessionRequest{ + TranscodeType: components.TranscodeTypeMusic, + Extension: operations.ExtensionMpd, + AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), + AudioBoost: plexgo.Pointer[int64](50), + AudioChannelCount: plexgo.Pointer[int64](5), + AutoAdjustQuality: components.BoolIntOne.ToPointer(), + AutoAdjustSubtitle: components.BoolIntOne.ToPointer(), + DirectPlay: components.BoolIntOne.ToPointer(), + DirectStream: components.BoolIntOne.ToPointer(), + DirectStreamAudio: components.BoolIntOne.ToPointer(), + DisableResolutionRotation: components.BoolIntOne.ToPointer(), + HasMDE: components.BoolIntOne.ToPointer(), + Location: operations.StartTranscodeSessionQueryParamLocationWan.ToPointer(), + MediaBufferSize: plexgo.Pointer[int64](102400), + MediaIndex: plexgo.Pointer[int64](0), + MusicBitrate: plexgo.Pointer[int64](5000), + Offset: plexgo.Pointer[float64](90.5), + PartIndex: plexgo.Pointer[int64](0), + Path: plexgo.Pointer("/library/metadata/151671"), + PeakBitrate: plexgo.Pointer[int64](12000), + PhotoResolution: plexgo.Pointer("1080x1080"), + Protocol: operations.StartTranscodeSessionQueryParamProtocolDash.ToPointer(), + SecondsPerSegment: plexgo.Pointer[int64](5), + SubtitleSize: plexgo.Pointer[int64](50), + VideoBitrate: plexgo.Pointer[int64](12000), + VideoQuality: plexgo.Pointer[int64](50), + VideoResolution: plexgo.Pointer("1080x1080"), + XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"), + XPlexClientProfileName: plexgo.Pointer("generic"), + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.StartTranscodeSessionRequest](../../models/operations/starttranscodesessionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.StartTranscodeSessionResponse](../../models/operations/starttranscodesessionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/ultrablur/README.md b/docs/sdks/ultrablur/README.md new file mode 100644 index 0000000..40ef49d --- /dev/null +++ b/docs/sdks/ultrablur/README.md @@ -0,0 +1,149 @@ +# UltraBlur +(*UltraBlur*) + +## Overview + +Service provided to compute UltraBlur colors and images. + +### Available Operations + +* [GetColors](#getcolors) - Get UltraBlur Colors +* [GetImage](#getimage) - Get UltraBlur Image + +## GetColors + +Retrieves the four colors extracted from an image for clients to use to generate an ultrablur image. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.UltraBlur.GetColors(ctx, operations.GetColorsRequest{ + URL: plexgo.Pointer("/library/metadata/217745/art/1718931408"), + }) + 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. | +| `request` | [operations.GetColorsRequest](../../models/operations/getcolorsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetColorsResponse](../../models/operations/getcolorsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetImage + +Retrieves a server-side generated UltraBlur image based on the provided color inputs. Clients should always call this via the photo transcoder endpoint. + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.UltraBlur.GetImage(ctx, operations.GetImageRequest{ + TopLeft: plexgo.Pointer("3f280a"), + TopRight: plexgo.Pointer("6b4713"), + BottomRight: plexgo.Pointer("0f2a43"), + BottomLeft: plexgo.Pointer("1c425d"), + Width: plexgo.Pointer[int64](1920), + Height: plexgo.Pointer[int64](1080), + Noise: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res.ResponseStream != 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. | +| `request` | [operations.GetImageRequest](../../models/operations/getimagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetImageResponse](../../models/operations/getimageresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 800a06f..3754bb5 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -9,17 +9,150 @@ 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 +* [ApplyUpdates](#applyupdates) - Applying updates +* [CheckUpdates](#checkupdates) - Checking for updates +* [GetUpdatesStatus](#getupdatesstatus) - Querying status of updates -## GetUpdateStatus +## ApplyUpdates -Querying status of updates +Apply any downloaded updates. Note that the two parameters `tonight` and `skip` 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( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Updater.ApplyUpdates(ctx, operations.ApplyUpdatesRequest{ + Tonight: components.BoolIntOne.ToPointer(), + Skip: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.ApplyUpdatesRequest](../../models/operations/applyupdatesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ApplyUpdatesResponse](../../models/operations/applyupdatesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## CheckUpdates + +Perform an update check and potentially download + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := plexgo.New( + plexgo.WithAccepts(components.AcceptsApplicationXML), + plexgo.WithClientIdentifier("abc123"), + plexgo.WithProduct("Plex for Roku"), + plexgo.WithVersion("2.4.1"), + plexgo.WithPlatform("Roku"), + plexgo.WithPlatformVersion("4.3 build 1057"), + plexgo.WithDevice("Roku 3"), + plexgo.WithModel("4200X"), + plexgo.WithDeviceVendor("Roku"), + plexgo.WithDeviceName("Living Room TV"), + plexgo.WithMarketplace("googlePlay"), + plexgo.WithSecurity(""), + ) + + res, err := s.Updater.CheckUpdates(ctx, operations.CheckUpdatesRequest{ + Download: components.BoolIntOne.ToPointer(), + }) + if err != nil { + log.Fatal(err) + } + if res != 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. | +| `request` | [operations.CheckUpdatesRequest](../../models/operations/checkupdatesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CheckUpdatesResponse](../../models/operations/checkupdatesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | + +## GetUpdatesStatus + +Get the status of updating the server + +### Example Usage + + ```go package main @@ -36,7 +169,7 @@ func main() { plexgo.WithSecurity(""), ) - res, err := s.Updater.GetUpdateStatus(ctx) + res, err := s.Updater.GetUpdatesStatus(ctx) if err != nil { log.Fatal(err) } @@ -55,122 +188,10 @@ func main() { ### Response -**[*operations.GetUpdateStatusResponse](../../models/operations/getupdatestatusresponse.md), error** +**[*operations.GetUpdatesStatusResponse](../../models/operations/getupdatesstatusresponse.md), error** ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.GetUpdateStatusBadRequest | 400 | application/json | -| sdkerrors.GetUpdateStatusUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## CheckForUpdates - -Checking for updates - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Updater.CheckForUpdates(ctx, operations.DownloadOne.ToPointer()) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.CheckForUpdatesResponse](../../models/operations/checkforupdatesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| sdkerrors.CheckForUpdatesBadRequest | 400 | application/json | -| sdkerrors.CheckForUpdatesUnauthorized | 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( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Updater.ApplyUpdates(ctx, operations.TonightOne.ToPointer(), operations.SkipOne.ToPointer()) - if err != nil { - log.Fatal(err) - } - if res != 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. | | -| `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 | 1 | -| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | 1 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*operations.ApplyUpdatesResponse](../../models/operations/applyupdatesresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| sdkerrors.ApplyUpdatesBadRequest | 400 | application/json | -| sdkerrors.ApplyUpdatesUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md deleted file mode 100644 index b325ec8..0000000 --- a/docs/sdks/users/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Users -(*Users*) - -## Overview - -### Available Operations - -* [GetUsers](#getusers) - Get list of all connected users - -## GetUsers - -Get list of all users that are friends and have library access with the provided Plex authentication token - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New() - - res, err := s.Users.GetUsers(ctx, operations.GetUsersRequest{ - ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - ClientName: plexgo.Pointer("Plex for Roku"), - DeviceNickname: plexgo.Pointer("Roku 3"), - DeviceName: plexgo.Pointer("Chrome"), - DeviceScreenResolution: plexgo.Pointer("1487x1165,2560x1440"), - ClientVersion: plexgo.Pointer("2.4.1"), - Platform: plexgo.Pointer("Roku"), - ClientFeatures: plexgo.Pointer("external-media,indirect-media,hub-style-list"), - Model: plexgo.Pointer("4200X"), - XPlexSessionID: plexgo.Pointer("97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"), - XPlexLanguage: plexgo.Pointer("en"), - PlatformVersion: plexgo.Pointer("4.3 build 1057"), - XPlexToken: "CV5xoxjTpFKUzBTShsaf", - }) - if err != nil { - log.Fatal(err) - } - if res.Body != 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. | -| `request` | [operations.GetUsersRequest](../../models/operations/getusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetUsersResponse](../../models/operations/getusersresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| sdkerrors.GetUsersBadRequest | 400 | application/json | -| sdkerrors.GetUsersUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md deleted file mode 100644 index 3267bce..0000000 --- a/docs/sdks/video/README.md +++ /dev/null @@ -1,148 +0,0 @@ -# Video -(*Video*) - -## Overview - -API Calls that perform operations with Plex Media Server Videos - - -### Available Operations - -* [GetTimeline](#gettimeline) - Get the timeline for a media item -* [StartUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode - -## GetTimeline - -Get the timeline for a media item - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{ - RatingKey: 23409, - Key: "/library/metadata/23409", - State: operations.StatePlaying, - HasMDE: 1, - Time: 2000, - Duration: 10000, - Context: "home:hub.continueWatching", - PlayQueueItemID: 1, - PlayBackTime: 2000, - Row: 1, - }) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `request` | [operations.GetTimelineRequest](../../models/operations/gettimelinerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetTimelineResponse](../../models/operations/gettimelineresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| sdkerrors.GetTimelineBadRequest | 400 | application/json | -| sdkerrors.GetTimelineUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | - -## StartUniversalTranscode - -Begin a Universal Transcode Session - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ - HasMDE: 1, - Path: "/library/metadata/23409", - MediaIndex: 0, - PartIndex: 0, - Protocol: "hls", - FastSeek: plexgo.Pointer[float64](0), - DirectPlay: plexgo.Pointer[float64](0), - DirectStream: plexgo.Pointer[float64](0), - SubtitleSize: plexgo.Pointer[float64](100), - Subtites: plexgo.Pointer("burn"), - AudioBoost: plexgo.Pointer[float64](100), - Location: plexgo.Pointer("lan"), - MediaBufferSize: plexgo.Pointer[float64](102400), - Session: plexgo.Pointer("zvcage8b7rkioqcm8f4uns4c"), - AddDebugOverlay: plexgo.Pointer[float64](0), - AutoAdjustQuality: plexgo.Pointer[float64](0), - }) - if err != nil { - log.Fatal(err) - } - if res != 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. | -| `request` | [operations.StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.StartUniversalTranscodeResponse](../../models/operations/startuniversaltranscoderesponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| sdkerrors.StartUniversalTranscodeBadRequest | 400 | application/json | -| sdkerrors.StartUniversalTranscodeUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md deleted file mode 100644 index 8373751..0000000 --- a/docs/sdks/watchlist/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Watchlist -(*Watchlist*) - -## Overview - -API Calls that perform operations with Plex Media Server Watchlists - - -### Available Operations - -* [GetWatchList](#getwatchlist) - Get User Watchlist - -## GetWatchList - -Get User Watchlist - -### Example Usage - - -```go -package main - -import( - "context" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := plexgo.New( - plexgo.WithSecurity(""), - ) - - res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{ - Filter: operations.FilterReleased, - XPlexToken: "CV5xoxjTpFKUzBTShsaf", - }) - 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. | -| `request` | [operations.GetWatchListRequest](../../models/operations/getwatchlistrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - -### Response - -**[*operations.GetWatchListResponse](../../models/operations/getwatchlistresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| sdkerrors.GetWatchListBadRequest | 400 | application/json | -| sdkerrors.GetWatchListUnauthorized | 401 | application/json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/types/date.md b/docs/types/date.md deleted file mode 100644 index 3d83ed2..0000000 --- a/docs/types/date.md +++ /dev/null @@ -1,19 +0,0 @@ -# Date - -`types.Date` is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". - -## Usage - -```go -d1 := types.NewDate(time.Now()) // returns *types.Date - -d2 := types.DateFromTime(time.Now()) // returns types.Date - -d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error - -d4, err := types.DateFromString("2019-01-01") // returns types.Date, error - -d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error - -d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error -``` \ No newline at end of file diff --git a/downloadqueue.go b/downloadqueue.go new file mode 100644 index 0000000..7c2be2a --- /dev/null +++ b/downloadqueue.go @@ -0,0 +1,1975 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// DownloadQueue - API Operations against the Download Queue +type DownloadQueue struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newDownloadQueue(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *DownloadQueue { + return &DownloadQueue{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// CreateDownloadQueue - Create download queue +// Available: 0.2.0 +// +// Creates a download queue for this client if one doesn't exist, or returns the existing queue for this client and user. +func (s *DownloadQueue) CreateDownloadQueue(ctx context.Context, opts ...operations.Option) (*operations.CreateDownloadQueueResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/downloadQueue") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createDownloadQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateDownloadQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.CreateDownloadQueueResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetDownloadQueue - Get a download queue +// Available: 0.2.0 +// +// Get a download queue by its id +func (s *DownloadQueue) GetDownloadQueue(ctx context.Context, request operations.GetDownloadQueueRequest, opts ...operations.Option) (*operations.GetDownloadQueueResponse, error) { + globals := operations.GetDownloadQueueGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getDownloadQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetDownloadQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetDownloadQueueResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddDownloadQueueItems - Add to download queue +// Available: 0.2.0 +// +// Add items to the download queue +func (s *DownloadQueue) AddDownloadQueueItems(ctx context.Context, request operations.AddDownloadQueueItemsRequest, opts ...operations.Option) (*operations.AddDownloadQueueItemsResponse, error) { + globals := operations.AddDownloadQueueItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/add", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addDownloadQueueItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddDownloadQueueItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.AddDownloadQueueItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListDownloadQueueItems - Get download queue items +// Available: 0.2.0 +// +// Get items from a download queue +func (s *DownloadQueue) ListDownloadQueueItems(ctx context.Context, request operations.ListDownloadQueueItemsRequest, opts ...operations.Option) (*operations.ListDownloadQueueItemsResponse, error) { + globals := operations.ListDownloadQueueItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listDownloadQueueItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListDownloadQueueItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListDownloadQueueItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetItemDecision - Grab download queue item decision +// Available: 0.2.0 +// +// Grab the decision for a download queue item +func (s *DownloadQueue) GetItemDecision(ctx context.Context, request operations.GetItemDecisionRequest, opts ...operations.Option) (*operations.GetItemDecisionResponse, error) { + globals := operations.GetItemDecisionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/item/{itemId}/decision", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getItemDecision", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetItemDecisionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDecision + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDecision = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetDownloadQueueMedia - Grab download queue media +// Available: 0.2.0 +// +// Grab the media for a download queue item +func (s *DownloadQueue) GetDownloadQueueMedia(ctx context.Context, request operations.GetDownloadQueueMediaRequest, opts ...operations.Option) (*operations.GetDownloadQueueMediaResponse, error) { + globals := operations.GetDownloadQueueMediaGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/item/{itemId}/media", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getDownloadQueueMedia", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "503", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetDownloadQueueMediaResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 503: + res.Headers = httpRes.Header + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RemoveDownloadQueueItems - Delete download queue items +// delete items from a download queue +func (s *DownloadQueue) RemoveDownloadQueueItems(ctx context.Context, request operations.RemoveDownloadQueueItemsRequest, opts ...operations.Option) (*operations.RemoveDownloadQueueItemsResponse, error) { + globals := operations.RemoveDownloadQueueItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/items/{itemId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "removeDownloadQueueItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RemoveDownloadQueueItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetDownloadQueueItems - Get download queue items +// Available: 0.2.0 +// +// Get items from a download queue +func (s *DownloadQueue) GetDownloadQueueItems(ctx context.Context, request operations.GetDownloadQueueItemsRequest, opts ...operations.Option) (*operations.GetDownloadQueueItemsResponse, error) { + globals := operations.GetDownloadQueueItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/items/{itemId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getDownloadQueueItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetDownloadQueueItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetDownloadQueueItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RestartProcessingDownloadQueueItems - Restart processing of items from the decision +// Available: 0.2.0 +// +// Reprocess download queue items with previous decision parameters +func (s *DownloadQueue) RestartProcessingDownloadQueueItems(ctx context.Context, request operations.RestartProcessingDownloadQueueItemsRequest, opts ...operations.Option) (*operations.RestartProcessingDownloadQueueItemsResponse, error) { + globals := operations.RestartProcessingDownloadQueueItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/downloadQueue/{queueId}/items/{itemId}/restart", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "restartProcessingDownloadQueueItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RestartProcessingDownloadQueueItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/dvrs.go b/dvrs.go new file mode 100644 index 0000000..12eb5fe --- /dev/null +++ b/dvrs.go @@ -0,0 +1,2647 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// DVRs - The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself +type DVRs struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newDVRs(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *DVRs { + return &DVRs{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ListDVRs - Get DVRs +// Get the list of all available DVRs +func (s *DVRs) ListDVRs(ctx context.Context, opts ...operations.Option) (*operations.ListDVRsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/dvrs") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listDVRs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListDVRsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListDVRsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreateDVR - Create a DVR +// Creation of a DVR, after creation of a devcie and a lineup is selected +func (s *DVRs) CreateDVR(ctx context.Context, request operations.CreateDVRRequest, opts ...operations.Option) (*operations.CreateDVRResponse, error) { + globals := operations.CreateDVRGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/dvrs") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createDVR", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateDVRResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.DvrRequestHandlerSlashGetResponses200 + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.DvrRequestHandlerSlashGetResponses200 = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteDVR - Delete a single DVR +// Delete a single DVR by its id (key) +func (s *DVRs) DeleteDVR(ctx context.Context, request operations.DeleteDVRRequest, opts ...operations.Option) (*operations.DeleteDVRResponse, error) { + globals := operations.DeleteDVRGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteDVR", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteDVRResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetDVR - Get a single DVR +// Get a single DVR by its id (key) +func (s *DVRs) GetDVR(ctx context.Context, request operations.GetDVRRequest, opts ...operations.Option) (*operations.GetDVRResponse, error) { + globals := operations.GetDVRGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getDVR", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetDVRResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetDVRResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteLineup - Delete a DVR Lineup +// Deletes a DVR device's lineup. +func (s *DVRs) DeleteLineup(ctx context.Context, request operations.DeleteLineupRequest, opts ...operations.Option) (*operations.DeleteLineupResponse, error) { + globals := operations.DeleteLineupGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/lineups", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteLineup", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteLineupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.DeleteLineupResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddLineup - Add a DVR Lineup +// Add a lineup to a DVR device's set of lineups. +func (s *DVRs) AddLineup(ctx context.Context, request operations.AddLineupRequest, opts ...operations.Option) (*operations.AddLineupResponse, error) { + globals := operations.AddLineupGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/lineups", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addLineup", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddLineupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.AddLineupResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetDVRPreferences - Set DVR preferences +// Set DVR preferences by name avd value +func (s *DVRs) SetDVRPreferences(ctx context.Context, request operations.SetDVRPreferencesRequest, opts ...operations.Option) (*operations.SetDVRPreferencesResponse, error) { + globals := operations.SetDVRPreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/prefs", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setDVRPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetDVRPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.SetDVRPreferencesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StopDVRReload - Tell a DVR to stop reloading program guide +// Tell a DVR to stop reloading program guide +func (s *DVRs) StopDVRReload(ctx context.Context, request operations.StopDVRReloadRequest, opts ...operations.Option) (*operations.StopDVRReloadResponse, error) { + globals := operations.StopDVRReloadGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/reloadGuide", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "stopDVRReload", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StopDVRReloadResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ReloadGuide - Tell a DVR to reload program guide +// Tell a DVR to reload program guide +func (s *DVRs) ReloadGuide(ctx context.Context, request operations.ReloadGuideRequest, opts ...operations.Option) (*operations.ReloadGuideResponse, error) { + globals := operations.ReloadGuideGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/reloadGuide", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "reloadGuide", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ReloadGuideResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// TuneChannel - Tune a channel on a DVR +// Tune a channel on a DVR to the provided channel +func (s *DVRs) TuneChannel(ctx context.Context, request operations.TuneChannelRequest, opts ...operations.Option) (*operations.TuneChannelResponse, error) { + globals := operations.TuneChannelGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/channels/{channel}/tune", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "tuneChannel", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.TuneChannelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RemoveDeviceFromDVR - Remove a device from an existing DVR +// Remove a device from an existing DVR +func (s *DVRs) RemoveDeviceFromDVR(ctx context.Context, request operations.RemoveDeviceFromDVRRequest, opts ...operations.Option) (*operations.RemoveDeviceFromDVRResponse, error) { + globals := operations.RemoveDeviceFromDVRGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/devices/{deviceId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "removeDeviceFromDVR", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RemoveDeviceFromDVRResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.RemoveDeviceFromDVRResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddDeviceToDVR - Add a device to an existing DVR +// Add a device to an existing DVR +func (s *DVRs) AddDeviceToDVR(ctx context.Context, request operations.AddDeviceToDVRRequest, opts ...operations.Option) (*operations.AddDeviceToDVRResponse, error) { + globals := operations.AddDeviceToDVRGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/dvrs/{dvrId}/devices/{deviceId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addDeviceToDVR", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddDeviceToDVRResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.AddDeviceToDVRResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/epg.go b/epg.go new file mode 100644 index 0000000..8024e09 --- /dev/null +++ b/epg.go @@ -0,0 +1,2022 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Epg - The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when +type Epg struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newEpg(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Epg { + return &Epg{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ComputeChannelMap - Compute the best channel map +// Compute the best channel map, given device and lineup +func (s *Epg) ComputeChannelMap(ctx context.Context, request operations.ComputeChannelMapRequest, opts ...operations.Option) (*operations.ComputeChannelMapResponse, error) { + globals := operations.ComputeChannelMapGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/epg/channelmap") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "computeChannelMap", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ComputeChannelMapResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ComputeChannelMapResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetChannels - Get channels for a lineup +// Get channels for a lineup within an EPG provider +func (s *Epg) GetChannels(ctx context.Context, request operations.GetChannelsRequest, opts ...operations.Option) (*operations.GetChannelsResponse, error) { + globals := operations.GetChannelsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/epg/channels") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getChannels", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetChannelsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetChannelsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCountries - Get all countries +// This endpoint returns a list of countries which EPG data is available for. There are three flavors, as specfied by the `flavor` attribute +func (s *Epg) GetCountries(ctx context.Context, opts ...operations.Option) (*operations.GetCountriesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/epg/countries") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCountries", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCountriesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetCountriesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetAllLanguages - Get all languages +// Returns a list of all possible languages for EPG data. +func (s *Epg) GetAllLanguages(ctx context.Context, opts ...operations.Option) (*operations.GetAllLanguagesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/epg/languages") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAllLanguages", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAllLanguagesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetAllLanguagesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetLineup - Compute the best lineup +// Compute the best lineup, given lineup group and device +func (s *Epg) GetLineup(ctx context.Context, request operations.GetLineupRequest, opts ...operations.Option) (*operations.GetLineupResponse, error) { + globals := operations.GetLineupGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/epg/lineup") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getLineup", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetLineupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetLineupChannels - Get the channels for mulitple lineups +// Get the channels across multiple lineups +func (s *Epg) GetLineupChannels(ctx context.Context, request operations.GetLineupChannelsRequest, opts ...operations.Option) (*operations.GetLineupChannelsResponse, error) { + globals := operations.GetLineupChannelsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/epg/lineupchannels") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getLineupChannels", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetLineupChannelsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetLineupChannelsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCountriesLineups - Get lineups for a country via postal code +// Returns a list of lineups for a given country, EPG provider and postal code +func (s *Epg) GetCountriesLineups(ctx context.Context, request operations.GetCountriesLineupsRequest, opts ...operations.Option) (*operations.GetCountriesLineupsResponse, error) { + globals := operations.GetCountriesLineupsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/epg/countries/{country}/{epgId}/lineups", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCountriesLineups", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCountriesLineupsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithLineup + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithLineup = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCountryRegions - Get regions for a country +// Get regions for a country within an EPG provider +func (s *Epg) GetCountryRegions(ctx context.Context, request operations.GetCountryRegionsRequest, opts ...operations.Option) (*operations.GetCountryRegionsResponse, error) { + globals := operations.GetCountryRegionsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/epg/countries/{country}/{epgId}/regions", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCountryRegions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCountryRegionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetCountryRegionsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListLineups - Get lineups for a region +// Get lineups for a region within an EPG provider +func (s *Epg) ListLineups(ctx context.Context, request operations.ListLineupsRequest, opts ...operations.Option) (*operations.ListLineupsResponse, error) { + globals := operations.ListLineupsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/epg/countries/{country}/{epgId}/regions/{region}/lineups", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listLineups", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListLineupsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithLineup + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithLineup = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/events.go b/events.go new file mode 100644 index 0000000..b633591 --- /dev/null +++ b/events.go @@ -0,0 +1,467 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Events - The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported. +// +// Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket. +type Events struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newEvents(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Events { + return &Events{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetNotifications - Connect to Eventsource +// Connect to the event source to get a stream of events +func (s *Events) GetNotifications(ctx context.Context, request operations.GetNotificationsRequest, opts ...operations.Option) (*operations.GetNotificationsResponse, error) { + globals := operations.GetNotificationsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/eventsource/notifications") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getNotifications", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetNotificationsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ConnectWebSocket - Connect to WebSocket +// Connect to the web socket to get a stream of events +func (s *Events) ConnectWebSocket(ctx context.Context, request operations.ConnectWebSocketRequest, opts ...operations.Option) (*operations.ConnectWebSocketResponse, error) { + globals := operations.ConnectWebSocketGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/websocket/notifications") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "connectWebSocket", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ConnectWebSocketResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/general.go b/general.go new file mode 100644 index 0000000..7d49deb --- /dev/null +++ b/general.go @@ -0,0 +1,914 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// General endpoints for basic PMS operation not specific to any media provider +type General struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newGeneral(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *General { + return &General{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetServerInfo - Get PMS info +// Information about this PMS setup and configuration +func (s *General) GetServerInfo(ctx context.Context, request operations.GetServerInfoRequest, opts ...operations.Option) (*operations.GetServerInfoResponse, error) { + globals := operations.GetServerInfoGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getServerInfo", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetServerInfoResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDirectory + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDirectory = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetIdentity - Get PMS identity +// Get details about this PMS's identity +func (s *General) GetIdentity(ctx context.Context, opts ...operations.Option) (*operations.GetIdentityResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/identity") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getIdentity", + OAuth2Scopes: nil, + SecuritySource: nil, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetIdentityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetIdentityResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", 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. +func (s *General) GetSourceConnectionInformation(ctx context.Context, request operations.GetSourceConnectionInformationRequest, opts ...operations.Option) (*operations.GetSourceConnectionInformationResponse, error) { + globals := operations.GetSourceConnectionInformationGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/security/resources") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSourceConnectionInformation", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSourceConnectionInformationResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetSourceConnectionInformationResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetTransientToken - Get Transient Tokens +// 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. +// Note: This endpoint responds to all HTTP verbs but POST in preferred +func (s *General) GetTransientToken(ctx context.Context, request operations.GetTransientTokenRequest, opts ...operations.Option) (*operations.GetTransientTokenResponse, error) { + globals := operations.GetTransientTokenGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/security/token") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getTransientToken", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetTransientTokenResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetTransientTokenResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/hubs.go b/hubs.go index e9bf106..c905558 100644 --- a/hubs.go +++ b/hubs.go @@ -9,6 +9,7 @@ import ( "github.com/LukeHagar/plexgo/internal/config" "github.com/LukeHagar/plexgo/internal/hooks" "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/sdkerrors" "github.com/LukeHagar/plexgo/retry" @@ -16,7 +17,7 @@ import ( "net/url" ) -// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. +// Hubs - The hubs within a media provider type Hubs struct { rootSDK *PlexAPI sdkConfiguration config.SDKConfiguration @@ -31,12 +32,21 @@ func newHubs(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.H } } -// GetGlobalHubs - Get Global Hubs -// Get Global Hubs filtered by the parameters provided. -func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient *operations.OnlyTransient, opts ...operations.Option) (*operations.GetGlobalHubsResponse, error) { - request := operations.GetGlobalHubsRequest{ - Count: count, - OnlyTransient: onlyTransient, +// GetAllHubs - Get global hubs +// Get the global hubs in this PMS +func (s *Hubs) GetAllHubs(ctx context.Context, request operations.GetAllHubsRequest, opts ...operations.Option) (*operations.GetAllHubsResponse, error) { + globals := operations.GetAllHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -67,8 +77,8 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getGlobalHubs", - OAuth2Scopes: []string{}, + OperationID: "getAllHubs", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -90,7 +100,9 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -178,7 +190,7 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -193,7 +205,7 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient } } - res := &operations.GetGlobalHubsResponse{ + res := &operations.GetAllHubsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -201,6 +213,8 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient switch { case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -208,7 +222,7 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient return nil, err } - var out operations.GetGlobalHubsResponseBody + var out operations.GetAllHubsResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -221,50 +235,6 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetGlobalHubsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetGlobalHubsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -289,9 +259,23 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient } -// GetRecentlyAdded - Get Recently Added -// This endpoint will return the recently added content. -func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecentlyAddedRequest, opts ...operations.Option) (*operations.GetRecentlyAddedResponse, error) { +// GetContinueWatching - Get the continue watching hub +// Get the global continue watching hub +func (s *Hubs) GetContinueWatching(ctx context.Context, request operations.GetContinueWatchingRequest, opts ...operations.Option) (*operations.GetContinueWatchingResponse, error) { + globals := operations.GetContinueWatchingGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -310,7 +294,7 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/hubs/home/recentlyAdded") + opURL, err := url.JoinPath(baseURL, "/hubs/continueWatching") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -320,8 +304,8 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "get-recently-added", - OAuth2Scopes: []string{}, + OperationID: "getContinueWatching", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -343,7 +327,9 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -431,7 +417,7 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -446,7 +432,7 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen } } - res := &operations.GetRecentlyAddedResponse{ + res := &operations.GetContinueWatchingResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -454,6 +440,8 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen switch { case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -461,7 +449,7 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen return nil, err } - var out operations.GetRecentlyAddedResponseBody + var out operations.GetContinueWatchingResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -474,9 +462,234 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 401: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetHubItems - Get a hub's items +// Get the items within a single hub specified by identifier +func (s *Hubs) GetHubItems(ctx context.Context, request operations.GetHubItemsRequest, opts ...operations.Option) (*operations.GetHubItemsResponse, error) { + globals := operations.GetHubItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/hubs/items") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getHubItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetHubItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetHubItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -502,13 +715,21 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen } -// 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, opts ...operations.Option) (*operations.GetLibraryHubsResponse, error) { - request := operations.GetLibraryHubsRequest{ - SectionID: sectionID, - Count: count, - OnlyTransient: onlyTransient, +// GetPromotedHubs - Get the hubs which are promoted +// Get the global hubs which are promoted (should be displayed on the home screen) +func (s *Hubs) GetPromotedHubs(ctx context.Context, request operations.GetPromotedHubsRequest, opts ...operations.Option) (*operations.GetPromotedHubsResponse, error) { + globals := operations.GetPromotedHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -529,7 +750,7 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}", request, nil) + opURL, err := url.JoinPath(baseURL, "/hubs/promoted") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -539,8 +760,8 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getLibraryHubs", - OAuth2Scopes: []string{}, + OperationID: "getPromotedHubs", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -562,7 +783,9 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -650,7 +873,7 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -665,7 +888,7 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo } } - res := &operations.GetLibraryHubsResponse{ + res := &operations.GetPromotedHubsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -673,6 +896,8 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo switch { case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -680,7 +905,7 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo return nil, err } - var out operations.GetLibraryHubsResponseBody + var out operations.GetPromotedHubsResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -693,50 +918,2216 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibraryHubsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibraryHubsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetMetadataHubs - Get hubs for section by metadata item +// Get the hubs for a section by metadata item. Currently only for music sections +func (s *Hubs) GetMetadataHubs(ctx context.Context, request operations.GetMetadataHubsRequest, opts ...operations.Option) (*operations.GetMetadataHubsResponse, error) { + globals := operations.GetMetadataHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/metadata/{metadataId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getMetadataHubs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetMetadataHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithHubs + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithHubs = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPostplayHubs - Get postplay hubs +// Get the hubs for a metadata to be displayed in post play +func (s *Hubs) GetPostplayHubs(ctx context.Context, request operations.GetPostplayHubsRequest, opts ...operations.Option) (*operations.GetPostplayHubsResponse, error) { + globals := operations.GetPostplayHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/metadata/{metadataId}/postplay", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPostplayHubs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPostplayHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithHubs + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithHubs = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetRelatedHubs - Get related hubs +// Get the hubs for a metadata related to the provided metadata item +func (s *Hubs) GetRelatedHubs(ctx context.Context, request operations.GetRelatedHubsRequest, opts ...operations.Option) (*operations.GetRelatedHubsResponse, error) { + globals := operations.GetRelatedHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/metadata/{metadataId}/related", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getRelatedHubs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetRelatedHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithHubs + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithHubs = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSectionHubs - Get section hubs +// Get the hubs for a single section +func (s *Hubs) GetSectionHubs(ctx context.Context, request operations.GetSectionHubsRequest, opts ...operations.Option) (*operations.GetSectionHubsResponse, error) { + globals := operations.GetSectionHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSectionHubs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSectionHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetSectionHubsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ResetSectionDefaults - Reset hubs to defaults +// Reset hubs for this section to defaults and delete custom hubs +func (s *Hubs) ResetSectionDefaults(ctx context.Context, request operations.ResetSectionDefaultsRequest, opts ...operations.Option) (*operations.ResetSectionDefaultsResponse, error) { + globals := operations.ResetSectionDefaultsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}/manage", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "resetSectionDefaults", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ResetSectionDefaultsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHubs - Get hubs +// Get the list of hubs including both built-in and custom +func (s *Hubs) ListHubs(ctx context.Context, request operations.ListHubsRequest, opts ...operations.Option) (*operations.ListHubsResponse, error) { + globals := operations.ListHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}/manage", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listHubs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListHubsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreateCustomHub - Create a custom hub +// Create a custom hub based on a metadata item +func (s *Hubs) CreateCustomHub(ctx context.Context, request operations.CreateCustomHubRequest, opts ...operations.Option) (*operations.CreateCustomHubResponse, error) { + globals := operations.CreateCustomHubGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}/manage", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createCustomHub", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateCustomHubResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// MoveHub - Move Hub +// Changed the ordering of a hub among others hubs +func (s *Hubs) MoveHub(ctx context.Context, request operations.MoveHubRequest, opts ...operations.Option) (*operations.MoveHubResponse, error) { + globals := operations.MoveHubGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}/manage/move", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "moveHub", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MoveHubResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.GetResponses200 + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetResponses200 = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteCustomHub - Delete a custom hub +// Delete a custom hub from the server +func (s *Hubs) DeleteCustomHub(ctx context.Context, request operations.DeleteCustomHubRequest, opts ...operations.Option) (*operations.DeleteCustomHubResponse, error) { + globals := operations.DeleteCustomHubGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}/manage/{identifier}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteCustomHub", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteCustomHubResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpdateHubVisibility - Change hub visibility +// Changed the visibility of a hub for both the admin and shared users +func (s *Hubs) UpdateHubVisibility(ctx context.Context, request operations.UpdateHubVisibilityRequest, opts ...operations.Option) (*operations.UpdateHubVisibilityResponse, error) { + globals := operations.UpdateHubVisibilityGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}/manage/{identifier}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updateHubVisibility", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpdateHubVisibilityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/internal/config/sdkconfiguration.go b/internal/config/sdkconfiguration.go index 1a010c2..42fdcc1 100644 --- a/internal/config/sdkconfiguration.go +++ b/internal/config/sdkconfiguration.go @@ -4,6 +4,7 @@ package config import ( "context" + "github.com/LukeHagar/plexgo/internal/globals" "github.com/LukeHagar/plexgo/retry" "net/http" "time" @@ -21,6 +22,7 @@ type SDKConfiguration struct { ServerList []string ServerVariables []map[string]string UserAgent string + Globals globals.Globals RetryConfig *retry.Config Timeout *time.Duration } diff --git a/internal/globals/globals.go b/internal/globals/globals.go new file mode 100644 index 0000000..70d8d85 --- /dev/null +++ b/internal/globals/globals.go @@ -0,0 +1,121 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package globals + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" +) + +type Globals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g Globals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *Globals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *Globals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *Globals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *Globals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *Globals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *Globals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *Globals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *Globals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *Globals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *Globals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *Globals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *Globals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} diff --git a/library.go b/library.go index ad56373..741d2de 100644 --- a/library.go +++ b/library.go @@ -9,6 +9,7 @@ import ( "github.com/LukeHagar/plexgo/internal/config" "github.com/LukeHagar/plexgo/internal/hooks" "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/sdkerrors" "github.com/LukeHagar/plexgo/retry" @@ -16,7 +17,7 @@ import ( "net/url" ) -// Library - API Calls interacting with Plex Media Server Libraries +// Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc). type Library struct { rootSDK *PlexAPI sdkConfiguration config.SDKConfiguration @@ -31,12 +32,21 @@ func newLibrary(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hook } } -// GetFileHash - Get Hash Value -// This resource returns hash values for local files -func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, opts ...operations.Option) (*operations.GetFileHashResponse, error) { - request := operations.GetFileHashRequest{ - URL: url_, - Type: type_, +// GetLibraryItems - Get all items in library +// Request all metadata items according to a query. +func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLibraryItemsRequest, opts ...operations.Option) (*operations.GetLibraryItemsResponse, error) { + globals := operations.GetLibraryItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -57,7 +67,7 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/library/hashes") + opURL, err := url.JoinPath(baseURL, "/library/all") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -67,8 +77,8 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getFileHash", - OAuth2Scopes: []string{}, + OperationID: "getLibraryItems", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -90,7 +100,9 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -178,7 +190,7 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -193,7 +205,7 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, } } - res := &operations.GetFileHashResponse{ + res := &operations.GetLibraryItemsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -201,7 +213,8 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -209,35 +222,12 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, return nil, err } - var out sdkerrors.GetFileHashBadRequest + var out components.MediaContainerWithMetadata if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetFileHashUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out + res.MediaContainerWithMetadata = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -269,9 +259,9 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64, } -// GetRecentlyAddedLibrary - Get Recently Added -// This endpoint will return the recently added content. -func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operations.GetRecentlyAddedLibraryRequest, opts ...operations.Option) (*operations.GetRecentlyAddedLibraryResponse, error) { +// DeleteCaches - Delete library caches +// Delete the hub caches so they are recomputed on next request +func (s *Library) DeleteCaches(ctx context.Context, opts ...operations.Option) (*operations.DeleteCachesResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -290,7 +280,7 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/library/recentlyAdded") + opURL, err := url.JoinPath(baseURL, "/library/caches") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -300,8 +290,8 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "get-recently-added-library", - OAuth2Scopes: []string{}, + OperationID: "deleteCaches", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -316,14 +306,401 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteCachesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CleanBundles - Clean bundles +// Clean out any now unused bundles. Bundles can become unused when media is deleted +func (s *Library) CleanBundles(ctx context.Context, opts ...operations.Option) (*operations.CleanBundlesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/clean/bundles") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "cleanBundles", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CleanBundlesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// IngestTransientItem - Ingest a transient item +// This endpoint takes a file path specified in the `url` parameter, matches it using the scanner's match mechanism, downloads rich metadata, and then ingests the item as a transient item (without a library section). In the case where the file represents an episode, the entire tree (show, season, and episode) is added as transient items. At this time, movies and episodes are the only supported types, which are gleaned automatically from the file path. +// Note that any of the parameters passed to the metadata details endpoint (e.g. `includeExtras=1`) work here. +func (s *Library) IngestTransientItem(ctx context.Context, request operations.IngestTransientItemRequest, opts ...operations.Option) (*operations.IngestTransientItemResponse, error) { + globals := operations.IngestTransientItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/file") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "ingestTransientItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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 { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -411,7 +788,7 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -426,7 +803,7 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation } } - res := &operations.GetRecentlyAddedLibraryResponse{ + res := &operations.IngestTransientItemResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -434,6 +811,8 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation switch { case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -441,56 +820,12 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation return nil, err } - var out operations.GetRecentlyAddedLibraryResponseBody + var out components.MediaContainerWithMetadata if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetRecentlyAddedLibraryBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetRecentlyAddedLibraryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out + res.MediaContainerWithMetadata = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -522,14 +857,27 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation } -// GetAllLibraries - 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) GetAllLibraries(ctx context.Context, opts ...operations.Option) (*operations.GetAllLibrariesResponse, error) { +// GetLibraryMatches - Get library matches +// The matches endpoint is used to match content external to the library with content inside the library. This is done by passing a series of semantic "hints" about the content (its type, name, or release year). Each type (e.g. movie) has a canonical set of minimal required hints. +// This ability to match content is useful in a variety of scenarios. For example, in the DVR, the EPG uses the endpoint to match recording rules against airing content. And in the cloud, the UMP uses the endpoint to match up a piece of media with rich metadata. +// The endpoint response can including multiple matches, if there is ambiguity, each one containing a `score` from 0 to 100. For somewhat historical reasons, anything over 85 is considered a positive match (we prefer false negatives over false positives in general for matching). +// The `guid` hint is somewhat special, in that it generally represents a unique identity for a piece of media (e.g. the IMDB `ttXXX`) identifier, in contrast with other hints which can be much more ambiguous (e.g. a title of `Jane Eyre`, which could refer to the 1943 or the 2011 version). +// Episodes require either a season/episode pair, or an air date (or both). Either the path must be sent, or the show title +func (s *Library) GetLibraryMatches(ctx context.Context, request operations.GetLibraryMatchesRequest, opts ...operations.Option) (*operations.GetLibraryMatchesResponse, error) { + globals := operations.GetLibraryMatchesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -548,7 +896,7 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/library/sections") + opURL, err := url.JoinPath(baseURL, "/library/matches") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -558,8 +906,8 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "get-all-libraries", - OAuth2Scopes: []string{}, + OperationID: "getLibraryMatches", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -581,299 +929,9 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } + utils.PopulateHeaders(ctx, req, request, globals) - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetAllLibrariesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetAllLibrariesResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetAllLibrariesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetAllLibrariesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetLibraryDetails - Get Library Details -// ## Library Details Endpoint -// -// This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. -// -// The details include: -// -// ### Directories -// Organized into three categories: -// -// - **Primary Directories**: -// - Used in some clients for quick access to media subsets (e.g., "All", "On Deck"). -// - Most can be replicated via media queries. -// - Customizable by users. -// -// - **Secondary Directories**: -// - Marked with `secondary="1"`. -// - Used in older clients for structured navigation. -// -// - **Special Directories**: -// - Includes a "By Folder" entry for filesystem-based browsing. -// - Contains an obsolete `search="1"` entry for on-the-fly search dialog creation. -// -// ### Types -// Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: -// -// - **Type Object Attributes**: -// - `key`: Endpoint for the media list of this type. -// - `type`: Metadata type (if standard Plex type). -// - `title`: Title for this content type (e.g., "Movies"). -// -// - **Filter Objects**: -// - Subset of the media query language. -// - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. -// -// - **Sort Objects**: -// - Description of sort fields. -// - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. -// -// > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. -func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, includeDetails *operations.IncludeDetails, opts ...operations.Option) (*operations.GetLibraryDetailsResponse, error) { - request := operations.GetLibraryDetailsRequest{ - IncludeDetails: includeDetails, - SectionKey: sectionKey, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-library-details", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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 { + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -961,7 +1019,7 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -976,7 +1034,7 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include } } - res := &operations.GetLibraryDetailsResponse{ + res := &operations.GetLibraryMatchesResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -984,6 +1042,8 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include switch { case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -991,56 +1051,12 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include return nil, err } - var out operations.GetLibraryDetailsResponseBody + var out components.MediaContainerWithMetadata if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibraryDetailsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibraryDetailsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out + res.MediaContainerWithMetadata = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1072,11 +1088,21 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include } -// DeleteLibrary - Delete Library Section -// Delete a library using a specific section id -func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...operations.Option) (*operations.DeleteLibraryResponse, error) { - request := operations.DeleteLibraryRequest{ - SectionKey: sectionKey, +// OptimizeDatabase - Optimize the Database +// Initiate optimize on the database. +func (s *Library) OptimizeDatabase(ctx context.Context, request operations.OptimizeDatabaseRequest, opts ...operations.Option) (*operations.OptimizeDatabaseResponse, error) { + globals := operations.OptimizeDatabaseGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -1097,7 +1123,7 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}", request, nil) + opURL, err := url.JoinPath(baseURL, "/library/optimize") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1107,8 +1133,861 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "deleteLibrary", - OAuth2Scopes: []string{}, + OperationID: "optimizeDatabase", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.OptimizeDatabaseResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetRandomArtwork - Get random artwork +// Get random artwork across sections. This is commonly used for a screensaver. +// +// This retrieves 100 random artwork paths in the specified sections and returns them. Restrictions are put in place to not return artwork for items the user is not allowed to access. Artwork will be for Movies, Shows, and Artists only. +func (s *Library) GetRandomArtwork(ctx context.Context, request operations.GetRandomArtworkRequest, opts ...operations.Option) (*operations.GetRandomArtworkResponse, error) { + globals := operations.GetRandomArtworkGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/randomArtwork") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getRandomArtwork", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetRandomArtworkResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithArtwork + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithArtwork = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSections - Get library sections (main Media Provider Only) +// 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) GetSections(ctx context.Context, opts ...operations.Option) (*operations.GetSectionsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/sections/all") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSections", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSectionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetSectionsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddSection - Add a library section +// Add a new library section to the server +func (s *Library) AddSection(ctx context.Context, request operations.AddSectionRequest, opts ...operations.Option) (*operations.AddSectionResponse, error) { + globals := operations.AddSectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/sections/all") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addSection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddSectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.SlashGetResponses200 + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SlashGetResponses200 = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StopAllRefreshes - Stop refresh +// Stop all refreshes across all sections +func (s *Library) StopAllRefreshes(ctx context.Context, opts ...operations.Option) (*operations.StopAllRefreshesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/library/sections/all/refresh") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "stopAllRefreshes", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1214,7 +2093,7 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1229,7 +2108,7 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope } } - res := &operations.DeleteLibraryResponse{ + res := &operations.StopAllRefreshesResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -1237,7 +2116,6 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1245,35 +2123,12 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope return nil, err } - var out sdkerrors.DeleteLibraryBadRequest + var out components.RequestHandlerSlashGetResponses200 if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.DeleteLibraryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out + res.RequestHandlerSlashGetResponses200 = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1305,29 +2160,23 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope } -// GetLibraryItems - Get Library Items -// Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: -// - `all`: All items in the section. -// - `unwatched`: Items that have not been played. -// - `newest`: Items that are recently released. -// - `recentlyAdded`: Items that are recently added to the library. -// - `recentlyViewed`: Items that were recently viewed. -// - `onDeck`: Items to continue watching. -// - `collection`: Items categorized by collection. -// - `edition`: Items categorized by edition. -// - `genre`: Items categorized by genre. -// - `year`: Items categorized by year of release. -// - `decade`: Items categorized by decade. -// - `director`: Items categorized by director. -// - `actor`: Items categorized by starring actor. -// - `country`: Items categorized by country of origin. -// - `contentRating`: Items categorized by content rating. -// - `rating`: Items categorized by rating. -// - `resolution`: Items categorized by resolution. -// - `firstCharacter`: Items categorized by the first letter. -// - `folder`: Items categorized by folder. -// - `albums`: Items categorized by album. -func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLibraryItemsRequest, opts ...operations.Option) (*operations.GetLibraryItemsResponse, error) { +// GetSectionsPrefs - Get section prefs +// Get a section's preferences for a metadata type +func (s *Library) GetSectionsPrefs(ctx context.Context, request operations.GetSectionsPrefsRequest, opts ...operations.Option) (*operations.GetSectionsPrefsResponse, error) { + globals := operations.GetSectionsPrefsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1346,7 +2195,7 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/{tag}", request, nil) + opURL, err := url.JoinPath(baseURL, "/library/sections/prefs") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1356,8 +2205,8 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "get-library-items", - OAuth2Scopes: []string{}, + OperationID: "getSectionsPrefs", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1379,7 +2228,9 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -1467,7 +2318,7 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1482,7 +2333,7 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib } } - res := &operations.GetLibraryItemsResponse{ + res := &operations.GetSectionsPrefsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -1497,12 +2348,12 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib return nil, err } - var out operations.GetLibraryItemsResponseBody + var out components.RequestHandlerSlashGetResponses200 if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Object = &out + res.RequestHandlerSlashGetResponses200 = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1511,303 +2362,6 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibraryItemsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibraryItemsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetLibrarySectionsAll - Get Library section media by tag ALL -// Retrieves a list of all general media data for this library. -func (s *Library) GetLibrarySectionsAll(ctx context.Context, request operations.GetLibrarySectionsAllRequest, opts ...operations.Option) (*operations.GetLibrarySectionsAllResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/all", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-library-sections-all", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetLibrarySectionsAllResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetLibrarySectionsAllResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibrarySectionsAllBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetLibrarySectionsAllUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1833,12 +2387,21 @@ func (s *Library) GetLibrarySectionsAll(ctx context.Context, request operations. } -// GetRefreshLibraryMetadata - Refresh Metadata Of The Library -// This endpoint Refreshes all the Metadata of the library. -func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int, force *operations.Force, opts ...operations.Option) (*operations.GetRefreshLibraryMetadataResponse, error) { - request := operations.GetRefreshLibraryMetadataRequest{ - Force: force, - SectionKey: sectionKey, +// RefreshSectionsMetadata - Refresh all sections +// Tell PMS to refresh all section metadata +func (s *Library) RefreshSectionsMetadata(ctx context.Context, request operations.RefreshSectionsMetadataRequest, opts ...operations.Option) (*operations.RefreshSectionsMetadataResponse, error) { + globals := operations.RefreshSectionsMetadataGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -1859,7 +2422,7 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int, } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/refresh", request, nil) + opURL, err := url.JoinPath(baseURL, "/library/sections/refresh") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1869,8 +2432,8 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int, SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "get-refresh-library-metadata", - OAuth2Scopes: []string{}, + OperationID: "refreshSectionsMetadata", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1885,2037 +2448,16 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int, defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetRefreshLibraryMetadataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetRefreshLibraryMetadataBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetRefreshLibraryMetadataUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetSearchLibrary - Search Library -// Search for content within a specific section of the library. -// -// ### Types -// Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: -// -// - **Type Object Attributes**: -// - `type`: Metadata type (if standard Plex type). -// - `title`: Title for this content type (e.g., "Movies"). -// -// - **Filter Objects**: -// - Subset of the media query language. -// - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. -// -// - **Sort Objects**: -// - Description of sort fields. -// - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. -// -// > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. -func (s *Library) GetSearchLibrary(ctx context.Context, sectionKey int, type_ operations.GetSearchLibraryQueryParamType, opts ...operations.Option) (*operations.GetSearchLibraryResponse, error) { - request := operations.GetSearchLibraryRequest{ - SectionKey: sectionKey, - Type: type_, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/search", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-search-library", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetSearchLibraryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetSearchLibraryResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSearchLibraryBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSearchLibraryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetGenresLibrary - Get Genres of library media -// Retrieves a list of all the genres that are found for the media in this library. -func (s *Library) GetGenresLibrary(ctx context.Context, sectionKey int, type_ operations.GetGenresLibraryQueryParamType, opts ...operations.Option) (*operations.GetGenresLibraryResponse, error) { - request := operations.GetGenresLibraryRequest{ - SectionKey: sectionKey, - Type: type_, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/genre", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-genres-library", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetGenresLibraryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetGenresLibraryResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetGenresLibraryBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetGenresLibraryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetCountriesLibrary - Get Countries of library media -// Retrieves a list of all the countries that are found for the media in this library. -func (s *Library) GetCountriesLibrary(ctx context.Context, sectionKey int, type_ operations.GetCountriesLibraryQueryParamType, opts ...operations.Option) (*operations.GetCountriesLibraryResponse, error) { - request := operations.GetCountriesLibraryRequest{ - SectionKey: sectionKey, - Type: type_, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/country", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-countries-library", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetCountriesLibraryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetCountriesLibraryResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetCountriesLibraryBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetCountriesLibraryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetActorsLibrary - Get Actors of library media -// Retrieves a list of all the actors that are found for the media in this library. -func (s *Library) GetActorsLibrary(ctx context.Context, sectionKey int, type_ operations.GetActorsLibraryQueryParamType, opts ...operations.Option) (*operations.GetActorsLibraryResponse, error) { - request := operations.GetActorsLibraryRequest{ - SectionKey: sectionKey, - Type: type_, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/actor", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-actors-library", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetActorsLibraryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetActorsLibraryResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetActorsLibraryBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetActorsLibraryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetSearchAllLibraries - Search All Libraries -// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. -func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.GetSearchAllLibrariesRequest, opts ...operations.Option) (*operations.GetSearchAllLibrariesResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/library/search") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-search-all-libraries", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetSearchAllLibrariesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetSearchAllLibrariesResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSearchAllLibrariesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSearchAllLibrariesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetMediaMetaData - Get Media Metadata -// This endpoint will return all the (meta)data of one or more library items specified by the ratingKey. -// Multiple rating keys can be provided as a comma-separated list (e.g., "21119,21617"). -func (s *Library) GetMediaMetaData(ctx context.Context, request operations.GetMediaMetaDataRequest, opts ...operations.Option) (*operations.GetMediaMetaDataResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-media-meta-data", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetMediaMetaDataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetMediaMetaDataResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMediaMetaDataBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMediaMetaDataUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetMediaArts - Get Media Background Artwork -// Returns the background artwork for a library item. -func (s *Library) GetMediaArts(ctx context.Context, ratingKey int64, opts ...operations.Option) (*operations.GetMediaArtsResponse, error) { - request := operations.GetMediaArtsRequest{ - RatingKey: ratingKey, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/arts", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-media-arts", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetMediaArtsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetMediaArtsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// PostMediaArts - Upload Media Background Artwork -// Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL -func (s *Library) PostMediaArts(ctx context.Context, ratingKey int64, url_ *string, requestBody *any, opts ...operations.Option) (*operations.PostMediaArtsResponse, error) { - request := operations.PostMediaArtsRequest{ - RatingKey: ratingKey, - URL: url_, - RequestBody: requestBody, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/arts", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "post-media-arts", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "raw", `request:"mediaType=image/*"`) - if err != nil { - return nil, err - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if reqContentType != "" { - req.Header.Set("Content-Type", reqContentType) - } - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -4003,7 +2545,7 @@ func (s *Library) PostMediaArts(ctx context.Context, ratingKey int64, url_ *stri _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "503", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -4018,7 +2560,7 @@ func (s *Library) PostMediaArts(ctx context.Context, ratingKey int64, url_ *stri } } - res := &operations.PostMediaArtsResponse{ + res := &operations.RefreshSectionsMetadataResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -4026,14 +2568,14 @@ func (s *Library) PostMediaArts(ctx context.Context, ratingKey int64, url_ *stri switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 404: - fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { return nil, err } return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 503: + fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -4052,11 +2594,21 @@ func (s *Library) PostMediaArts(ctx context.Context, ratingKey int64, url_ *stri } -// GetMediaPosters - Get Media Posters -// Returns the available posters for a library item. -func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ...operations.Option) (*operations.GetMediaPostersResponse, error) { - request := operations.GetMediaPostersRequest{ - RatingKey: ratingKey, +// GetTags - Get all library tags of a type +// Get all library tags of a type +func (s *Library) GetTags(ctx context.Context, request operations.GetTagsRequest, opts ...operations.Option) (*operations.GetTagsResponse, error) { + globals := operations.GetTagsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -4077,7 +2629,7 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/posters", request, nil) + opURL, err := url.JoinPath(baseURL, "/library/tags") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -4087,8 +2639,8 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "get-media-posters", - OAuth2Scopes: []string{}, + OperationID: "getTags", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -4110,6 +2662,12 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -4194,7 +2752,7 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -4209,7 +2767,7 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... } } - res := &operations.GetMediaPostersResponse{ + res := &operations.GetTagsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -4224,7 +2782,7 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... return nil, err } - var out operations.GetMediaPostersResponseBody + var out operations.GetTagsResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -4237,8 +2795,6 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 404: - fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -4263,13 +2819,21 @@ func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ... } -// PostMediaPoster - Upload Media Poster -// Uploads a poster to a library item, either from a local file or a remote URL -func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *string, requestBody *any, opts ...operations.Option) (*operations.PostMediaPosterResponse, error) { - request := operations.PostMediaPosterRequest{ - RatingKey: ratingKey, - URL: url_, - RequestBody: requestBody, +// DeleteMetadataItem - Delete a metadata item +// Delete a single metadata item from the library, deleting media as well +func (s *Library) DeleteMetadataItem(ctx context.Context, request operations.DeleteMetadataItemRequest, opts ...operations.Option) (*operations.DeleteMetadataItemResponse, error) { + globals := operations.DeleteMetadataItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -4290,7 +2854,7 @@ func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *st } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/posters", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -4300,14 +2864,10 @@ func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *st SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "post-media-poster", - OAuth2Scopes: []string{}, + OperationID: "deleteMetadataItem", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "raw", `request:"mediaType=image/*"`) - if err != nil { - return nil, err - } timeout := o.Timeout if timeout == nil { @@ -4320,17 +2880,1692 @@ func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *st defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if reqContentType != "" { - req.Header.Set("Content-Type", reqContentType) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) } - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteMetadataItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// EditMetadataItem - Edit a metadata item +// Edit metadata items setting fields +func (s *Library) EditMetadataItem(ctx context.Context, request operations.EditMetadataItemRequest, opts ...operations.Option) (*operations.EditMetadataItemResponse, error) { + globals := operations.EditMetadataItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "editMetadataItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EditMetadataItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DetectAds - Ad-detect an item +// Start the detection of ads in a metadata item +func (s *Library) DetectAds(ctx context.Context, request operations.DetectAdsRequest, opts ...operations.Option) (*operations.DetectAdsResponse, error) { + globals := operations.DetectAdsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/addetect", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "detectAds", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DetectAdsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetAllItemLeaves - Get the leaves of an item +// Get the leaves for a metadata item such as the episodes in a show +func (s *Library) GetAllItemLeaves(ctx context.Context, request operations.GetAllItemLeavesRequest, opts ...operations.Option) (*operations.GetAllItemLeavesResponse, error) { + globals := operations.GetAllItemLeavesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/allLeaves", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAllItemLeaves", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAllItemLeavesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AnalyzeMetadata - Analyze an item +// Start the analysis of a metadata item +func (s *Library) AnalyzeMetadata(ctx context.Context, request operations.AnalyzeMetadataRequest, opts ...operations.Option) (*operations.AnalyzeMetadataResponse, error) { + globals := operations.AnalyzeMetadataGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/analyze", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "analyzeMetadata", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AnalyzeMetadataResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GenerateThumbs - Generate thumbs of chapters for an item +// Start the chapter thumb generation for an item +func (s *Library) GenerateThumbs(ctx context.Context, request operations.GenerateThumbsRequest, opts ...operations.Option) (*operations.GenerateThumbsResponse, error) { + globals := operations.GenerateThumbsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/chapterThumbs", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "generateThumbs", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GenerateThumbsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DetectCredits - Credit detect a metadata item +// Start credit detection on a metadata item +func (s *Library) DetectCredits(ctx context.Context, request operations.DetectCreditsRequest, opts ...operations.Option) (*operations.DetectCreditsResponse, error) { + globals := operations.DetectCreditsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/credits", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "detectCredits", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DetectCreditsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetExtras - Get an item's extras +// Get the extras for a metadata item +func (s *Library) GetExtras(ctx context.Context, request operations.GetExtrasRequest, opts ...operations.Option) (*operations.GetExtrasResponse, error) { + globals := operations.GetExtrasGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/extras", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getExtras", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetExtrasResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddExtras - Add to an item's extras +// Add an extra to a metadata item +func (s *Library) AddExtras(ctx context.Context, request operations.AddExtrasRequest, opts ...operations.Option) (*operations.AddExtrasResponse, error) { + globals := operations.AddExtrasGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/extras", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addExtras", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -4433,7 +4668,7 @@ func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *st } } - res := &operations.PostMediaPosterResponse{ + res := &operations.AddExtrasResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -4467,18 +4702,28 @@ func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *st } -// 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, includeElements *string, opts ...operations.Option) (*operations.GetMetadataChildrenResponse, error) { - request := operations.GetMetadataChildrenRequest{ - RatingKey: ratingKey, - IncludeElements: includeElements, +// GetFile - Get a file from a metadata or media bundle +// Get a bundle file for a metadata or media item. This is either an image or a mp3 (for a show's theme) +func (s *Library) GetFile(ctx context.Context, request operations.GetFileRequest, opts ...operations.Option) (*operations.GetFileResponse, error) { + globals := operations.GetFileGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, operations.SupportedOptionTimeout, + operations.SupportedOptionAcceptHeaderOverride, } for _, opt := range opts { @@ -4493,7 +4738,7 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/children", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/file", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -4503,8 +4748,8 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getMetadataChildren", - OAuth2Scopes: []string{}, + OperationID: "getFile", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -4523,10 +4768,17 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + if o.AcceptHeaderOverride != nil { + req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) + } else { + req.Header.Set("Accept", "audio/mpeg3;q=1, image/jpeg;q=0") + } + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -4614,7 +4866,7 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -4629,7 +4881,7 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in } } - res := &operations.GetMetadataChildrenResponse{ + res := &operations.GetFileResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -4638,62 +4890,14 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `audio/mpeg3`): + res.TwoHundredAudioMpeg3ResponseStream = httpRes.Body - var out operations.GetMetadataChildrenResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + return res, nil + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): + res.TwoHundredImageJpegResponseStream = httpRes.Body - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMetadataChildrenBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMetadataChildrenUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out + return res, nil default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -4725,12 +4929,21 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in } -// GetTopWatchedContent - Get Top Watched Content -// This endpoint will return the top watched content from libraries of a certain type -func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.GetTopWatchedContentQueryParamType, includeGuids *operations.GetTopWatchedContentQueryParamIncludeGuids, opts ...operations.Option) (*operations.GetTopWatchedContentResponse, error) { - request := operations.GetTopWatchedContentRequest{ - Type: type_, - IncludeGuids: includeGuids, +// StartBifGeneration - Start BIF generation of an item +// Start the indexing (BIF generation) of an item +func (s *Library) StartBifGeneration(ctx context.Context, request operations.StartBifGenerationRequest, opts ...operations.Option) (*operations.StartBifGenerationResponse, error) { + globals := operations.StartBifGenerationGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -4751,7 +4964,7 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/library/all/top") + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/index", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -4761,8 +4974,8 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getTopWatchedContent", - OAuth2Scopes: []string{}, + OperationID: "startBifGeneration", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -4777,14 +4990,16 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -4872,7 +5087,7 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -4887,7 +5102,417 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get } } - res := &operations.GetTopWatchedContentResponse{ + res := &operations.StartBifGenerationResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DetectIntros - Intro detect an item +// Start the detection of intros in a metadata item +func (s *Library) DetectIntros(ctx context.Context, request operations.DetectIntrosRequest, opts ...operations.Option) (*operations.DetectIntrosResponse, error) { + globals := operations.DetectIntrosGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/intro", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "detectIntros", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DetectIntrosResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreateMarker - Create a marker +// Create a marker for this user on the metadata item +func (s *Library) CreateMarker(ctx context.Context, request operations.CreateMarkerRequest, opts ...operations.Option) (*operations.CreateMarkerResponse, error) { + globals := operations.CreateMarkerGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/marker", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createMarker", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateMarkerResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -4902,7 +5527,7 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get return nil, err } - var out operations.GetTopWatchedContentResponseBody + var out operations.CreateMarkerResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -4916,28 +5541,417 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTopWatchedContentBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err } - case httpRes.StatusCode == 401: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// MatchItem - Match a metadata item +// Match a metadata item to a guid +func (s *Library) MatchItem(ctx context.Context, request operations.MatchItemRequest, opts ...operations.Option) (*operations.MatchItemResponse, error) { + globals := operations.MatchItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/match", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "matchItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MatchItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListMatches - Get metadata matches for an item +// Get the list of metadata matches for a metadata item +func (s *Library) ListMatches(ctx context.Context, request operations.ListMatchesRequest, opts ...operations.Option) (*operations.ListMatchesResponse, error) { + globals := operations.ListMatchesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/matches", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listMatches", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListMatchesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -4945,13 +5959,12 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get return nil, err } - var out sdkerrors.GetTopWatchedContentUnauthorized + var out components.MediaContainerWithMetadata if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - out.RawResponse = httpRes - return nil, &out + res.MediaContainerWithMetadata = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -4982,3 +5995,10922 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get return res, nil } + +// MergeItems - Merge a metadata item +// Merge a metadata item with other items +func (s *Library) MergeItems(ctx context.Context, request operations.MergeItemsRequest, opts ...operations.Option) (*operations.MergeItemsResponse, error) { + globals := operations.MergeItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/merge", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "mergeItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MergeItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListSonicallySimilar - Get nearest tracks to metadata item +// Get the nearest tracks, sonically, to the provided track +func (s *Library) ListSonicallySimilar(ctx context.Context, request operations.ListSonicallySimilarRequest, opts ...operations.Option) (*operations.ListSonicallySimilarResponse, error) { + globals := operations.ListSonicallySimilarGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/nearest", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listSonicallySimilar", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListSonicallySimilarResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetItemPreferences - Set metadata preferences +// Set the preferences on a metadata item +func (s *Library) SetItemPreferences(ctx context.Context, request operations.SetItemPreferencesRequest, opts ...operations.Option) (*operations.SetItemPreferencesResponse, error) { + globals := operations.SetItemPreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/prefs", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setItemPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetItemPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RefreshItemsMetadata - Refresh a metadata item +// Refresh a metadata item from the agent +func (s *Library) RefreshItemsMetadata(ctx context.Context, request operations.RefreshItemsMetadataRequest, opts ...operations.Option) (*operations.RefreshItemsMetadataResponse, error) { + globals := operations.RefreshItemsMetadataGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/refresh", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "refreshItemsMetadata", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RefreshItemsMetadataResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetRelatedItems - Get related items +// Get a hub of related items to a metadata item +func (s *Library) GetRelatedItems(ctx context.Context, request operations.GetRelatedItemsRequest, opts ...operations.Option) (*operations.GetRelatedItemsResponse, error) { + globals := operations.GetRelatedItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/related", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getRelatedItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetRelatedItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetRelatedItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListSimilar - Get similar items +// Get a list of similar items to a metadata item +func (s *Library) ListSimilar(ctx context.Context, request operations.ListSimilarRequest, opts ...operations.Option) (*operations.ListSimilarResponse, error) { + globals := operations.ListSimilarGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/similar", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listSimilar", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListSimilarResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SplitItem - Split a metadata item +// Split a metadata item into multiple items +func (s *Library) SplitItem(ctx context.Context, request operations.SplitItemRequest, opts ...operations.Option) (*operations.SplitItemResponse, error) { + globals := operations.SplitItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/split", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "splitItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SplitItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddSubtitles - Add subtitles +// Add a subtitle to a metadata item +func (s *Library) AddSubtitles(ctx context.Context, request operations.AddSubtitlesRequest, opts ...operations.Option) (*operations.AddSubtitlesResponse, error) { + globals := operations.AddSubtitlesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/subtitles", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addSubtitles", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddSubtitlesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetItemTree - Get metadata items as a tree +// Get a tree of metadata items, such as the seasons/episodes of a show +func (s *Library) GetItemTree(ctx context.Context, request operations.GetItemTreeRequest, opts ...operations.Option) (*operations.GetItemTreeResponse, error) { + globals := operations.GetItemTreeGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/tree", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getItemTree", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetItemTreeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithNestedMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithNestedMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Unmatch a metadata item +// Unmatch a metadata item to info fetched from the agent +func (s *Library) Unmatch(ctx context.Context, request operations.UnmatchRequest, opts ...operations.Option) (*operations.UnmatchResponse, error) { + globals := operations.UnmatchGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/unmatch", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "unmatch", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UnmatchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListTopUsers - Get metadata top users +// Get the list of users which have played this item starting with the most +func (s *Library) ListTopUsers(ctx context.Context, request operations.ListTopUsersRequest, opts ...operations.Option) (*operations.ListTopUsersResponse, error) { + globals := operations.ListTopUsersGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/users/top", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listTopUsers", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListTopUsersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListTopUsersResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DetectVoiceActivity - Detect voice activity +// Start the detection of voice in a metadata item +func (s *Library) DetectVoiceActivity(ctx context.Context, request operations.DetectVoiceActivityRequest, opts ...operations.Option) (*operations.DetectVoiceActivityResponse, error) { + globals := operations.DetectVoiceActivityGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/voiceActivity", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "detectVoiceActivity", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DetectVoiceActivityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetAugmentationStatus - Get augmentation status +// Get augmentation status and potentially wait for completion +func (s *Library) GetAugmentationStatus(ctx context.Context, request operations.GetAugmentationStatusRequest, opts ...operations.Option) (*operations.GetAugmentationStatusResponse, error) { + globals := operations.GetAugmentationStatusGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/augmentations/{augmentationId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAugmentationStatus", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAugmentationStatusResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetStreamSelection - Set stream selection +// Set which streams (audio/subtitle) are selected by this user +func (s *Library) SetStreamSelection(ctx context.Context, request operations.SetStreamSelectionRequest, opts ...operations.Option) (*operations.SetStreamSelectionResponse, error) { + globals := operations.SetStreamSelectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/parts/{partId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setStreamSelection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetStreamSelectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPerson - Get person details +// Get details for a single actor. +func (s *Library) GetPerson(ctx context.Context, request operations.GetPersonRequest, opts ...operations.Option) (*operations.GetPersonResponse, error) { + globals := operations.GetPersonGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/people/{personId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPerson", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPersonResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetPersonResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListPersonMedia - Get media for a person +// Get all the media for a single actor. +func (s *Library) ListPersonMedia(ctx context.Context, request operations.ListPersonMediaRequest, opts ...operations.Option) (*operations.ListPersonMediaResponse, error) { + globals := operations.ListPersonMediaGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/people/{personId}/media", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listPersonMedia", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPersonMediaResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteLibrarySection - Delete a library section +// Delete a library section by id +func (s *Library) DeleteLibrarySection(ctx context.Context, request operations.DeleteLibrarySectionRequest, opts ...operations.Option) (*operations.DeleteLibrarySectionResponse, error) { + globals := operations.DeleteLibrarySectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteLibrarySection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteLibrarySectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetLibraryDetails - Get a library section by id +// 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. It often contains a list of `Directory` metadata objects: These used to be used by clients to build a menuing system. +func (s *Library) GetLibraryDetails(ctx context.Context, request operations.GetLibraryDetailsRequest, opts ...operations.Option) (*operations.GetLibraryDetailsResponse, error) { + globals := operations.GetLibraryDetailsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getLibraryDetails", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetLibraryDetailsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetLibraryDetailsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// EditSection - Edit a library section +// Edit a library section by id setting parameters +func (s *Library) EditSection(ctx context.Context, request operations.EditSectionRequest, opts ...operations.Option) (*operations.EditSectionResponse, error) { + globals := operations.EditSectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "editSection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EditSectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpdateItems - Set the fields of the filtered items +// This endpoint takes an large possible set of values. Here are some examples. +// - **Parameters, extra documentation** +// - artist.title.value +// - When used with track, both artist.title.value and album.title.value need to be specified +// - title.value usage +// - Summary +// - Tracks always rename and never merge +// - Albums and Artists +// - if single item and item without title does not exist, it is renamed. +// - if single item and item with title does exist they are merged. +// - if multiple they are always merged. +// - Tracks +// - Works as expected will update the track's title +// - Single track: `/library/sections/{id}/all?type=10&id=42&title.value=NewName` +// - Multiple tracks: `/library/sections/{id}/all?type=10&id=42,43,44&title.value=NewName` +// - All tracks: `/library/sections/{id}/all?type=10&title.value=NewName` +// - Albums +// - Functionality changes depending on the existence of an album with the same title +// - Album exists +// - Single album: `/library/sections/{id}/all?type=9&id=42&title.value=Album 2` +// - Album with id 42 is merged into album titled "Album 2" +// - Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=Moo Album` +// - All albums are merged into the existing album titled "Moo Album" +// - Album does not exist +// - Single album: `/library/sections/{id}/all?type=9&id=42&title.value=NewAlbumTitle` +// - Album with id 42 has title modified to "NewAlbumTitle" +// - Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=NewAlbumTitle` +// - All albums are merged into a new album with title="NewAlbumTitle" +// - Artists +// - Functionaly changes depending on the existence of an artist with the same title. +// - Artist exists +// - Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=Artist 2` +// - Artist with id 42 is merged into existing artist titled "Artist 2" +// - Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=Artist 3` +// - All artists are merged into the existing artist titled "Artist 3" +// - Artist does not exist +// - Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=NewArtistTitle` +// - Artist with id 42 has title modified to "NewArtistTitle" +// - Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=NewArtistTitle` +// - All artists are merged into a new artist with title="NewArtistTitle" +// +// - **Notes** +// - Technically square brackets are not allowed in an URI except the Internet Protocol Literal Address +// - RFC3513: A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax. +// - Escaped square brackets are allowed, but don't render well +func (s *Library) UpdateItems(ctx context.Context, request operations.UpdateItemsRequest, opts ...operations.Option) (*operations.UpdateItemsResponse, error) { + globals := operations.UpdateItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/all", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updateItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "409", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpdateItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 409: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StartAnalysis - Analyze a section +// Start analysis of all items in a section. If BIF generation is enabled, this will also be started on this section +func (s *Library) StartAnalysis(ctx context.Context, request operations.StartAnalysisRequest, opts ...operations.Option) (*operations.StartAnalysisResponse, error) { + globals := operations.StartAnalysisGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/analyze", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "startAnalysis", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StartAnalysisResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Autocomplete - Get autocompletions for search +// The field to autocomplete on is specified by the {field}.query parameter. For example `genre.query` or `title.query`. +// Returns a set of items from the filtered items whose {field} starts with {field}.query. In the results, a {field}.queryRange will be present to express the range of the match +func (s *Library) Autocomplete(ctx context.Context, request operations.AutocompleteRequest, opts ...operations.Option) (*operations.AutocompleteResponse, error) { + globals := operations.AutocompleteGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/autocomplete", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "autocomplete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AutocompleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCollections - Get collections in a section +// Get all collections in a section +func (s *Library) GetCollections(ctx context.Context, request operations.GetCollectionsRequest, opts ...operations.Option) (*operations.GetCollectionsResponse, error) { + globals := operations.GetCollectionsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/collections", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCollections", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCollectionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetCommon - Get common fields for items +// Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter +// Fields which are not common will be expressed in the `mixedFields` field +func (s *Library) GetCommon(ctx context.Context, request operations.GetCommonRequest, opts ...operations.Option) (*operations.GetCommonResponse, error) { + globals := operations.GetCommonGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/common", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getCommon", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetCommonResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// EmptyTrash - Empty section trash +// Empty trash in the section, permanently deleting media/metadata for missing media +func (s *Library) EmptyTrash(ctx context.Context, request operations.EmptyTrashRequest, opts ...operations.Option) (*operations.EmptyTrashResponse, error) { + globals := operations.EmptyTrashGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/emptyTrash", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "emptyTrash", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EmptyTrashResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSectionFilters - Get section filters +// Get common filters on a section +func (s *Library) GetSectionFilters(ctx context.Context, request operations.GetSectionFiltersRequest, opts ...operations.Option) (*operations.GetSectionFiltersResponse, error) { + globals := operations.GetSectionFiltersGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/filters", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSectionFilters", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSectionFiltersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetSectionFiltersResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetFirstCharacters - Get list of first characters +// Get list of first characters in this section +func (s *Library) GetFirstCharacters(ctx context.Context, request operations.GetFirstCharactersRequest, opts ...operations.Option) (*operations.GetFirstCharactersResponse, error) { + globals := operations.GetFirstCharactersGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/firstCharacters", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getFirstCharacters", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetFirstCharactersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetFirstCharactersResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteIndexes - Delete section indexes +// Delete all the indexes in a section +func (s *Library) DeleteIndexes(ctx context.Context, request operations.DeleteIndexesRequest, opts ...operations.Option) (*operations.DeleteIndexesResponse, error) { + globals := operations.DeleteIndexesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/indexes", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteIndexes", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteIndexesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteIntros - Delete section intro markers +// Delete all the intro markers in a section +func (s *Library) DeleteIntros(ctx context.Context, request operations.DeleteIntrosRequest, opts ...operations.Option) (*operations.DeleteIntrosResponse, error) { + globals := operations.DeleteIntrosGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/intros", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteIntros", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteIntrosResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSectionPreferences - Get section prefs +// Get the prefs for a section by id and potentially overriding the agent +func (s *Library) GetSectionPreferences(ctx context.Context, request operations.GetSectionPreferencesRequest, opts ...operations.Option) (*operations.GetSectionPreferencesResponse, error) { + globals := operations.GetSectionPreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/prefs", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSectionPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSectionPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSettings + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSettings = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetSectionPreferences - Set section prefs +// Set the prefs for a section by id +func (s *Library) SetSectionPreferences(ctx context.Context, request operations.SetSectionPreferencesRequest, opts ...operations.Option) (*operations.SetSectionPreferencesResponse, error) { + globals := operations.SetSectionPreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/prefs", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setSectionPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetSectionPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CancelRefresh - Cancel section refresh +// Cancel the refresh of a section +func (s *Library) CancelRefresh(ctx context.Context, request operations.CancelRefreshRequest, opts ...operations.Option) (*operations.CancelRefreshResponse, error) { + globals := operations.CancelRefreshGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/refresh", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "cancelRefresh", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CancelRefreshResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RefreshSection - Refresh section +// Start a refresh of this section +func (s *Library) RefreshSection(ctx context.Context, request operations.RefreshSectionRequest, opts ...operations.Option) (*operations.RefreshSectionResponse, error) { + globals := operations.RefreshSectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/refresh", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "refreshSection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RefreshSectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetAvailableSorts - Get a section sorts +// Get the sort mechanisms available in a section +func (s *Library) GetAvailableSorts(ctx context.Context, request operations.GetAvailableSortsRequest, opts ...operations.Option) (*operations.GetAvailableSortsResponse, error) { + globals := operations.GetAvailableSortsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/sorts", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAvailableSorts", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAvailableSortsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetAvailableSortsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetStreamLevels - Get loudness about a stream in json +// The the loudness of a stream in db, one entry per 100ms +func (s *Library) GetStreamLevels(ctx context.Context, request operations.GetStreamLevelsRequest, opts ...operations.Option) (*operations.GetStreamLevelsResponse, error) { + globals := operations.GetStreamLevelsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/streams/{streamId}/levels", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getStreamLevels", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetStreamLevelsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetStreamLevelsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetStreamLoudness - Get loudness about a stream +// The the loudness of a stream in db, one number per line, one entry per 100ms +func (s *Library) GetStreamLoudness(ctx context.Context, request operations.GetStreamLoudnessRequest, opts ...operations.Option) (*operations.GetStreamLoudnessResponse, error) { + globals := operations.GetStreamLoudnessGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/streams/{streamId}/loudness", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getStreamLoudness", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "text/plain") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetStreamLoudnessResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `text/plain`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + out := string(rawBody) + res.Res = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetChapterImage - Get a chapter image +// Get a single chapter image for a piece of media +func (s *Library) GetChapterImage(ctx context.Context, request operations.GetChapterImageRequest, opts ...operations.Option) (*operations.GetChapterImageResponse, error) { + globals := operations.GetChapterImageGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/media/{mediaId}/chapterImages/{chapter}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getChapterImage", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "image/jpeg") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetChapterImageResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetItemArtwork - Set an item's artwork, theme, etc +// Set the artwork, thumb, element for a metadata item +// Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user +func (s *Library) SetItemArtwork(ctx context.Context, request operations.SetItemArtworkRequest, opts ...operations.Option) (*operations.SetItemArtworkResponse, error) { + globals := operations.SetItemArtworkGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/{element}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setItemArtwork", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetItemArtworkResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpdateItemArtwork - Set an item's artwork, theme, etc +// Set the artwork, thumb, element for a metadata item +// Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user +func (s *Library) UpdateItemArtwork(ctx context.Context, request operations.UpdateItemArtworkRequest, opts ...operations.Option) (*operations.UpdateItemArtworkResponse, error) { + globals := operations.UpdateItemArtworkGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/{element}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updateItemArtwork", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpdateItemArtworkResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteMarker - Delete a marker +// Delete a marker for this user on the metadata item +func (s *Library) DeleteMarker(ctx context.Context, request operations.DeleteMarkerRequest, opts ...operations.Option) (*operations.DeleteMarkerResponse, error) { + globals := operations.DeleteMarkerGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/marker/{marker}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteMarker", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteMarkerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// EditMarker - Edit a marker +// Edit a marker for this user on the metadata item +func (s *Library) EditMarker(ctx context.Context, request operations.EditMarkerRequest, opts ...operations.Option) (*operations.EditMarkerResponse, error) { + globals := operations.EditMarkerGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/marker/{marker}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "editMarker", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EditMarkerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PostResponses200 + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PostResponses200 = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteMediaItem - Delete a media item +// Delete a single media from a metadata item in the library +func (s *Library) DeleteMediaItem(ctx context.Context, request operations.DeleteMediaItemRequest, opts ...operations.Option) (*operations.DeleteMediaItemResponse, error) { + globals := operations.DeleteMediaItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/media/{mediaItem}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteMediaItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteMediaItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPartIndex - Get BIF index for a part +// Get BIF index for a part by index type +func (s *Library) GetPartIndex(ctx context.Context, request operations.GetPartIndexRequest, opts ...operations.Option) (*operations.GetPartIndexResponse, error) { + globals := operations.GetPartIndexGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/parts/{partId}/indexes/{index}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPartIndex", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPartIndexResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteCollection - Delete a collection +// Delete a library collection from the PMS +func (s *Library) DeleteCollection(ctx context.Context, request operations.DeleteCollectionRequest, opts ...operations.Option) (*operations.DeleteCollectionResponse, error) { + globals := operations.DeleteCollectionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/collection/{collectionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteCollection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteCollectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSectionImage - Get a section composite image +// Get a composite image of images in this section +func (s *Library) GetSectionImage(ctx context.Context, request operations.GetSectionImageRequest, opts ...operations.Option) (*operations.GetSectionImageResponse, error) { + globals := operations.GetSectionImageGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/composite/{updatedAt}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSectionImage", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSectionImageResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteStream - Delete a stream +// Delete a stream. Only applies to downloaded subtitle streams or a sidecar subtitle when media deletion is enabled. +func (s *Library) DeleteStream(ctx context.Context, request operations.DeleteStreamRequest, opts ...operations.Option) (*operations.DeleteStreamResponse, error) { + globals := operations.DeleteStreamGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/streams/{streamId}.{ext}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteStream", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteStreamResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetStream - Get a stream +// Get a stream (such as a sidecar subtitle stream) +func (s *Library) GetStream(ctx context.Context, request operations.GetStreamRequest, opts ...operations.Option) (*operations.GetStreamResponse, error) { + globals := operations.GetStreamGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/streams/{streamId}.{ext}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getStream", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "501", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetStreamResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 501: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetStreamOffset - Set a stream offset +// Set a stream offset in ms. This may not be respected by all clients +func (s *Library) SetStreamOffset(ctx context.Context, request operations.SetStreamOffsetRequest, opts ...operations.Option) (*operations.SetStreamOffsetResponse, error) { + globals := operations.SetStreamOffsetGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/streams/{streamId}.{ext}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setStreamOffset", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetStreamOffsetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetItemArtwork - Get an item's artwork, theme, etc +// Get the artwork, thumb, element for a metadata item +func (s *Library) GetItemArtwork(ctx context.Context, request operations.GetItemArtworkRequest, opts ...operations.Option) (*operations.GetItemArtworkResponse, error) { + globals := operations.GetItemArtworkGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + operations.SupportedOptionAcceptHeaderOverride, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ids}/{element}/{timestamp}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getItemArtwork", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + if o.AcceptHeaderOverride != nil { + req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) + } else { + req.Header.Set("Accept", "audio/mpeg3;q=1, image/jpeg;q=0") + } + + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetItemArtworkResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `audio/mpeg3`): + res.TwoHundredAudioMpeg3ResponseStream = httpRes.Body + + return res, nil + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): + res.TwoHundredImageJpegResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetMediaPart - Get a media part +// Get a media part for streaming or download. +// - streaming: This is the default scenario. Bandwidth usage on this endpoint will be guaranteed (on the server's end) to be at least the bandwidth reservation given in the decision. If no decision exists, an ad-hoc decision will be created if sufficient bandwidth exists. Clients should not rely on ad-hoc decisions being made as this may be removed in the future. +// - download: Indicated if the query parameter indicates this is a download. Bandwidth will be prioritized behind playbacks and will get a fair share of what remains. +func (s *Library) GetMediaPart(ctx context.Context, request operations.GetMediaPartRequest, opts ...operations.Option) (*operations.GetMediaPartResponse, error) { + globals := operations.GetMediaPartGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/parts/{partId}/{changestamp}/{filename}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getMediaPart", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "503", "509", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetMediaPartResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 503: + fallthrough + case httpRes.StatusCode == 509: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetImageFromBif - Get an image from part BIF +// Extract an image from the BIF for a part at a particular offset +func (s *Library) GetImageFromBif(ctx context.Context, request operations.GetImageFromBifRequest, opts ...operations.Option) (*operations.GetImageFromBifResponse, error) { + globals := operations.GetImageFromBifGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/parts/{partId}/indexes/{index}/{offset}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getImageFromBif", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "image/jpeg") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetImageFromBifResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/librarycollections.go b/librarycollections.go new file mode 100644 index 0000000..971e7e7 --- /dev/null +++ b/librarycollections.go @@ -0,0 +1,713 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" +) + +// LibraryCollections - Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well. +type LibraryCollections struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newLibraryCollections(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *LibraryCollections { + return &LibraryCollections{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// AddCollectionItems - Add items to a collection +// Add items to a collection by uri +func (s *LibraryCollections) AddCollectionItems(ctx context.Context, request operations.AddCollectionItemsRequest, opts ...operations.Option) (*operations.AddCollectionItemsResponse, error) { + globals := operations.AddCollectionItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/collections/{collectionId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addCollectionItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddCollectionItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteCollectionItem - Delete an item from a collection +// Delete an item from a collection +func (s *LibraryCollections) DeleteCollectionItem(ctx context.Context, request operations.DeleteCollectionItemRequest, opts ...operations.Option) (*operations.DeleteCollectionItemResponse, error) { + globals := operations.DeleteCollectionItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/collections/{collectionId}/items/{itemId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteCollectionItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteCollectionItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// MoveCollectionItem - Reorder an item in the collection +// Reorder items in a collection with one item after another +func (s *LibraryCollections) MoveCollectionItem(ctx context.Context, request operations.MoveCollectionItemRequest, opts ...operations.Option) (*operations.MoveCollectionItemResponse, error) { + globals := operations.MoveCollectionItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/library/collections/{collectionId}/items/{itemId}/move", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "moveCollectionItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MoveCollectionItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/libraryplaylists.go b/libraryplaylists.go new file mode 100644 index 0000000..ca90541 --- /dev/null +++ b/libraryplaylists.go @@ -0,0 +1,2890 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// LibraryPlaylists - Endpoints for manipulating playlists. +type LibraryPlaylists struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newLibraryPlaylists(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *LibraryPlaylists { + return &LibraryPlaylists{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// CreatePlaylist - Create a Playlist +// Create a new playlist. By default the playlist is blank. +func (s *LibraryPlaylists) CreatePlaylist(ctx context.Context, request operations.CreatePlaylistRequest, opts ...operations.Option) (*operations.CreatePlaylistResponse, error) { + globals := operations.CreatePlaylistGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/playlists") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createPlaylist", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreatePlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UploadPlaylist - Upload +// 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 *LibraryPlaylists) UploadPlaylist(ctx context.Context, request operations.UploadPlaylistRequest, opts ...operations.Option) (*operations.UploadPlaylistResponse, error) { + globals := operations.UploadPlaylistGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/playlists/upload") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "uploadPlaylist", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UploadPlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeletePlaylist - Delete a Playlist +// Deletes a playlist by provided id +func (s *LibraryPlaylists) DeletePlaylist(ctx context.Context, request operations.DeletePlaylistRequest, opts ...operations.Option) (*operations.DeletePlaylistResponse, error) { + globals := operations.DeletePlaylistGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deletePlaylist", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeletePlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpdatePlaylist - Editing a Playlist +// Edits a playlist in the same manner as [editing metadata](#tag/Provider/operation/metadataPutItem) +func (s *LibraryPlaylists) UpdatePlaylist(ctx context.Context, request operations.UpdatePlaylistRequest, opts ...operations.Option) (*operations.UpdatePlaylistResponse, error) { + globals := operations.UpdatePlaylistGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updatePlaylist", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpdatePlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPlaylistGenerators - Get a playlist's generators +// Get all the generators in a playlist +func (s *LibraryPlaylists) GetPlaylistGenerators(ctx context.Context, request operations.GetPlaylistGeneratorsRequest, opts ...operations.Option) (*operations.GetPlaylistGeneratorsResponse, error) { + globals := operations.GetPlaylistGeneratorsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/generators", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPlaylistGenerators", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPlaylistGeneratorsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetPlaylistGeneratorsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ClearPlaylistItems - Clearing a playlist +// Clears a playlist, only works with dumb playlists. Returns the playlist. +func (s *LibraryPlaylists) ClearPlaylistItems(ctx context.Context, request operations.ClearPlaylistItemsRequest, opts ...operations.Option) (*operations.ClearPlaylistItemsResponse, error) { + globals := operations.ClearPlaylistItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "clearPlaylistItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ClearPlaylistItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddPlaylistItems - 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 *LibraryPlaylists) AddPlaylistItems(ctx context.Context, request operations.AddPlaylistItemsRequest, opts ...operations.Option) (*operations.AddPlaylistItemsResponse, error) { + globals := operations.AddPlaylistItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addPlaylistItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddPlaylistItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeletePlaylistItem - Delete a Generator +// Deletes an item from a playlist. Only works with dumb playlists. +func (s *LibraryPlaylists) DeletePlaylistItem(ctx context.Context, request operations.DeletePlaylistItemRequest, opts ...operations.Option) (*operations.DeletePlaylistItemResponse, error) { + globals := operations.DeletePlaylistItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items/{generatorId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deletePlaylistItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeletePlaylistItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPlaylistGenerator - Get a playlist generator +// Get a playlist's generator. Only used for optimized versions +func (s *LibraryPlaylists) GetPlaylistGenerator(ctx context.Context, request operations.GetPlaylistGeneratorRequest, opts ...operations.Option) (*operations.GetPlaylistGeneratorResponse, error) { + globals := operations.GetPlaylistGeneratorGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items/{generatorId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPlaylistGenerator", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPlaylistGeneratorResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetPlaylistGeneratorResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ModifyPlaylistGenerator - Modify a Generator +// Modify a playlist generator. Only used for optimizer +func (s *LibraryPlaylists) ModifyPlaylistGenerator(ctx context.Context, request operations.ModifyPlaylistGeneratorRequest, opts ...operations.Option) (*operations.ModifyPlaylistGeneratorResponse, error) { + globals := operations.ModifyPlaylistGeneratorGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items/{generatorId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "modifyPlaylistGenerator", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ModifyPlaylistGeneratorResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPlaylistGeneratorItems - Get a playlist generator's items +// Get a playlist generator's items +func (s *LibraryPlaylists) GetPlaylistGeneratorItems(ctx context.Context, request operations.GetPlaylistGeneratorItemsRequest, opts ...operations.Option) (*operations.GetPlaylistGeneratorItemsResponse, error) { + globals := operations.GetPlaylistGeneratorItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items/{generatorId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPlaylistGeneratorItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPlaylistGeneratorItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetPlaylistGeneratorItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// MovePlaylistItem - Moving items in a playlist +// Moves an item in a playlist. Only works with dumb playlists. +func (s *LibraryPlaylists) MovePlaylistItem(ctx context.Context, request operations.MovePlaylistItemRequest, opts ...operations.Option) (*operations.MovePlaylistItemResponse, error) { + globals := operations.MovePlaylistItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items/{playlistItemId}/move", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "movePlaylistItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MovePlaylistItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RefreshPlaylist - Reprocess a generator +// Make a generator reprocess (refresh) +func (s *LibraryPlaylists) RefreshPlaylist(ctx context.Context, request operations.RefreshPlaylistRequest, opts ...operations.Option) (*operations.RefreshPlaylistResponse, error) { + globals := operations.RefreshPlaylistGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items/{generatorId}/{metadataId}/{action}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "refreshPlaylist", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RefreshPlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/livetv.go b/livetv.go new file mode 100644 index 0000000..cf890cc --- /dev/null +++ b/livetv.go @@ -0,0 +1,869 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// LiveTV contains the playback sessions of a channel from a DVR device +type LiveTV struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newLiveTV(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *LiveTV { + return &LiveTV{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetSessions - Get all sessions +// Get all livetv sessions and metadata +func (s *LiveTV) GetSessions(ctx context.Context, opts ...operations.Option) (*operations.GetSessionsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/livetv/sessions") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSessions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSessionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetLiveTVSession - Get a single session +// Get a single livetv session and metadata +func (s *LiveTV) GetLiveTVSession(ctx context.Context, request operations.GetLiveTVSessionRequest, opts ...operations.Option) (*operations.GetLiveTVSessionResponse, error) { + globals := operations.GetLiveTVSessionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/sessions/{sessionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getLiveTVSession", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetLiveTVSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSessionPlaylistIndex - Get a session playlist index +// Get a playlist index for playing this session +func (s *LiveTV) GetSessionPlaylistIndex(ctx context.Context, request operations.GetSessionPlaylistIndexRequest, opts ...operations.Option) (*operations.GetSessionPlaylistIndexResponse, error) { + globals := operations.GetSessionPlaylistIndexGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/sessions/{sessionId}/{consumerId}/index.m3u8", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSessionPlaylistIndex", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSessionPlaylistIndexResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSessionSegment - Get a single session segment +// Get a single LiveTV session segment +func (s *LiveTV) GetSessionSegment(ctx context.Context, request operations.GetSessionSegmentRequest, opts ...operations.Option) (*operations.GetSessionSegmentResponse, error) { + globals := operations.GetSessionSegmentGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/livetv/sessions/{sessionId}/{consumerId}/{segmentId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSessionSegment", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSessionSegmentResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/log.go b/log.go index 0c967f6..60f3c3e 100644 --- a/log.go +++ b/log.go @@ -3,7 +3,6 @@ package plexgo import ( - "bytes" "context" "fmt" "github.com/LukeHagar/plexgo/internal/config" @@ -16,7 +15,7 @@ import ( "net/url" ) -// Log - Submit logs to the Log Handler for Plex Media Server +// Log - Logging mechanism to allow clients to log to the server type Log struct { rootSDK *PlexAPI sdkConfiguration config.SDKConfiguration @@ -31,15 +30,9 @@ func newLog(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Ho } } -// 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, opts ...operations.Option) (*operations.LogLineResponse, error) { - request := operations.LogLineRequest{ - Level: level, - Message: message, - Source: source, - } - +// WriteLog - Logging a multi-line message to the Plex Media Server log +// 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 PUT endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above. +func (s *Log) WriteLog(ctx context.Context, request any, opts ...operations.Option) (*operations.WriteLogResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -68,264 +61,11 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "logLine", - OAuth2Scopes: []string{}, + OperationID: "writeLog", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.LogLineResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.LogLineBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.LogLineUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// LogMultiLine - Logging a multi-line message -// This endpoint allows for the batch addition of log entries to the main Plex Media Server log. -// It accepts a text/plain request body, where each line represents a distinct log entry. -// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. -// -// Log entries are separated by a newline character (`\n`). -// Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. -// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. -// -// The 'level' parameter specifies the log entry's severity or importance, with the following integer values: -// - `0`: Error - Critical issues that require immediate attention. -// - `1`: Warning - Important events that are not critical but may indicate potential issues. -// - `2`: Info - General informational messages about system operation. -// - `3`: Debug - Detailed information useful for debugging purposes. -// - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis. -// -// The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module). -// -// Example of a single log entry format: -// `level=4&message=Sample%20log%20entry&source=applicationName` -// -// Ensure each parameter is properly URL-encoded to avoid interpretation issues. -func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operations.Option) (*operations.LogMultiLineResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/log") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "logMultiLine", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "string", `request:"mediaType=text/plain"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "raw", `request:"mediaType=text/plain"`) if err != nil { return nil, err } @@ -345,7 +85,7 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if reqContentType != "" { req.Header.Set("Content-Type", reqContentType) @@ -435,7 +175,7 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -450,7 +190,7 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio } } - res := &operations.LogMultiLineResponse{ + res := &operations.WriteLogResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -459,49 +199,7 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio switch { case httpRes.StatusCode == 200: case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.LogMultiLineBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.LogMultiLineUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -526,9 +224,25 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio } -// 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, opts ...operations.Option) (*operations.EnablePaperTrailResponse, error) { +// WriteMessage - Logging a single-line message to the Plex Media Server log +// This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. +// +// Note: This endpoint responds to all HTTP verbs **except POST** but PUT is preferred +func (s *Log) WriteMessage(ctx context.Context, request operations.WriteMessageRequest, opts ...operations.Option) (*operations.WriteMessageResponse, error) { + globals := operations.WriteMessageGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -547,7 +261,7 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) ( } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/log/networked") + opURL, err := url.JoinPath(baseURL, "/log") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -557,8 +271,8 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) ( SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "enablePaperTrail", - OAuth2Scopes: []string{}, + OperationID: "writeMessage", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -573,13 +287,19 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) ( defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -664,7 +384,7 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) ( _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -679,7 +399,7 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) ( } } - res := &operations.EnablePaperTrailResponse{ + res := &operations.WriteMessageResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -687,50 +407,213 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) ( switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.EnablePaperTrailBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.EnablePaperTrailUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// EnablePapertrail - Enabling Papertrail +// This endpoint will enable all Plex Media Server logs to be sent to the Papertrail networked logging site for a period of time +// +// Note: This endpoint responds to all HTTP verbs but POST is preferred +func (s *Log) EnablePapertrail(ctx context.Context, request operations.EnablePapertrailRequest, opts ...operations.Option) (*operations.EnablePapertrailResponse, error) { + globals := operations.EnablePapertrailGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/log/networked") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "enablePapertrail", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EnablePapertrailResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: case httpRes.StatusCode == 403: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: diff --git a/media.go b/media.go deleted file mode 100644 index 2c56379..0000000 --- a/media.go +++ /dev/null @@ -1,1243 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Media - API Calls interacting with Plex Media Server Media -type Media struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newMedia(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Media { - return &Media{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// MarkPlayed - Mark Media Played -// This will mark the provided media key as Played. -func (s *Media) MarkPlayed(ctx context.Context, key float64, opts ...operations.Option) (*operations.MarkPlayedResponse, error) { - request := operations.MarkPlayedRequest{ - Key: key, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/:/scrobble") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "markPlayed", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.MarkPlayedResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.MarkPlayedBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.MarkPlayedUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.MarkUnplayedResponse, error) { - request := operations.MarkUnplayedRequest{ - Key: key, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/:/unscrobble") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "markUnplayed", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.MarkUnplayedResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.MarkUnplayedBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.MarkUnplayedUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.UpdatePlayProgressResponse, error) { - request := operations.UpdatePlayProgressRequest{ - Key: key, - Time: time, - State: state, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/:/progress") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "updatePlayProgress", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.UpdatePlayProgressResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.UpdatePlayProgressBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.UpdatePlayProgressUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetBannerImage - Get Banner Image -// Gets the banner image of the media item -func (s *Media) GetBannerImage(ctx context.Context, request operations.GetBannerImageRequest, opts ...operations.Option) (*operations.GetBannerImageResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/banner", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-banner-image", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "image/jpeg") - req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetBannerImageResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - res.Headers = httpRes.Header - - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): - res.ResponseStream = httpRes.Body - - return res, nil - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetBannerImageBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetBannerImageUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetThumbImage - Get Thumb Image -// Gets the thumbnail image of the media item -func (s *Media) GetThumbImage(ctx context.Context, request operations.GetThumbImageRequest, opts ...operations.Option) (*operations.GetThumbImageResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/thumb", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-thumb-image", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "image/jpeg") - req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetThumbImageResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - res.Headers = httpRes.Header - - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): - res.ResponseStream = httpRes.Body - - return res, nil - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetThumbImageBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetThumbImageUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/models/components/accepts.go b/models/components/accepts.go new file mode 100644 index 0000000..5ac04dd --- /dev/null +++ b/models/components/accepts.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Accepts string + +const ( + AcceptsApplicationJSON Accepts = "application/json" + AcceptsApplicationXML Accepts = "application/xml" +) + +func (e Accepts) ToPointer() *Accepts { + return &e +} +func (e *Accepts) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "application/json": + fallthrough + case "application/xml": + *e = Accepts(v) + return nil + default: + return fmt.Errorf("invalid value for Accepts: %v", v) + } +} diff --git a/models/components/advancedsubtitles.go b/models/components/advancedsubtitles.go new file mode 100644 index 0000000..d0c8a9e --- /dev/null +++ b/models/components/advancedsubtitles.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type AdvancedSubtitles string + +const ( + AdvancedSubtitlesBurn AdvancedSubtitles = "burn" + AdvancedSubtitlesText AdvancedSubtitles = "text" + AdvancedSubtitlesUnknown AdvancedSubtitles = "unknown" +) + +func (e AdvancedSubtitles) ToPointer() *AdvancedSubtitles { + return &e +} +func (e *AdvancedSubtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "burn": + fallthrough + case "text": + fallthrough + case "unknown": + *e = AdvancedSubtitles(v) + return nil + default: + return fmt.Errorf("invalid value for AdvancedSubtitles: %v", v) + } +} diff --git a/models/components/boolint.go b/models/components/boolint.go new file mode 100644 index 0000000..fa783a6 --- /dev/null +++ b/models/components/boolint.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type BoolInt int64 + +const ( + BoolIntZero BoolInt = 0 + BoolIntOne BoolInt = 1 +) + +func (e BoolInt) ToPointer() *BoolInt { + return &e +} +func (e *BoolInt) 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 = BoolInt(v) + return nil + default: + return fmt.Errorf("invalid value for BoolInt: %v", v) + } +} diff --git a/models/components/channel.go b/models/components/channel.go new file mode 100644 index 0000000..5998876 --- /dev/null +++ b/models/components/channel.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Channel struct { + Title *string `json:"title,omitempty"` + CallSign *string `json:"callSign,omitempty"` + ChannelVcn *string `json:"channelVcn,omitempty"` + Hd *bool `json:"hd,omitempty"` + Identifier *string `json:"identifier,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Thumb *string `json:"thumb,omitempty"` +} + +func (c *Channel) GetTitle() *string { + if c == nil { + return nil + } + return c.Title +} + +func (c *Channel) GetCallSign() *string { + if c == nil { + return nil + } + return c.CallSign +} + +func (c *Channel) GetChannelVcn() *string { + if c == nil { + return nil + } + return c.ChannelVcn +} + +func (c *Channel) GetHd() *bool { + if c == nil { + return nil + } + return c.Hd +} + +func (c *Channel) GetIdentifier() *string { + if c == nil { + return nil + } + return c.Identifier +} + +func (c *Channel) GetKey() *string { + if c == nil { + return nil + } + return c.Key +} + +func (c *Channel) GetLanguage() *string { + if c == nil { + return nil + } + return c.Language +} + +func (c *Channel) GetThumb() *string { + if c == nil { + return nil + } + return c.Thumb +} diff --git a/models/components/channelmapping.go b/models/components/channelmapping.go new file mode 100644 index 0000000..185d033 --- /dev/null +++ b/models/components/channelmapping.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChannelMapping struct { + ChannelKey *string `json:"channelKey,omitempty"` + DeviceIdentifier *string `json:"deviceIdentifier,omitempty"` + Enabled *string `json:"enabled,omitempty"` + LineupIdentifier *string `json:"lineupIdentifier,omitempty"` +} + +func (c *ChannelMapping) GetChannelKey() *string { + if c == nil { + return nil + } + return c.ChannelKey +} + +func (c *ChannelMapping) GetDeviceIdentifier() *string { + if c == nil { + return nil + } + return c.DeviceIdentifier +} + +func (c *ChannelMapping) GetEnabled() *string { + if c == nil { + return nil + } + return c.Enabled +} + +func (c *ChannelMapping) GetLineupIdentifier() *string { + if c == nil { + return nil + } + return c.LineupIdentifier +} diff --git a/models/components/composite.go b/models/components/composite.go new file mode 100644 index 0000000..8dee57b --- /dev/null +++ b/models/components/composite.go @@ -0,0 +1,194 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// Format - The image type +type Format string + +const ( + FormatJpg Format = "jpg" + FormatPng Format = "png" +) + +func (e Format) ToPointer() *Format { + return &e +} +func (e *Format) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "jpg": + fallthrough + case "png": + *e = Format(v) + return nil + default: + return fmt.Errorf("invalid value for Format: %v", v) + } +} + +// Crop - Where to crop source images to fit into composite image proportions +type Crop string + +const ( + CropCenter Crop = "center" + CropTop Crop = "top" +) + +func (e Crop) ToPointer() *Crop { + return &e +} +func (e *Crop) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "center": + fallthrough + case "top": + *e = Crop(v) + return nil + default: + return fmt.Errorf("invalid value for Crop: %v", v) + } +} + +// CompositeMedia - The default image type to use as the sources +type CompositeMedia string + +const ( + CompositeMediaThumb CompositeMedia = "thumb" + CompositeMediaArt CompositeMedia = "art" + CompositeMediaBanner CompositeMedia = "banner" +) + +func (e CompositeMedia) ToPointer() *CompositeMedia { + return &e +} +func (e *CompositeMedia) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "thumb": + fallthrough + case "art": + fallthrough + case "banner": + *e = CompositeMedia(v) + return nil + default: + return fmt.Errorf("invalid value for CompositeMedia: %v", v) + } +} + +type Composite struct { + // Limit composite to specified metadata types + Type *int64 `queryParam:"name=type"` + // The image type + Format *Format `queryParam:"name=format"` + // 6 character hex RGB value for background color for image + BackgroundColor *string `queryParam:"name=backgroundColor"` + // The width of the intra-image border + Border *int64 `queryParam:"name=border"` + // Number of columns to construct in the composite image + Cols *int64 `queryParam:"name=cols"` + // Where to crop source images to fit into composite image proportions + Crop *Crop `queryParam:"name=crop"` + // The height of the image + Height *int64 `queryParam:"name=height"` + // The default image type to use as the sources + Media *CompositeMedia `queryParam:"name=media"` + // Allow repetion of images if there are not enough source images to fill grid + Repeat *bool `queryParam:"name=repeat"` + // Number of rows to construct in the composite image + Rows *int64 `queryParam:"name=rows"` + // The width of the image + Width *int64 `queryParam:"name=width"` +} + +func (c *Composite) GetType() *int64 { + if c == nil { + return nil + } + return c.Type +} + +func (c *Composite) GetFormat() *Format { + if c == nil { + return nil + } + return c.Format +} + +func (c *Composite) GetBackgroundColor() *string { + if c == nil { + return nil + } + return c.BackgroundColor +} + +func (c *Composite) GetBorder() *int64 { + if c == nil { + return nil + } + return c.Border +} + +func (c *Composite) GetCols() *int64 { + if c == nil { + return nil + } + return c.Cols +} + +func (c *Composite) GetCrop() *Crop { + if c == nil { + return nil + } + return c.Crop +} + +func (c *Composite) GetHeight() *int64 { + if c == nil { + return nil + } + return c.Height +} + +func (c *Composite) GetMedia() *CompositeMedia { + if c == nil { + return nil + } + return c.Media +} + +func (c *Composite) GetRepeat() *bool { + if c == nil { + return nil + } + return c.Repeat +} + +func (c *Composite) GetRows() *int64 { + if c == nil { + return nil + } + return c.Rows +} + +func (c *Composite) GetWidth() *int64 { + if c == nil { + return nil + } + return c.Width +} diff --git a/models/components/device.go b/models/components/device.go new file mode 100644 index 0000000..43b59ce --- /dev/null +++ b/models/components/device.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Device struct { + ChannelMapping []ChannelMapping `json:"ChannelMapping,omitempty"` + Key *string `json:"key,omitempty"` + LastSeenAt *int64 `json:"lastSeenAt,omitempty"` + Make *string `json:"make,omitempty"` + Model *string `json:"model,omitempty"` + ModelNumber *string `json:"modelNumber,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Sources *string `json:"sources,omitempty"` + State *string `json:"state,omitempty"` + Status *string `json:"status,omitempty"` + Tuners *string `json:"tuners,omitempty"` + URI *string `json:"uri,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (d *Device) GetChannelMapping() []ChannelMapping { + if d == nil { + return nil + } + return d.ChannelMapping +} + +func (d *Device) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *Device) GetLastSeenAt() *int64 { + if d == nil { + return nil + } + return d.LastSeenAt +} + +func (d *Device) GetMake() *string { + if d == nil { + return nil + } + return d.Make +} + +func (d *Device) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *Device) GetModelNumber() *string { + if d == nil { + return nil + } + return d.ModelNumber +} + +func (d *Device) GetProtocol() *string { + if d == nil { + return nil + } + return d.Protocol +} + +func (d *Device) GetSources() *string { + if d == nil { + return nil + } + return d.Sources +} + +func (d *Device) GetState() *string { + if d == nil { + return nil + } + return d.State +} + +func (d *Device) GetStatus() *string { + if d == nil { + return nil + } + return d.Status +} + +func (d *Device) GetTuners() *string { + if d == nil { + return nil + } + return d.Tuners +} + +func (d *Device) GetURI() *string { + if d == nil { + return nil + } + return d.URI +} + +func (d *Device) GetUUID() *string { + if d == nil { + return nil + } + return d.UUID +} diff --git a/models/components/directory.go b/models/components/directory.go new file mode 100644 index 0000000..653f209 --- /dev/null +++ b/models/components/directory.go @@ -0,0 +1,200 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +type Pivot struct { + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Context *string `json:"context,omitempty"` + ID *string `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Symbol *string `json:"symbol,omitempty"` +} + +func (p *Pivot) GetTitle() *string { + if p == nil { + return nil + } + return p.Title +} + +func (p *Pivot) GetType() *string { + if p == nil { + return nil + } + return p.Type +} + +func (p *Pivot) GetContext() *string { + if p == nil { + return nil + } + return p.Context +} + +func (p *Pivot) GetID() *string { + if p == nil { + return nil + } + return p.ID +} + +func (p *Pivot) GetKey() *string { + if p == nil { + return nil + } + return p.Key +} + +func (p *Pivot) GetSymbol() *string { + if p == nil { + return nil + } + return p.Symbol +} + +type Directory struct { + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Art *string `json:"art,omitempty"` + Content *bool `json:"content,omitempty"` + Filter *string `json:"filter,omitempty"` + HasPrefs *bool `json:"hasPrefs,omitempty"` + HasStoreServices *bool `json:"hasStoreServices,omitempty"` + HubKey *string `json:"hubKey,omitempty"` + Identifier *string `json:"identifier,omitempty"` + Key *string `json:"key,omitempty"` + LastAccessedAt *int64 `json:"lastAccessedAt,omitempty"` + Pivot []Pivot `json:"Pivot,omitempty"` + Share *int64 `json:"share,omitempty"` + Thumb *string `json:"thumb,omitempty"` + TitleBar *string `json:"titleBar,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (d Directory) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *Directory) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *Directory) GetTitle() *string { + if d == nil { + return nil + } + return d.Title +} + +func (d *Directory) GetType() *string { + if d == nil { + return nil + } + return d.Type +} + +func (d *Directory) GetArt() *string { + if d == nil { + return nil + } + return d.Art +} + +func (d *Directory) GetContent() *bool { + if d == nil { + return nil + } + return d.Content +} + +func (d *Directory) GetFilter() *string { + if d == nil { + return nil + } + return d.Filter +} + +func (d *Directory) GetHasPrefs() *bool { + if d == nil { + return nil + } + return d.HasPrefs +} + +func (d *Directory) GetHasStoreServices() *bool { + if d == nil { + return nil + } + return d.HasStoreServices +} + +func (d *Directory) GetHubKey() *string { + if d == nil { + return nil + } + return d.HubKey +} + +func (d *Directory) GetIdentifier() *string { + if d == nil { + return nil + } + return d.Identifier +} + +func (d *Directory) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *Directory) GetLastAccessedAt() *int64 { + if d == nil { + return nil + } + return d.LastAccessedAt +} + +func (d *Directory) GetPivot() []Pivot { + if d == nil { + return nil + } + return d.Pivot +} + +func (d *Directory) GetShare() *int64 { + if d == nil { + return nil + } + return d.Share +} + +func (d *Directory) GetThumb() *string { + if d == nil { + return nil + } + return d.Thumb +} + +func (d *Directory) GetTitleBar() *string { + if d == nil { + return nil + } + return d.TitleBar +} + +func (d *Directory) GetAdditionalProperties() map[string]any { + if d == nil { + return nil + } + return d.AdditionalProperties +} diff --git a/models/components/dvrrequesthandlerslashgetresponses200.go b/models/components/dvrrequesthandlerslashgetresponses200.go new file mode 100644 index 0000000..12c3fde --- /dev/null +++ b/models/components/dvrrequesthandlerslashgetresponses200.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer) GetIdentifier() *string { + if d == nil { + return nil + } + return d.Identifier +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer) GetOffset() *int64 { + if d == nil { + return nil + } + return d.Offset +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer) GetSize() *int64 { + if d == nil { + return nil + } + return d.Size +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer) GetTotalSize() *int64 { + if d == nil { + return nil + } + return d.TotalSize +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer) GetStatus() *int64 { + if d == nil { + return nil + } + return d.Status +} + +type Dvr struct { + Device []Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (d *Dvr) GetDevice() []Device { + if d == nil { + return nil + } + return d.Device +} + +func (d *Dvr) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *Dvr) GetLanguage() *string { + if d == nil { + return nil + } + return d.Language +} + +func (d *Dvr) GetLineup() *string { + if d == nil { + return nil + } + return d.Lineup +} + +func (d *Dvr) GetUUID() *string { + if d == nil { + return nil + } + return d.UUID +} + +type DvrRequestHandlerSlashGetResponses200MediaContainer struct { + MediaContainer *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer `json:"MediaContainer,omitempty"` + Dvr []Dvr `json:"DVR,omitempty"` +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainer) GetMediaContainer() *DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer { + if d == nil { + return nil + } + return d.MediaContainer +} + +func (d *DvrRequestHandlerSlashGetResponses200MediaContainer) GetDvr() []Dvr { + if d == nil { + return nil + } + return d.Dvr +} + +// DvrRequestHandlerSlashGetResponses200 - OK +type DvrRequestHandlerSlashGetResponses200 struct { + MediaContainer *DvrRequestHandlerSlashGetResponses200MediaContainer `json:"MediaContainer,omitempty"` +} + +func (d *DvrRequestHandlerSlashGetResponses200) GetMediaContainer() *DvrRequestHandlerSlashGetResponses200MediaContainer { + if d == nil { + return nil + } + return d.MediaContainer +} diff --git a/models/components/filter.go b/models/components/filter.go new file mode 100644 index 0000000..3065c5a --- /dev/null +++ b/models/components/filter.go @@ -0,0 +1,213 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +type FilterPivot struct { + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Context *string `json:"context,omitempty"` + ID *string `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Symbol *string `json:"symbol,omitempty"` +} + +func (f *FilterPivot) GetTitle() *string { + if f == nil { + return nil + } + return f.Title +} + +func (f *FilterPivot) GetType() *string { + if f == nil { + return nil + } + return f.Type +} + +func (f *FilterPivot) GetContext() *string { + if f == nil { + return nil + } + return f.Context +} + +func (f *FilterPivot) GetID() *string { + if f == nil { + return nil + } + return f.ID +} + +func (f *FilterPivot) GetKey() *string { + if f == nil { + return nil + } + return f.Key +} + +func (f *FilterPivot) GetSymbol() *string { + if f == nil { + return nil + } + return f.Symbol +} + +// Filter - 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 important subset useful for top-level API. +type Filter struct { + // The title for the filter. + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Art *string `json:"art,omitempty"` + Content *bool `json:"content,omitempty"` + // This represents the filter name used for the filter, which can be used to construct complex media queries with. + Filter *string `json:"filter,omitempty"` + HasPrefs *bool `json:"hasPrefs,omitempty"` + HasStoreServices *bool `json:"hasStoreServices,omitempty"` + HubKey *string `json:"hubKey,omitempty"` + Identifier *string `json:"identifier,omitempty"` + // 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. + Key *string `json:"key,omitempty"` + LastAccessedAt *int64 `json:"lastAccessedAt,omitempty"` + Pivot []FilterPivot `json:"Pivot,omitempty"` + Share *int64 `json:"share,omitempty"` + Thumb *string `json:"thumb,omitempty"` + TitleBar *string `json:"titleBar,omitempty"` + // This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter. + FilterType *string `json:"filterType,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (f Filter) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *Filter) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *Filter) GetTitle() *string { + if f == nil { + return nil + } + return f.Title +} + +func (f *Filter) GetType() *string { + if f == nil { + return nil + } + return f.Type +} + +func (f *Filter) GetArt() *string { + if f == nil { + return nil + } + return f.Art +} + +func (f *Filter) GetContent() *bool { + if f == nil { + return nil + } + return f.Content +} + +func (f *Filter) GetFilter() *string { + if f == nil { + return nil + } + return f.Filter +} + +func (f *Filter) GetHasPrefs() *bool { + if f == nil { + return nil + } + return f.HasPrefs +} + +func (f *Filter) GetHasStoreServices() *bool { + if f == nil { + return nil + } + return f.HasStoreServices +} + +func (f *Filter) GetHubKey() *string { + if f == nil { + return nil + } + return f.HubKey +} + +func (f *Filter) GetIdentifier() *string { + if f == nil { + return nil + } + return f.Identifier +} + +func (f *Filter) GetKey() *string { + if f == nil { + return nil + } + return f.Key +} + +func (f *Filter) GetLastAccessedAt() *int64 { + if f == nil { + return nil + } + return f.LastAccessedAt +} + +func (f *Filter) GetPivot() []FilterPivot { + if f == nil { + return nil + } + return f.Pivot +} + +func (f *Filter) GetShare() *int64 { + if f == nil { + return nil + } + return f.Share +} + +func (f *Filter) GetThumb() *string { + if f == nil { + return nil + } + return f.Thumb +} + +func (f *Filter) GetTitleBar() *string { + if f == nil { + return nil + } + return f.TitleBar +} + +func (f *Filter) GetFilterType() *string { + if f == nil { + return nil + } + return f.FilterType +} + +func (f *Filter) GetAdditionalProperties() map[string]any { + if f == nil { + return nil + } + return f.AdditionalProperties +} diff --git a/models/components/getresponses200.go b/models/components/getresponses200.go new file mode 100644 index 0000000..c369ac3 --- /dev/null +++ b/models/components/getresponses200.go @@ -0,0 +1,220 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// HomeVisibility - Whether this hub is visible on the home screen +// - all: Visible to all users +// - none: Visible to no users +// - admin: Visible to only admin users +// - shared: Visible to shared users +type HomeVisibility string + +const ( + HomeVisibilityAll HomeVisibility = "all" + HomeVisibilityNone HomeVisibility = "none" + HomeVisibilityAdmin HomeVisibility = "admin" + HomeVisibilityShared HomeVisibility = "shared" +) + +func (e HomeVisibility) ToPointer() *HomeVisibility { + return &e +} +func (e *HomeVisibility) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + fallthrough + case "none": + fallthrough + case "admin": + fallthrough + case "shared": + *e = HomeVisibility(v) + return nil + default: + return fmt.Errorf("invalid value for HomeVisibility: %v", v) + } +} + +// RecommendationsVisibility - The visibility of this hub in recommendations: +// - all: Visible to all users +// - none: Visible to no users +// - admin: Visible to only admin users +// - shared: Visible to shared users +type RecommendationsVisibility string + +const ( + RecommendationsVisibilityAll RecommendationsVisibility = "all" + RecommendationsVisibilityNone RecommendationsVisibility = "none" + RecommendationsVisibilityAdmin RecommendationsVisibility = "admin" + RecommendationsVisibilityShared RecommendationsVisibility = "shared" +) + +func (e RecommendationsVisibility) ToPointer() *RecommendationsVisibility { + return &e +} +func (e *RecommendationsVisibility) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + fallthrough + case "none": + fallthrough + case "admin": + fallthrough + case "shared": + *e = RecommendationsVisibility(v) + return nil + default: + return fmt.Errorf("invalid value for RecommendationsVisibility: %v", v) + } +} + +type GetResponses200Hub struct { + // Whether this hub is visible on the home screen + // - all: Visible to all users + // - none: Visible to no users + // - admin: Visible to only admin users + // - shared: Visible to shared users + // + HomeVisibility *HomeVisibility `json:"homeVisibility,omitempty"` + // The identifier for this hub + Identifier *string `json:"identifier,omitempty"` + // Whether this hub is visible to admin user home + PromotedToOwnHome *bool `json:"promotedToOwnHome,omitempty"` + // Whether this hub is promoted to all for recommendations + PromotedToRecommended *bool `json:"promotedToRecommended,omitempty"` + // Whether this hub is visible to shared user's home + PromotedToSharedHome *bool `json:"promotedToSharedHome,omitempty"` + // The visibility of this hub in recommendations: + // - all: Visible to all users + // - none: Visible to no users + // - admin: Visible to only admin users + // - shared: Visible to shared users + // + RecommendationsVisibility *RecommendationsVisibility `json:"recommendationsVisibility,omitempty"` + // The title of this hub + Title *string `json:"title,omitempty"` +} + +func (g *GetResponses200Hub) GetHomeVisibility() *HomeVisibility { + if g == nil { + return nil + } + return g.HomeVisibility +} + +func (g *GetResponses200Hub) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetResponses200Hub) GetPromotedToOwnHome() *bool { + if g == nil { + return nil + } + return g.PromotedToOwnHome +} + +func (g *GetResponses200Hub) GetPromotedToRecommended() *bool { + if g == nil { + return nil + } + return g.PromotedToRecommended +} + +func (g *GetResponses200Hub) GetPromotedToSharedHome() *bool { + if g == nil { + return nil + } + return g.PromotedToSharedHome +} + +func (g *GetResponses200Hub) GetRecommendationsVisibility() *RecommendationsVisibility { + if g == nil { + return nil + } + return g.RecommendationsVisibility +} + +func (g *GetResponses200Hub) GetTitle() *string { + if g == nil { + return nil + } + return g.Title +} + +// GetResponses200MediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetResponses200MediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []GetResponses200Hub `json:"Hub,omitempty"` +} + +func (g *GetResponses200MediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetResponses200MediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetResponses200MediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetResponses200MediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetResponses200MediaContainer) GetHub() []GetResponses200Hub { + if g == nil { + return nil + } + return g.Hub +} + +// GetResponses200 - OK +type GetResponses200 struct { + MediaContainer *GetResponses200MediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetResponses200) GetMediaContainer() *GetResponses200MediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} diff --git a/models/components/historyallgetresponses200.go b/models/components/historyallgetresponses200.go new file mode 100644 index 0000000..6fdf8ef --- /dev/null +++ b/models/components/historyallgetresponses200.go @@ -0,0 +1,167 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type HistoryAllGetResponses200Metadata struct { + // The account id of this playback + AccountID *int64 `json:"accountID,omitempty"` + // The device id which played the item + DeviceID *int64 `json:"deviceID,omitempty"` + // The key for this individual history item + HistoryKey *string `json:"historyKey,omitempty"` + // The metadata key for the item played + Key *string `json:"key,omitempty"` + // The library section id containing the item played + LibrarySectionID *string `json:"librarySectionID,omitempty"` + // The originally available at of the item played + OriginallyAvailableAt *string `json:"originallyAvailableAt,omitempty"` + // The rating key for the item played + RatingKey *string `json:"ratingKey,omitempty"` + // The thumb of the item played + Thumb *string `json:"thumb,omitempty"` + // The title of the item played + Title *string `json:"title,omitempty"` + // The metadata type of the item played + Type *string `json:"type,omitempty"` + // The time when the item was played + ViewedAt *int64 `json:"viewedAt,omitempty"` +} + +func (h *HistoryAllGetResponses200Metadata) GetAccountID() *int64 { + if h == nil { + return nil + } + return h.AccountID +} + +func (h *HistoryAllGetResponses200Metadata) GetDeviceID() *int64 { + if h == nil { + return nil + } + return h.DeviceID +} + +func (h *HistoryAllGetResponses200Metadata) GetHistoryKey() *string { + if h == nil { + return nil + } + return h.HistoryKey +} + +func (h *HistoryAllGetResponses200Metadata) GetKey() *string { + if h == nil { + return nil + } + return h.Key +} + +func (h *HistoryAllGetResponses200Metadata) GetLibrarySectionID() *string { + if h == nil { + return nil + } + return h.LibrarySectionID +} + +func (h *HistoryAllGetResponses200Metadata) GetOriginallyAvailableAt() *string { + if h == nil { + return nil + } + return h.OriginallyAvailableAt +} + +func (h *HistoryAllGetResponses200Metadata) GetRatingKey() *string { + if h == nil { + return nil + } + return h.RatingKey +} + +func (h *HistoryAllGetResponses200Metadata) GetThumb() *string { + if h == nil { + return nil + } + return h.Thumb +} + +func (h *HistoryAllGetResponses200Metadata) GetTitle() *string { + if h == nil { + return nil + } + return h.Title +} + +func (h *HistoryAllGetResponses200Metadata) GetType() *string { + if h == nil { + return nil + } + return h.Type +} + +func (h *HistoryAllGetResponses200Metadata) GetViewedAt() *int64 { + if h == nil { + return nil + } + return h.ViewedAt +} + +// HistoryAllGetResponses200MediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type HistoryAllGetResponses200MediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata []HistoryAllGetResponses200Metadata `json:"Metadata,omitempty"` +} + +func (h *HistoryAllGetResponses200MediaContainer) GetIdentifier() *string { + if h == nil { + return nil + } + return h.Identifier +} + +func (h *HistoryAllGetResponses200MediaContainer) GetOffset() *int64 { + if h == nil { + return nil + } + return h.Offset +} + +func (h *HistoryAllGetResponses200MediaContainer) GetSize() *int64 { + if h == nil { + return nil + } + return h.Size +} + +func (h *HistoryAllGetResponses200MediaContainer) GetTotalSize() *int64 { + if h == nil { + return nil + } + return h.TotalSize +} + +func (h *HistoryAllGetResponses200MediaContainer) GetMetadata() []HistoryAllGetResponses200Metadata { + if h == nil { + return nil + } + return h.Metadata +} + +// HistoryAllGetResponses200 - OK +type HistoryAllGetResponses200 struct { + MediaContainer *HistoryAllGetResponses200MediaContainer `json:"MediaContainer,omitempty"` +} + +func (h *HistoryAllGetResponses200) GetMediaContainer() *HistoryAllGetResponses200MediaContainer { + if h == nil { + return nil + } + return h.MediaContainer +} diff --git a/models/components/hub.go b/models/components/hub.go new file mode 100644 index 0000000..7309580 --- /dev/null +++ b/models/components/hub.go @@ -0,0 +1,153 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +type Hub struct { + // A title for this grouping of content + Title *string `json:"title,omitempty"` + // The type of the items contained in this hub, or possibly `mixed` if there are multiple types + Type *string `json:"type,omitempty"` + Context *string `json:"context,omitempty"` + // A unique identifier for the hub + HubIdentifier *string `json:"hubIdentifier,omitempty"` + // A key at which the exact content currently displayed can be fetched again. This is particularly important when a hub is marked as random and requesting the `key` may get different results. It's otherwise optional. + // + HubKey *string `json:"hubKey,omitempty"` + // The key at which all of the content for this hub can be retrieved + Key *string `json:"key,omitempty"` + Metadata []Metadata `json:"Metadata,omitempty"` + // "A boolean indicating that the hub contains more than what's included in the current response." + // + More *bool `json:"more,omitempty"` + // Indicating if the hub should be promoted to the user's homescreen + Promoted *bool `json:"promoted,omitempty"` + // Indicating that the contents of the hub may change on each request + Random *bool `json:"random,omitempty"` + Size *int64 `json:"size,omitempty"` + // A suggestion on how this hub's contents might be displayed by a client. Some examples include `hero`, `list`, `spotlight`, and `upsell` + Style *string `json:"style,omitempty"` + // The subtype of the items contained in this hub, or possibly `mixed` if there are multiple types + Subtype *string `json:"subtype,omitempty"` + TotalSize *int64 `json:"totalSize,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (h Hub) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(h, "", false) +} + +func (h *Hub) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &h, "", false, nil); err != nil { + return err + } + return nil +} + +func (h *Hub) GetTitle() *string { + if h == nil { + return nil + } + return h.Title +} + +func (h *Hub) GetType() *string { + if h == nil { + return nil + } + return h.Type +} + +func (h *Hub) GetContext() *string { + if h == nil { + return nil + } + return h.Context +} + +func (h *Hub) GetHubIdentifier() *string { + if h == nil { + return nil + } + return h.HubIdentifier +} + +func (h *Hub) GetHubKey() *string { + if h == nil { + return nil + } + return h.HubKey +} + +func (h *Hub) GetKey() *string { + if h == nil { + return nil + } + return h.Key +} + +func (h *Hub) GetMetadata() []Metadata { + if h == nil { + return nil + } + return h.Metadata +} + +func (h *Hub) GetMore() *bool { + if h == nil { + return nil + } + return h.More +} + +func (h *Hub) GetPromoted() *bool { + if h == nil { + return nil + } + return h.Promoted +} + +func (h *Hub) GetRandom() *bool { + if h == nil { + return nil + } + return h.Random +} + +func (h *Hub) GetSize() *int64 { + if h == nil { + return nil + } + return h.Size +} + +func (h *Hub) GetStyle() *string { + if h == nil { + return nil + } + return h.Style +} + +func (h *Hub) GetSubtype() *string { + if h == nil { + return nil + } + return h.Subtype +} + +func (h *Hub) GetTotalSize() *int64 { + if h == nil { + return nil + } + return h.TotalSize +} + +func (h *Hub) GetAdditionalProperties() map[string]any { + if h == nil { + return nil + } + return h.AdditionalProperties +} diff --git a/models/components/image.go b/models/components/image.go new file mode 100644 index 0000000..82314d4 --- /dev/null +++ b/models/components/image.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ImageType - Describes both the purpose and intended presentation of the image. +type ImageType string + +const ( + ImageTypeBackground ImageType = "background" + ImageTypeBanner ImageType = "banner" + ImageTypeClearLogo ImageType = "clearLogo" + ImageTypeCoverPoster ImageType = "coverPoster" + ImageTypeSnapshot ImageType = "snapshot" +) + +func (e ImageType) ToPointer() *ImageType { + return &e +} +func (e *ImageType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "background": + fallthrough + case "banner": + fallthrough + case "clearLogo": + fallthrough + case "coverPoster": + fallthrough + case "snapshot": + *e = ImageType(v) + return nil + default: + return fmt.Errorf("invalid value for ImageType: %v", v) + } +} + +// Image - Images such as movie posters and background artwork are represented by Image elements. +type Image struct { + // Describes both the purpose and intended presentation of the image. + Type *ImageType `json:"type,omitempty"` + // Title to use for accessibility. + Alt *string `json:"alt,omitempty"` + // The relative path or absolute url for the image. + URL *string `json:"url,omitempty"` +} + +func (i *Image) GetType() *ImageType { + if i == nil { + return nil + } + return i.Type +} + +func (i *Image) GetAlt() *string { + if i == nil { + return nil + } + return i.Alt +} + +func (i *Image) GetURL() *string { + if i == nil { + return nil + } + return i.URL +} diff --git a/models/components/items.go b/models/components/items.go new file mode 100644 index 0000000..d410bcc --- /dev/null +++ b/models/components/items.go @@ -0,0 +1,635 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +// Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type Items struct { + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []Tag `json:"Country,omitempty"` + Director []Tag `json:"Director,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []Filter `json:"Filter,omitempty"` + Genre []Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + Media []Media `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + MetadataItem []Items `json:"MetadataItem,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (i Items) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *Items) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *Items) GetTitle() any { + if i == nil { + return nil + } + return i.Title +} + +func (i *Items) GetType() any { + if i == nil { + return nil + } + return i.Type +} + +func (i *Items) GetAbsoluteIndex() *int64 { + if i == nil { + return nil + } + return i.AbsoluteIndex +} + +func (i *Items) GetAddedAt() *int64 { + if i == nil { + return nil + } + return i.AddedAt +} + +func (i *Items) GetArt() any { + if i == nil { + return nil + } + return i.Art +} + +func (i *Items) GetAudienceRating() *float64 { + if i == nil { + return nil + } + return i.AudienceRating +} + +func (i *Items) GetAudienceRatingImage() any { + if i == nil { + return nil + } + return i.AudienceRatingImage +} + +func (i *Items) GetAutotag() []Tag { + if i == nil { + return nil + } + return i.Autotag +} + +func (i *Items) GetBanner() any { + if i == nil { + return nil + } + return i.Banner +} + +func (i *Items) GetChapterSource() any { + if i == nil { + return nil + } + return i.ChapterSource +} + +func (i *Items) GetComposite() any { + if i == nil { + return nil + } + return i.Composite +} + +func (i *Items) GetContentRating() any { + if i == nil { + return nil + } + return i.ContentRating +} + +func (i *Items) GetCountry() []Tag { + if i == nil { + return nil + } + return i.Country +} + +func (i *Items) GetDirector() []Tag { + if i == nil { + return nil + } + return i.Director +} + +func (i *Items) GetDuration() *int64 { + if i == nil { + return nil + } + return i.Duration +} + +func (i *Items) GetFilter() []Filter { + if i == nil { + return nil + } + return i.Filter +} + +func (i *Items) GetGenre() []Tag { + if i == nil { + return nil + } + return i.Genre +} + +func (i *Items) GetGrandparentArt() *string { + if i == nil { + return nil + } + return i.GrandparentArt +} + +func (i *Items) GetGrandparentHero() *string { + if i == nil { + return nil + } + return i.GrandparentHero +} + +func (i *Items) GetGrandparentKey() *string { + if i == nil { + return nil + } + return i.GrandparentKey +} + +func (i *Items) GetGrandparentRatingKey() *string { + if i == nil { + return nil + } + return i.GrandparentRatingKey +} + +func (i *Items) GetGrandparentTheme() *string { + if i == nil { + return nil + } + return i.GrandparentTheme +} + +func (i *Items) GetGrandparentThumb() *string { + if i == nil { + return nil + } + return i.GrandparentThumb +} + +func (i *Items) GetGrandparentTitle() *string { + if i == nil { + return nil + } + return i.GrandparentTitle +} + +func (i *Items) GetGUID() []Tag { + if i == nil { + return nil + } + return i.GUID +} + +func (i *Items) GetHero() any { + if i == nil { + return nil + } + return i.Hero +} + +func (i *Items) GetImage() []Image { + if i == nil { + return nil + } + return i.Image +} + +func (i *Items) GetIndex() *int64 { + if i == nil { + return nil + } + return i.Index +} + +func (i *Items) GetKey() any { + if i == nil { + return nil + } + return i.Key +} + +func (i *Items) GetLastViewedAt() *int64 { + if i == nil { + return nil + } + return i.LastViewedAt +} + +func (i *Items) GetLeafCount() *int64 { + if i == nil { + return nil + } + return i.LeafCount +} + +func (i *Items) GetMedia() []Media { + if i == nil { + return nil + } + return i.Media +} + +func (i *Items) GetOriginallyAvailableAt() any { + if i == nil { + return nil + } + return i.OriginallyAvailableAt +} + +func (i *Items) GetOriginalTitle() any { + if i == nil { + return nil + } + return i.OriginalTitle +} + +func (i *Items) GetParentHero() *string { + if i == nil { + return nil + } + return i.ParentHero +} + +func (i *Items) GetParentIndex() *int64 { + if i == nil { + return nil + } + return i.ParentIndex +} + +func (i *Items) GetParentKey() *string { + if i == nil { + return nil + } + return i.ParentKey +} + +func (i *Items) GetParentRatingKey() *string { + if i == nil { + return nil + } + return i.ParentRatingKey +} + +func (i *Items) GetParentThumb() *string { + if i == nil { + return nil + } + return i.ParentThumb +} + +func (i *Items) GetParentTitle() *string { + if i == nil { + return nil + } + return i.ParentTitle +} + +func (i *Items) GetPrimaryExtraKey() any { + if i == nil { + return nil + } + return i.PrimaryExtraKey +} + +func (i *Items) GetPrompt() *string { + if i == nil { + return nil + } + return i.Prompt +} + +func (i *Items) GetRating() *float64 { + if i == nil { + return nil + } + return i.Rating +} + +func (i *Items) GetRatingArray() []Tag { + if i == nil { + return nil + } + return i.RatingArray +} + +func (i *Items) GetRatingCount() *int64 { + if i == nil { + return nil + } + return i.RatingCount +} + +func (i *Items) GetRatingImage() any { + if i == nil { + return nil + } + return i.RatingImage +} + +func (i *Items) GetRatingKey() any { + if i == nil { + return nil + } + return i.RatingKey +} + +func (i *Items) GetRole() []Tag { + if i == nil { + return nil + } + return i.Role +} + +func (i *Items) GetSearch() *bool { + if i == nil { + return nil + } + return i.Search +} + +func (i *Items) GetSecondary() *bool { + if i == nil { + return nil + } + return i.Secondary +} + +func (i *Items) GetSkipChildren() *bool { + if i == nil { + return nil + } + return i.SkipChildren +} + +func (i *Items) GetSkipParent() *bool { + if i == nil { + return nil + } + return i.SkipParent +} + +func (i *Items) GetSort() []Sort { + if i == nil { + return nil + } + return i.Sort +} + +func (i *Items) GetStudio() any { + if i == nil { + return nil + } + return i.Studio +} + +func (i *Items) GetSubtype() any { + if i == nil { + return nil + } + return i.Subtype +} + +func (i *Items) GetSummary() any { + if i == nil { + return nil + } + return i.Summary +} + +func (i *Items) GetTagline() any { + if i == nil { + return nil + } + return i.Tagline +} + +func (i *Items) GetTheme() any { + if i == nil { + return nil + } + return i.Theme +} + +func (i *Items) GetThumb() any { + if i == nil { + return nil + } + return i.Thumb +} + +func (i *Items) GetTitleSort() any { + if i == nil { + return nil + } + return i.TitleSort +} + +func (i *Items) GetUpdatedAt() *int64 { + if i == nil { + return nil + } + return i.UpdatedAt +} + +func (i *Items) GetUserRating() *float64 { + if i == nil { + return nil + } + return i.UserRating +} + +func (i *Items) GetViewCount() *int64 { + if i == nil { + return nil + } + return i.ViewCount +} + +func (i *Items) GetViewedLeafCount() *int64 { + if i == nil { + return nil + } + return i.ViewedLeafCount +} + +func (i *Items) GetViewOffset() *int64 { + if i == nil { + return nil + } + return i.ViewOffset +} + +func (i *Items) GetWriter() []Tag { + if i == nil { + return nil + } + return i.Writer +} + +func (i *Items) GetYear() *int64 { + if i == nil { + return nil + } + return i.Year +} + +func (i *Items) GetMetadataItem() []Items { + if i == nil { + return nil + } + return i.MetadataItem +} + +func (i *Items) GetAdditionalProperties() map[string]any { + if i == nil { + return nil + } + return i.AdditionalProperties +} diff --git a/models/components/librarysection.go b/models/components/librarysection.go new file mode 100644 index 0000000..04bf8ab --- /dev/null +++ b/models/components/librarysection.go @@ -0,0 +1,189 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// LibrarySectionLocation - Represents a top-level location on disk where media in this library section is stored +type LibrarySectionLocation struct { + ID *int64 `json:"id,omitempty"` + // The path of where this directory exists on disk + Path any `json:"path,omitempty"` +} + +func (l *LibrarySectionLocation) GetID() *int64 { + if l == nil { + return nil + } + return l.ID +} + +func (l *LibrarySectionLocation) GetPath() any { + if l == nil { + return nil + } + return l.Path +} + +type LibrarySection struct { + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Agent *string `json:"agent,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Art *string `json:"art,omitempty"` + Composite *string `json:"composite,omitempty"` + Content *bool `json:"content,omitempty"` + ContentChangedAt *int64 `json:"contentChangedAt,omitempty"` + CreatedAt *int64 `json:"createdAt,omitempty"` + Directory *bool `json:"directory,omitempty"` + // Indicates whether this section has filtering capabilities + Filters *bool `json:"filters,omitempty"` + Hidden *bool `json:"hidden,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Location []LibrarySectionLocation `json:"Location,omitempty"` + // Indicates whether this library section is currently scanning + Refreshing *bool `json:"refreshing,omitempty"` + ScannedAt *int64 `json:"scannedAt,omitempty"` + Scanner *string `json:"scanner,omitempty"` + Thumb *string `json:"thumb,omitempty"` + UpdatedAt *int64 `json:"updatedAt,omitempty"` +} + +func (l *LibrarySection) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +func (l *LibrarySection) GetType() *string { + if l == nil { + return nil + } + return l.Type +} + +func (l *LibrarySection) GetAgent() *string { + if l == nil { + return nil + } + return l.Agent +} + +func (l *LibrarySection) GetAllowSync() *bool { + if l == nil { + return nil + } + return l.AllowSync +} + +func (l *LibrarySection) GetArt() *string { + if l == nil { + return nil + } + return l.Art +} + +func (l *LibrarySection) GetComposite() *string { + if l == nil { + return nil + } + return l.Composite +} + +func (l *LibrarySection) GetContent() *bool { + if l == nil { + return nil + } + return l.Content +} + +func (l *LibrarySection) GetContentChangedAt() *int64 { + if l == nil { + return nil + } + return l.ContentChangedAt +} + +func (l *LibrarySection) GetCreatedAt() *int64 { + if l == nil { + return nil + } + return l.CreatedAt +} + +func (l *LibrarySection) GetDirectory() *bool { + if l == nil { + return nil + } + return l.Directory +} + +func (l *LibrarySection) GetFilters() *bool { + if l == nil { + return nil + } + return l.Filters +} + +func (l *LibrarySection) GetHidden() *bool { + if l == nil { + return nil + } + return l.Hidden +} + +func (l *LibrarySection) GetKey() *string { + if l == nil { + return nil + } + return l.Key +} + +func (l *LibrarySection) GetLanguage() *string { + if l == nil { + return nil + } + return l.Language +} + +func (l *LibrarySection) GetLocation() []LibrarySectionLocation { + if l == nil { + return nil + } + return l.Location +} + +func (l *LibrarySection) GetRefreshing() *bool { + if l == nil { + return nil + } + return l.Refreshing +} + +func (l *LibrarySection) GetScannedAt() *int64 { + if l == nil { + return nil + } + return l.ScannedAt +} + +func (l *LibrarySection) GetScanner() *string { + if l == nil { + return nil + } + return l.Scanner +} + +func (l *LibrarySection) GetThumb() *string { + if l == nil { + return nil + } + return l.Thumb +} + +func (l *LibrarySection) GetUpdatedAt() *int64 { + if l == nil { + return nil + } + return l.UpdatedAt +} diff --git a/models/components/lineup.go b/models/components/lineup.go new file mode 100644 index 0000000..c2b1f35 --- /dev/null +++ b/models/components/lineup.go @@ -0,0 +1,104 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// LineupType - - `-1`: N/A +// - `0`: Over the air +// - `1`: Cable +// - `2`: Satellite +// - `3`: IPTV +// - `4`: Virtual +type LineupType int64 + +const ( + LineupTypeMinus1 LineupType = -1 + LineupTypeZero LineupType = 0 + LineupTypeOne LineupType = 1 + LineupTypeTwo LineupType = 2 + LineupTypeThree LineupType = 3 + LineupTypeFour LineupType = 4 +) + +func (e LineupType) ToPointer() *LineupType { + return &e +} +func (e *LineupType) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case -1: + fallthrough + case 0: + fallthrough + case 1: + fallthrough + case 2: + fallthrough + case 3: + fallthrough + case 4: + *e = LineupType(v) + return nil + default: + return fmt.Errorf("invalid value for LineupType: %v", v) + } +} + +type Lineup struct { + Title *string `json:"title,omitempty"` + // The type of this object (`lineup` in this case) + Type *string `json:"type,omitempty"` + // - `-1`: N/A + // - `0`: Over the air + // - `1`: Cable + // - `2`: Satellite + // - `3`: IPTV + // - `4`: Virtual + // + LineupType *LineupType `json:"lineupType,omitempty"` + Location *string `json:"location,omitempty"` + // The uuid of this lineup + UUID *string `json:"uuid,omitempty"` +} + +func (l *Lineup) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +func (l *Lineup) GetType() *string { + if l == nil { + return nil + } + return l.Type +} + +func (l *Lineup) GetLineupType() *LineupType { + if l == nil { + return nil + } + return l.LineupType +} + +func (l *Lineup) GetLocation() *string { + if l == nil { + return nil + } + return l.Location +} + +func (l *Lineup) GetUUID() *string { + if l == nil { + return nil + } + return l.UUID +} diff --git a/models/components/location.go b/models/components/location.go new file mode 100644 index 0000000..5589453 --- /dev/null +++ b/models/components/location.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Location string + +const ( + LocationLan Location = "lan" + LocationWan Location = "wan" + LocationCellular Location = "cellular" +) + +func (e Location) ToPointer() *Location { + return &e +} +func (e *Location) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "lan": + fallthrough + case "wan": + fallthrough + case "cellular": + *e = Location(v) + return nil + default: + return fmt.Errorf("invalid value for Location: %v", v) + } +} diff --git a/models/components/media.go b/models/components/media.go new file mode 100644 index 0000000..7a6d27f --- /dev/null +++ b/models/components/media.go @@ -0,0 +1,174 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +// Media - `Media` represents an one or more media files (parts) and is a child of a metadata item. There aren't necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element. +type Media struct { + AspectRatio *float64 `json:"aspectRatio,omitempty"` + AudioChannels *int64 `json:"audioChannels,omitempty"` + AudioCodec any `json:"audioCodec,omitempty"` + AudioProfile any `json:"audioProfile,omitempty"` + Bitrate *int64 `json:"bitrate,omitempty"` + Container any `json:"container,omitempty"` + Duration *int64 `json:"duration,omitempty"` + Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` + HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` + Height *int64 `json:"height,omitempty"` + ID *int64 `json:"id,omitempty"` + OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` + Part []Part `json:"Part,omitempty"` + VideoCodec any `json:"videoCodec,omitempty"` + VideoFrameRate any `json:"videoFrameRate,omitempty"` + VideoProfile any `json:"videoProfile,omitempty"` + VideoResolution any `json:"videoResolution,omitempty"` + Width *int64 `json:"width,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m Media) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Media) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *Media) GetAspectRatio() *float64 { + if m == nil { + return nil + } + return m.AspectRatio +} + +func (m *Media) GetAudioChannels() *int64 { + if m == nil { + return nil + } + return m.AudioChannels +} + +func (m *Media) GetAudioCodec() any { + if m == nil { + return nil + } + return m.AudioCodec +} + +func (m *Media) GetAudioProfile() any { + if m == nil { + return nil + } + return m.AudioProfile +} + +func (m *Media) GetBitrate() *int64 { + if m == nil { + return nil + } + return m.Bitrate +} + +func (m *Media) GetContainer() any { + if m == nil { + return nil + } + return m.Container +} + +func (m *Media) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *Media) GetHas64bitOffsets() *bool { + if m == nil { + return nil + } + return m.Has64bitOffsets +} + +func (m *Media) GetHasVoiceActivity() *bool { + if m == nil { + return nil + } + return m.HasVoiceActivity +} + +func (m *Media) GetHeight() *int64 { + if m == nil { + return nil + } + return m.Height +} + +func (m *Media) GetID() *int64 { + if m == nil { + return nil + } + return m.ID +} + +func (m *Media) GetOptimizedForStreaming() *bool { + if m == nil { + return nil + } + return m.OptimizedForStreaming +} + +func (m *Media) GetPart() []Part { + if m == nil { + return nil + } + return m.Part +} + +func (m *Media) GetVideoCodec() any { + if m == nil { + return nil + } + return m.VideoCodec +} + +func (m *Media) GetVideoFrameRate() any { + if m == nil { + return nil + } + return m.VideoFrameRate +} + +func (m *Media) GetVideoProfile() any { + if m == nil { + return nil + } + return m.VideoProfile +} + +func (m *Media) GetVideoResolution() any { + if m == nil { + return nil + } + return m.VideoResolution +} + +func (m *Media) GetWidth() *int64 { + if m == nil { + return nil + } + return m.Width +} + +func (m *Media) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} diff --git a/models/components/mediacontainer.go b/models/components/mediacontainer.go new file mode 100644 index 0000000..483e5a6 --- /dev/null +++ b/models/components/mediacontainer.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` +} + +func (m *MediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} diff --git a/models/components/mediacontainerwithartwork.go b/models/components/mediacontainerwithartwork.go new file mode 100644 index 0000000..0f89872 --- /dev/null +++ b/models/components/mediacontainerwithartwork.go @@ -0,0 +1,141 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" +) + +type MediaContainerWithArtworkType string + +const ( + MediaContainerWithArtworkTypeImage MediaContainerWithArtworkType = "image" +) + +func (e MediaContainerWithArtworkType) ToPointer() *MediaContainerWithArtworkType { + return &e +} +func (e *MediaContainerWithArtworkType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "image": + *e = MediaContainerWithArtworkType(v) + return nil + default: + return fmt.Errorf("invalid value for MediaContainerWithArtworkType: %v", v) + } +} + +type MediaContainerWithArtworkMetadata struct { + // The title of the item + Title *string `json:"title,omitempty"` + Type *MediaContainerWithArtworkType `json:"type,omitempty"` + // The path to the artwork + Key *string `json:"key,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MediaContainerWithArtworkMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MediaContainerWithArtworkMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MediaContainerWithArtworkMetadata) GetTitle() *string { + if m == nil { + return nil + } + return m.Title +} + +func (m *MediaContainerWithArtworkMetadata) GetType() *MediaContainerWithArtworkType { + if m == nil { + return nil + } + return m.Type +} + +func (m *MediaContainerWithArtworkMetadata) GetKey() *string { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaContainerWithArtworkMetadata) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// MediaContainerWithArtworkMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithArtworkMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata []MediaContainerWithArtworkMetadata `json:"Metadata,omitempty"` +} + +func (m *MediaContainerWithArtworkMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithArtworkMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithArtworkMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithArtworkMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithArtworkMediaContainer) GetMetadata() []MediaContainerWithArtworkMetadata { + if m == nil { + return nil + } + return m.Metadata +} + +type MediaContainerWithArtwork struct { + MediaContainer *MediaContainerWithArtworkMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithArtwork) GetMediaContainer() *MediaContainerWithArtworkMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithdecision.go b/models/components/mediacontainerwithdecision.go new file mode 100644 index 0000000..5dd0345 --- /dev/null +++ b/models/components/mediacontainerwithdecision.go @@ -0,0 +1,1481 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" +) + +type MediaContainerWithDecisionDecision string + +const ( + MediaContainerWithDecisionDecisionCopy MediaContainerWithDecisionDecision = "copy" + MediaContainerWithDecisionDecisionTranscode MediaContainerWithDecisionDecision = "transcode" + MediaContainerWithDecisionDecisionBurn MediaContainerWithDecisionDecision = "burn" + MediaContainerWithDecisionDecisionUnavailable MediaContainerWithDecisionDecision = "unavailable" + MediaContainerWithDecisionDecisionIgnore MediaContainerWithDecisionDecision = "ignore" + MediaContainerWithDecisionDecisionNone MediaContainerWithDecisionDecision = "none" +) + +func (e MediaContainerWithDecisionDecision) ToPointer() *MediaContainerWithDecisionDecision { + return &e +} +func (e *MediaContainerWithDecisionDecision) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "copy": + fallthrough + case "transcode": + fallthrough + case "burn": + fallthrough + case "unavailable": + fallthrough + case "ignore": + fallthrough + case "none": + *e = MediaContainerWithDecisionDecision(v) + return nil + default: + return fmt.Errorf("invalid value for MediaContainerWithDecisionDecision: %v", v) + } +} + +type MediaContainerWithDecisionLocation string + +const ( + MediaContainerWithDecisionLocationDirect MediaContainerWithDecisionLocation = "direct" + MediaContainerWithDecisionLocationSidecarSubs MediaContainerWithDecisionLocation = "sidecar-subs" + MediaContainerWithDecisionLocationSegmentsVideo MediaContainerWithDecisionLocation = "segments-video" + MediaContainerWithDecisionLocationSegmentsAudio MediaContainerWithDecisionLocation = "segments-audio" + MediaContainerWithDecisionLocationSegmentsAv MediaContainerWithDecisionLocation = "segments-av" + MediaContainerWithDecisionLocationSegmentsSubs MediaContainerWithDecisionLocation = "segments-subs" + MediaContainerWithDecisionLocationEmbedded MediaContainerWithDecisionLocation = "embedded" + MediaContainerWithDecisionLocationSidecar MediaContainerWithDecisionLocation = "sidecar" +) + +func (e MediaContainerWithDecisionLocation) ToPointer() *MediaContainerWithDecisionLocation { + return &e +} +func (e *MediaContainerWithDecisionLocation) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "direct": + fallthrough + case "sidecar-subs": + fallthrough + case "segments-video": + fallthrough + case "segments-audio": + fallthrough + case "segments-av": + fallthrough + case "segments-subs": + fallthrough + case "embedded": + fallthrough + case "sidecar": + *e = MediaContainerWithDecisionLocation(v) + return nil + default: + return fmt.Errorf("invalid value for MediaContainerWithDecisionLocation: %v", v) + } +} + +// MediaContainerWithDecisionStream - `Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream. Note that photos do not have streams (mostly as an optimization). +type MediaContainerWithDecisionStream struct { + Default *bool `json:"default,omitempty"` + AudioChannelLayout any `json:"audioChannelLayout,omitempty"` + BitDepth *int64 `json:"bitDepth,omitempty"` + Bitrate *int64 `json:"bitrate,omitempty"` + // For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video. + CanAutoSync *bool `json:"canAutoSync,omitempty"` + ChromaLocation any `json:"chromaLocation,omitempty"` + ChromaSubsampling any `json:"chromaSubsampling,omitempty"` + // The codec of the stream, such as `h264` or `aac` + Codec any `json:"codec,omitempty"` + ColorPrimaries any `json:"colorPrimaries,omitempty"` + ColorRange any `json:"colorRange,omitempty"` + ColorSpace any `json:"colorSpace,omitempty"` + ColorTrc any `json:"colorTrc,omitempty"` + // A friendly name for the stream, often comprised of the language and codec information + DisplayTitle any `json:"displayTitle,omitempty"` + FrameRate *float64 `json:"frameRate,omitempty"` + HasScalingMatrix any `json:"hasScalingMatrix,omitempty"` + Height *int64 `json:"height,omitempty"` + ID *int64 `json:"id,omitempty"` + // If the stream is part of the `Part` and not an external resource, the index of the stream within that part + Index *int64 `json:"index,omitempty"` + // If the stream is independently streamable, the key from which it can be streamed + Key any `json:"key,omitempty"` + Language any `json:"language,omitempty"` + // The three character language code for the stream contents + LanguageCode any `json:"languageCode,omitempty"` + Level *int64 `json:"level,omitempty"` + Profile any `json:"profile,omitempty"` + RefFrames *int64 `json:"refFrames,omitempty"` + SamplingRate *int64 `json:"samplingRate,omitempty"` + Selected *bool `json:"selected,omitempty"` + StreamIdentifier *int64 `json:"streamIdentifier,omitempty"` + // A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics + StreamType *int64 `json:"streamType,omitempty"` + Width *int64 `json:"width,omitempty"` + Decision *MediaContainerWithDecisionDecision `json:"decision,omitempty"` + Location *MediaContainerWithDecisionLocation `json:"location,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MediaContainerWithDecisionStream) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MediaContainerWithDecisionStream) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MediaContainerWithDecisionStream) GetDefault() *bool { + if m == nil { + return nil + } + return m.Default +} + +func (m *MediaContainerWithDecisionStream) GetAudioChannelLayout() any { + if m == nil { + return nil + } + return m.AudioChannelLayout +} + +func (m *MediaContainerWithDecisionStream) GetBitDepth() *int64 { + if m == nil { + return nil + } + return m.BitDepth +} + +func (m *MediaContainerWithDecisionStream) GetBitrate() *int64 { + if m == nil { + return nil + } + return m.Bitrate +} + +func (m *MediaContainerWithDecisionStream) GetCanAutoSync() *bool { + if m == nil { + return nil + } + return m.CanAutoSync +} + +func (m *MediaContainerWithDecisionStream) GetChromaLocation() any { + if m == nil { + return nil + } + return m.ChromaLocation +} + +func (m *MediaContainerWithDecisionStream) GetChromaSubsampling() any { + if m == nil { + return nil + } + return m.ChromaSubsampling +} + +func (m *MediaContainerWithDecisionStream) GetCodec() any { + if m == nil { + return nil + } + return m.Codec +} + +func (m *MediaContainerWithDecisionStream) GetColorPrimaries() any { + if m == nil { + return nil + } + return m.ColorPrimaries +} + +func (m *MediaContainerWithDecisionStream) GetColorRange() any { + if m == nil { + return nil + } + return m.ColorRange +} + +func (m *MediaContainerWithDecisionStream) GetColorSpace() any { + if m == nil { + return nil + } + return m.ColorSpace +} + +func (m *MediaContainerWithDecisionStream) GetColorTrc() any { + if m == nil { + return nil + } + return m.ColorTrc +} + +func (m *MediaContainerWithDecisionStream) GetDisplayTitle() any { + if m == nil { + return nil + } + return m.DisplayTitle +} + +func (m *MediaContainerWithDecisionStream) GetFrameRate() *float64 { + if m == nil { + return nil + } + return m.FrameRate +} + +func (m *MediaContainerWithDecisionStream) GetHasScalingMatrix() any { + if m == nil { + return nil + } + return m.HasScalingMatrix +} + +func (m *MediaContainerWithDecisionStream) GetHeight() *int64 { + if m == nil { + return nil + } + return m.Height +} + +func (m *MediaContainerWithDecisionStream) GetID() *int64 { + if m == nil { + return nil + } + return m.ID +} + +func (m *MediaContainerWithDecisionStream) GetIndex() *int64 { + if m == nil { + return nil + } + return m.Index +} + +func (m *MediaContainerWithDecisionStream) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaContainerWithDecisionStream) GetLanguage() any { + if m == nil { + return nil + } + return m.Language +} + +func (m *MediaContainerWithDecisionStream) GetLanguageCode() any { + if m == nil { + return nil + } + return m.LanguageCode +} + +func (m *MediaContainerWithDecisionStream) GetLevel() *int64 { + if m == nil { + return nil + } + return m.Level +} + +func (m *MediaContainerWithDecisionStream) GetProfile() any { + if m == nil { + return nil + } + return m.Profile +} + +func (m *MediaContainerWithDecisionStream) GetRefFrames() *int64 { + if m == nil { + return nil + } + return m.RefFrames +} + +func (m *MediaContainerWithDecisionStream) GetSamplingRate() *int64 { + if m == nil { + return nil + } + return m.SamplingRate +} + +func (m *MediaContainerWithDecisionStream) GetSelected() *bool { + if m == nil { + return nil + } + return m.Selected +} + +func (m *MediaContainerWithDecisionStream) GetStreamIdentifier() *int64 { + if m == nil { + return nil + } + return m.StreamIdentifier +} + +func (m *MediaContainerWithDecisionStream) GetStreamType() *int64 { + if m == nil { + return nil + } + return m.StreamType +} + +func (m *MediaContainerWithDecisionStream) GetWidth() *int64 { + if m == nil { + return nil + } + return m.Width +} + +func (m *MediaContainerWithDecisionStream) GetDecision() *MediaContainerWithDecisionDecision { + if m == nil { + return nil + } + return m.Decision +} + +func (m *MediaContainerWithDecisionStream) GetLocation() *MediaContainerWithDecisionLocation { + if m == nil { + return nil + } + return m.Location +} + +func (m *MediaContainerWithDecisionStream) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +type Decision string + +const ( + DecisionDirectplay Decision = "directplay" + DecisionTranscode Decision = "transcode" + DecisionNone Decision = "none" +) + +func (e Decision) ToPointer() *Decision { + return &e +} +func (e *Decision) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "directplay": + fallthrough + case "transcode": + fallthrough + case "none": + *e = Decision(v) + return nil + default: + return fmt.Errorf("invalid value for Decision: %v", v) + } +} + +// MediaContainerWithDecisionPart - `Part` represents a particular file or "part" of a media item. The part is the playable unit of the media hierarchy. Suppose that a movie library contains a movie that is broken up into files, reminiscent of a movie split across two BDs. The metadata item represents information about the movie, the media item represents this instance of the movie at this resolution and quality, and the part items represent the two playable files. If another media were added which contained the joining of these two parts transcoded down to a lower resolution, then this metadata would contain 2 medias, one with 2 parts and one with 1 part. +type MediaContainerWithDecisionPart struct { + AudioProfile any `json:"audioProfile,omitempty"` + // The container of the media file, such as `mp4` or `mkv` + Container any `json:"container,omitempty"` + // The duration of the media item, in milliseconds + Duration *int64 `json:"duration,omitempty"` + // The local file path at which the part is stored on the server + File any `json:"file,omitempty"` + Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` + ID *int64 `json:"id,omitempty"` + // The key from which the media can be streamed + Key any `json:"key,omitempty"` + OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` + // The size of the media, in bytes + Size *int64 `json:"size,omitempty"` + Stream []MediaContainerWithDecisionStream `json:"Stream,omitempty"` + VideoProfile any `json:"videoProfile,omitempty"` + Decision *Decision `json:"decision,omitempty"` + Selected *bool `json:"selected,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MediaContainerWithDecisionPart) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MediaContainerWithDecisionPart) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MediaContainerWithDecisionPart) GetAudioProfile() any { + if m == nil { + return nil + } + return m.AudioProfile +} + +func (m *MediaContainerWithDecisionPart) GetContainer() any { + if m == nil { + return nil + } + return m.Container +} + +func (m *MediaContainerWithDecisionPart) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *MediaContainerWithDecisionPart) GetFile() any { + if m == nil { + return nil + } + return m.File +} + +func (m *MediaContainerWithDecisionPart) GetHas64bitOffsets() *bool { + if m == nil { + return nil + } + return m.Has64bitOffsets +} + +func (m *MediaContainerWithDecisionPart) GetID() *int64 { + if m == nil { + return nil + } + return m.ID +} + +func (m *MediaContainerWithDecisionPart) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaContainerWithDecisionPart) GetOptimizedForStreaming() *bool { + if m == nil { + return nil + } + return m.OptimizedForStreaming +} + +func (m *MediaContainerWithDecisionPart) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithDecisionPart) GetStream() []MediaContainerWithDecisionStream { + if m == nil { + return nil + } + return m.Stream +} + +func (m *MediaContainerWithDecisionPart) GetVideoProfile() any { + if m == nil { + return nil + } + return m.VideoProfile +} + +func (m *MediaContainerWithDecisionPart) GetDecision() *Decision { + if m == nil { + return nil + } + return m.Decision +} + +func (m *MediaContainerWithDecisionPart) GetSelected() *bool { + if m == nil { + return nil + } + return m.Selected +} + +func (m *MediaContainerWithDecisionPart) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// MediaContainerWithDecisionMedia - `Media` represents an one or more media files (parts) and is a child of a metadata item. There aren't necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element. +type MediaContainerWithDecisionMedia struct { + AspectRatio *float64 `json:"aspectRatio,omitempty"` + AudioChannels *int64 `json:"audioChannels,omitempty"` + AudioCodec any `json:"audioCodec,omitempty"` + AudioProfile any `json:"audioProfile,omitempty"` + Bitrate *int64 `json:"bitrate,omitempty"` + Container any `json:"container,omitempty"` + Duration *int64 `json:"duration,omitempty"` + Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` + HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` + Height *int64 `json:"height,omitempty"` + ID *int64 `json:"id,omitempty"` + OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` + Part []MediaContainerWithDecisionPart `json:"Part,omitempty"` + VideoCodec any `json:"videoCodec,omitempty"` + VideoFrameRate any `json:"videoFrameRate,omitempty"` + VideoProfile any `json:"videoProfile,omitempty"` + VideoResolution any `json:"videoResolution,omitempty"` + Width *int64 `json:"width,omitempty"` + Abr *bool `json:"abr,omitempty"` + ResourceSession *string `json:"resourceSession,omitempty"` + Selected *bool `json:"selected,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MediaContainerWithDecisionMedia) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MediaContainerWithDecisionMedia) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MediaContainerWithDecisionMedia) GetAspectRatio() *float64 { + if m == nil { + return nil + } + return m.AspectRatio +} + +func (m *MediaContainerWithDecisionMedia) GetAudioChannels() *int64 { + if m == nil { + return nil + } + return m.AudioChannels +} + +func (m *MediaContainerWithDecisionMedia) GetAudioCodec() any { + if m == nil { + return nil + } + return m.AudioCodec +} + +func (m *MediaContainerWithDecisionMedia) GetAudioProfile() any { + if m == nil { + return nil + } + return m.AudioProfile +} + +func (m *MediaContainerWithDecisionMedia) GetBitrate() *int64 { + if m == nil { + return nil + } + return m.Bitrate +} + +func (m *MediaContainerWithDecisionMedia) GetContainer() any { + if m == nil { + return nil + } + return m.Container +} + +func (m *MediaContainerWithDecisionMedia) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *MediaContainerWithDecisionMedia) GetHas64bitOffsets() *bool { + if m == nil { + return nil + } + return m.Has64bitOffsets +} + +func (m *MediaContainerWithDecisionMedia) GetHasVoiceActivity() *bool { + if m == nil { + return nil + } + return m.HasVoiceActivity +} + +func (m *MediaContainerWithDecisionMedia) GetHeight() *int64 { + if m == nil { + return nil + } + return m.Height +} + +func (m *MediaContainerWithDecisionMedia) GetID() *int64 { + if m == nil { + return nil + } + return m.ID +} + +func (m *MediaContainerWithDecisionMedia) GetOptimizedForStreaming() *bool { + if m == nil { + return nil + } + return m.OptimizedForStreaming +} + +func (m *MediaContainerWithDecisionMedia) GetPart() []MediaContainerWithDecisionPart { + if m == nil { + return nil + } + return m.Part +} + +func (m *MediaContainerWithDecisionMedia) GetVideoCodec() any { + if m == nil { + return nil + } + return m.VideoCodec +} + +func (m *MediaContainerWithDecisionMedia) GetVideoFrameRate() any { + if m == nil { + return nil + } + return m.VideoFrameRate +} + +func (m *MediaContainerWithDecisionMedia) GetVideoProfile() any { + if m == nil { + return nil + } + return m.VideoProfile +} + +func (m *MediaContainerWithDecisionMedia) GetVideoResolution() any { + if m == nil { + return nil + } + return m.VideoResolution +} + +func (m *MediaContainerWithDecisionMedia) GetWidth() *int64 { + if m == nil { + return nil + } + return m.Width +} + +func (m *MediaContainerWithDecisionMedia) GetAbr() *bool { + if m == nil { + return nil + } + return m.Abr +} + +func (m *MediaContainerWithDecisionMedia) GetResourceSession() *string { + if m == nil { + return nil + } + return m.ResourceSession +} + +func (m *MediaContainerWithDecisionMedia) GetSelected() *bool { + if m == nil { + return nil + } + return m.Selected +} + +func (m *MediaContainerWithDecisionMedia) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// MediaContainerWithDecisionMetadata - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type MediaContainerWithDecisionMetadata struct { + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []Tag `json:"Country,omitempty"` + Director []Tag `json:"Director,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []Filter `json:"Filter,omitempty"` + Genre []Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + Media []MediaContainerWithDecisionMedia `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MediaContainerWithDecisionMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MediaContainerWithDecisionMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MediaContainerWithDecisionMetadata) GetTitle() any { + if m == nil { + return nil + } + return m.Title +} + +func (m *MediaContainerWithDecisionMetadata) GetType() any { + if m == nil { + return nil + } + return m.Type +} + +func (m *MediaContainerWithDecisionMetadata) GetAbsoluteIndex() *int64 { + if m == nil { + return nil + } + return m.AbsoluteIndex +} + +func (m *MediaContainerWithDecisionMetadata) GetAddedAt() *int64 { + if m == nil { + return nil + } + return m.AddedAt +} + +func (m *MediaContainerWithDecisionMetadata) GetArt() any { + if m == nil { + return nil + } + return m.Art +} + +func (m *MediaContainerWithDecisionMetadata) GetAudienceRating() *float64 { + if m == nil { + return nil + } + return m.AudienceRating +} + +func (m *MediaContainerWithDecisionMetadata) GetAudienceRatingImage() any { + if m == nil { + return nil + } + return m.AudienceRatingImage +} + +func (m *MediaContainerWithDecisionMetadata) GetAutotag() []Tag { + if m == nil { + return nil + } + return m.Autotag +} + +func (m *MediaContainerWithDecisionMetadata) GetBanner() any { + if m == nil { + return nil + } + return m.Banner +} + +func (m *MediaContainerWithDecisionMetadata) GetChapterSource() any { + if m == nil { + return nil + } + return m.ChapterSource +} + +func (m *MediaContainerWithDecisionMetadata) GetComposite() any { + if m == nil { + return nil + } + return m.Composite +} + +func (m *MediaContainerWithDecisionMetadata) GetContentRating() any { + if m == nil { + return nil + } + return m.ContentRating +} + +func (m *MediaContainerWithDecisionMetadata) GetCountry() []Tag { + if m == nil { + return nil + } + return m.Country +} + +func (m *MediaContainerWithDecisionMetadata) GetDirector() []Tag { + if m == nil { + return nil + } + return m.Director +} + +func (m *MediaContainerWithDecisionMetadata) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *MediaContainerWithDecisionMetadata) GetFilter() []Filter { + if m == nil { + return nil + } + return m.Filter +} + +func (m *MediaContainerWithDecisionMetadata) GetGenre() []Tag { + if m == nil { + return nil + } + return m.Genre +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentArt() *string { + if m == nil { + return nil + } + return m.GrandparentArt +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentHero() *string { + if m == nil { + return nil + } + return m.GrandparentHero +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentKey() *string { + if m == nil { + return nil + } + return m.GrandparentKey +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentRatingKey() *string { + if m == nil { + return nil + } + return m.GrandparentRatingKey +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentTheme() *string { + if m == nil { + return nil + } + return m.GrandparentTheme +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentThumb() *string { + if m == nil { + return nil + } + return m.GrandparentThumb +} + +func (m *MediaContainerWithDecisionMetadata) GetGrandparentTitle() *string { + if m == nil { + return nil + } + return m.GrandparentTitle +} + +func (m *MediaContainerWithDecisionMetadata) GetGUID() []Tag { + if m == nil { + return nil + } + return m.GUID +} + +func (m *MediaContainerWithDecisionMetadata) GetHero() any { + if m == nil { + return nil + } + return m.Hero +} + +func (m *MediaContainerWithDecisionMetadata) GetImage() []Image { + if m == nil { + return nil + } + return m.Image +} + +func (m *MediaContainerWithDecisionMetadata) GetIndex() *int64 { + if m == nil { + return nil + } + return m.Index +} + +func (m *MediaContainerWithDecisionMetadata) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaContainerWithDecisionMetadata) GetLastViewedAt() *int64 { + if m == nil { + return nil + } + return m.LastViewedAt +} + +func (m *MediaContainerWithDecisionMetadata) GetLeafCount() *int64 { + if m == nil { + return nil + } + return m.LeafCount +} + +func (m *MediaContainerWithDecisionMetadata) GetMedia() []MediaContainerWithDecisionMedia { + if m == nil { + return nil + } + return m.Media +} + +func (m *MediaContainerWithDecisionMetadata) GetOriginallyAvailableAt() any { + if m == nil { + return nil + } + return m.OriginallyAvailableAt +} + +func (m *MediaContainerWithDecisionMetadata) GetOriginalTitle() any { + if m == nil { + return nil + } + return m.OriginalTitle +} + +func (m *MediaContainerWithDecisionMetadata) GetParentHero() *string { + if m == nil { + return nil + } + return m.ParentHero +} + +func (m *MediaContainerWithDecisionMetadata) GetParentIndex() *int64 { + if m == nil { + return nil + } + return m.ParentIndex +} + +func (m *MediaContainerWithDecisionMetadata) GetParentKey() *string { + if m == nil { + return nil + } + return m.ParentKey +} + +func (m *MediaContainerWithDecisionMetadata) GetParentRatingKey() *string { + if m == nil { + return nil + } + return m.ParentRatingKey +} + +func (m *MediaContainerWithDecisionMetadata) GetParentThumb() *string { + if m == nil { + return nil + } + return m.ParentThumb +} + +func (m *MediaContainerWithDecisionMetadata) GetParentTitle() *string { + if m == nil { + return nil + } + return m.ParentTitle +} + +func (m *MediaContainerWithDecisionMetadata) GetPrimaryExtraKey() any { + if m == nil { + return nil + } + return m.PrimaryExtraKey +} + +func (m *MediaContainerWithDecisionMetadata) GetPrompt() *string { + if m == nil { + return nil + } + return m.Prompt +} + +func (m *MediaContainerWithDecisionMetadata) GetRating() *float64 { + if m == nil { + return nil + } + return m.Rating +} + +func (m *MediaContainerWithDecisionMetadata) GetRatingArray() []Tag { + if m == nil { + return nil + } + return m.RatingArray +} + +func (m *MediaContainerWithDecisionMetadata) GetRatingCount() *int64 { + if m == nil { + return nil + } + return m.RatingCount +} + +func (m *MediaContainerWithDecisionMetadata) GetRatingImage() any { + if m == nil { + return nil + } + return m.RatingImage +} + +func (m *MediaContainerWithDecisionMetadata) GetRatingKey() any { + if m == nil { + return nil + } + return m.RatingKey +} + +func (m *MediaContainerWithDecisionMetadata) GetRole() []Tag { + if m == nil { + return nil + } + return m.Role +} + +func (m *MediaContainerWithDecisionMetadata) GetSearch() *bool { + if m == nil { + return nil + } + return m.Search +} + +func (m *MediaContainerWithDecisionMetadata) GetSecondary() *bool { + if m == nil { + return nil + } + return m.Secondary +} + +func (m *MediaContainerWithDecisionMetadata) GetSkipChildren() *bool { + if m == nil { + return nil + } + return m.SkipChildren +} + +func (m *MediaContainerWithDecisionMetadata) GetSkipParent() *bool { + if m == nil { + return nil + } + return m.SkipParent +} + +func (m *MediaContainerWithDecisionMetadata) GetSort() []Sort { + if m == nil { + return nil + } + return m.Sort +} + +func (m *MediaContainerWithDecisionMetadata) GetStudio() any { + if m == nil { + return nil + } + return m.Studio +} + +func (m *MediaContainerWithDecisionMetadata) GetSubtype() any { + if m == nil { + return nil + } + return m.Subtype +} + +func (m *MediaContainerWithDecisionMetadata) GetSummary() any { + if m == nil { + return nil + } + return m.Summary +} + +func (m *MediaContainerWithDecisionMetadata) GetTagline() any { + if m == nil { + return nil + } + return m.Tagline +} + +func (m *MediaContainerWithDecisionMetadata) GetTheme() any { + if m == nil { + return nil + } + return m.Theme +} + +func (m *MediaContainerWithDecisionMetadata) GetThumb() any { + if m == nil { + return nil + } + return m.Thumb +} + +func (m *MediaContainerWithDecisionMetadata) GetTitleSort() any { + if m == nil { + return nil + } + return m.TitleSort +} + +func (m *MediaContainerWithDecisionMetadata) GetUpdatedAt() *int64 { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *MediaContainerWithDecisionMetadata) GetUserRating() *float64 { + if m == nil { + return nil + } + return m.UserRating +} + +func (m *MediaContainerWithDecisionMetadata) GetViewCount() *int64 { + if m == nil { + return nil + } + return m.ViewCount +} + +func (m *MediaContainerWithDecisionMetadata) GetViewedLeafCount() *int64 { + if m == nil { + return nil + } + return m.ViewedLeafCount +} + +func (m *MediaContainerWithDecisionMetadata) GetViewOffset() *int64 { + if m == nil { + return nil + } + return m.ViewOffset +} + +func (m *MediaContainerWithDecisionMetadata) GetWriter() []Tag { + if m == nil { + return nil + } + return m.Writer +} + +func (m *MediaContainerWithDecisionMetadata) GetYear() *int64 { + if m == nil { + return nil + } + return m.Year +} + +func (m *MediaContainerWithDecisionMetadata) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// MediaContainerWithDecisionMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithDecisionMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // The maximum available bitrate when the decision was rendered. + AvailableBandwidth *int64 `json:"availableBandwidth,omitempty"` + DirectPlayDecisionCode *int64 `json:"directPlayDecisionCode,omitempty"` + DirectPlayDecisionText *string `json:"directPlayDecisionText,omitempty"` + // The overall decision. 1xxx are playback can succeed, 2xxx are a general error (such as insufficient bandwidth), 3xxx are errors in direct play, and 4xxx are errors in transcodes. Same codes are used in all. + GeneralDecisionCode *int64 `json:"generalDecisionCode,omitempty"` + GeneralDecisionText *string `json:"generalDecisionText,omitempty"` + // The code indicating the status of evaluation of playback when client indicates `hasMDE=1` + MdeDecisionCode *int64 `json:"mdeDecisionCode,omitempty"` + // Descriptive text for the above code + MdeDecisionText *string `json:"mdeDecisionText,omitempty"` + Metadata []MediaContainerWithDecisionMetadata `json:"Metadata,omitempty"` + TranscodeDecisionCode *int64 `json:"transcodeDecisionCode,omitempty"` + TranscodeDecisionText *string `json:"transcodeDecisionText,omitempty"` +} + +func (m *MediaContainerWithDecisionMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithDecisionMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithDecisionMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithDecisionMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithDecisionMediaContainer) GetAvailableBandwidth() *int64 { + if m == nil { + return nil + } + return m.AvailableBandwidth +} + +func (m *MediaContainerWithDecisionMediaContainer) GetDirectPlayDecisionCode() *int64 { + if m == nil { + return nil + } + return m.DirectPlayDecisionCode +} + +func (m *MediaContainerWithDecisionMediaContainer) GetDirectPlayDecisionText() *string { + if m == nil { + return nil + } + return m.DirectPlayDecisionText +} + +func (m *MediaContainerWithDecisionMediaContainer) GetGeneralDecisionCode() *int64 { + if m == nil { + return nil + } + return m.GeneralDecisionCode +} + +func (m *MediaContainerWithDecisionMediaContainer) GetGeneralDecisionText() *string { + if m == nil { + return nil + } + return m.GeneralDecisionText +} + +func (m *MediaContainerWithDecisionMediaContainer) GetMdeDecisionCode() *int64 { + if m == nil { + return nil + } + return m.MdeDecisionCode +} + +func (m *MediaContainerWithDecisionMediaContainer) GetMdeDecisionText() *string { + if m == nil { + return nil + } + return m.MdeDecisionText +} + +func (m *MediaContainerWithDecisionMediaContainer) GetMetadata() []MediaContainerWithDecisionMetadata { + if m == nil { + return nil + } + return m.Metadata +} + +func (m *MediaContainerWithDecisionMediaContainer) GetTranscodeDecisionCode() *int64 { + if m == nil { + return nil + } + return m.TranscodeDecisionCode +} + +func (m *MediaContainerWithDecisionMediaContainer) GetTranscodeDecisionText() *string { + if m == nil { + return nil + } + return m.TranscodeDecisionText +} + +// MediaContainerWithDecision - `MediaContainer` is commonly found as the root of a response and is a pretty generic container. Common attributes include `identifier` and things related to paging (`offset`, `size`, `totalSize`). +// +// It is also common for a `MediaContainer` to contain attributes "hoisted" from its children. If every element in the container would have had the same attribute, then that attribute can be present on the container instead of being repeated on every element. For example, an album's list of tracks might include `parentTitle` on the container since all of the tracks have the same album title. A container may have a `source` attribute when all of the items came from the same source. Generally speaking, when looking for an attribute on an item, if the attribute wasn't found then the container should be checked for that attribute as well. +type MediaContainerWithDecision struct { + MediaContainer *MediaContainerWithDecisionMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithDecision) GetMediaContainer() *MediaContainerWithDecisionMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithdevice.go b/models/components/mediacontainerwithdevice.go new file mode 100644 index 0000000..f5e353f --- /dev/null +++ b/models/components/mediacontainerwithdevice.go @@ -0,0 +1,171 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type MediaContainerWithDeviceDevice struct { + ChannelMapping []ChannelMapping `json:"ChannelMapping,omitempty"` + Key *string `json:"key,omitempty"` + LastSeenAt *int64 `json:"lastSeenAt,omitempty"` + Make *string `json:"make,omitempty"` + Model *string `json:"model,omitempty"` + ModelNumber *string `json:"modelNumber,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Sources *string `json:"sources,omitempty"` + State *string `json:"state,omitempty"` + Status *string `json:"status,omitempty"` + Tuners *string `json:"tuners,omitempty"` + URI *string `json:"uri,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (m *MediaContainerWithDeviceDevice) GetChannelMapping() []ChannelMapping { + if m == nil { + return nil + } + return m.ChannelMapping +} + +func (m *MediaContainerWithDeviceDevice) GetKey() *string { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaContainerWithDeviceDevice) GetLastSeenAt() *int64 { + if m == nil { + return nil + } + return m.LastSeenAt +} + +func (m *MediaContainerWithDeviceDevice) GetMake() *string { + if m == nil { + return nil + } + return m.Make +} + +func (m *MediaContainerWithDeviceDevice) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MediaContainerWithDeviceDevice) GetModelNumber() *string { + if m == nil { + return nil + } + return m.ModelNumber +} + +func (m *MediaContainerWithDeviceDevice) GetProtocol() *string { + if m == nil { + return nil + } + return m.Protocol +} + +func (m *MediaContainerWithDeviceDevice) GetSources() *string { + if m == nil { + return nil + } + return m.Sources +} + +func (m *MediaContainerWithDeviceDevice) GetState() *string { + if m == nil { + return nil + } + return m.State +} + +func (m *MediaContainerWithDeviceDevice) GetStatus() *string { + if m == nil { + return nil + } + return m.Status +} + +func (m *MediaContainerWithDeviceDevice) GetTuners() *string { + if m == nil { + return nil + } + return m.Tuners +} + +func (m *MediaContainerWithDeviceDevice) GetURI() *string { + if m == nil { + return nil + } + return m.URI +} + +func (m *MediaContainerWithDeviceDevice) GetUUID() *string { + if m == nil { + return nil + } + return m.UUID +} + +// MediaContainerWithDeviceMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithDeviceMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Device []MediaContainerWithDeviceDevice `json:"Device,omitempty"` +} + +func (m *MediaContainerWithDeviceMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithDeviceMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithDeviceMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithDeviceMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithDeviceMediaContainer) GetDevice() []MediaContainerWithDeviceDevice { + if m == nil { + return nil + } + return m.Device +} + +type MediaContainerWithDevice struct { + MediaContainer *MediaContainerWithDeviceMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithDevice) GetMediaContainer() *MediaContainerWithDeviceMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithdirectory.go b/models/components/mediacontainerwithdirectory.go new file mode 100644 index 0000000..e60eb0f --- /dev/null +++ b/models/components/mediacontainerwithdirectory.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainerWithDirectoryMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithDirectoryMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []Directory `json:"Directory,omitempty"` +} + +func (m *MediaContainerWithDirectoryMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithDirectoryMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithDirectoryMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithDirectoryMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithDirectoryMediaContainer) GetDirectory() []Directory { + if m == nil { + return nil + } + return m.Directory +} + +type MediaContainerWithDirectory struct { + MediaContainer *MediaContainerWithDirectoryMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithDirectory) GetMediaContainer() *MediaContainerWithDirectoryMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithhubs.go b/models/components/mediacontainerwithhubs.go new file mode 100644 index 0000000..43bb98a --- /dev/null +++ b/models/components/mediacontainerwithhubs.go @@ -0,0 +1,65 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainerWithHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []Hub `json:"Hub,omitempty"` +} + +func (m *MediaContainerWithHubsMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithHubsMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithHubsMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithHubsMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithHubsMediaContainer) GetHub() []Hub { + if m == nil { + return nil + } + return m.Hub +} + +// MediaContainerWithHubs - OK +type MediaContainerWithHubs struct { + MediaContainer *MediaContainerWithHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithHubs) GetMediaContainer() *MediaContainerWithHubsMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithlineup.go b/models/components/mediacontainerwithlineup.go new file mode 100644 index 0000000..bcaf1ab --- /dev/null +++ b/models/components/mediacontainerwithlineup.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainerWithLineupMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithLineupMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Lineup []Lineup `json:"Lineup,omitempty"` + // The UUID of this set lineups + UUID *string `json:"uuid,omitempty"` +} + +func (m *MediaContainerWithLineupMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithLineupMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithLineupMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithLineupMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithLineupMediaContainer) GetLineup() []Lineup { + if m == nil { + return nil + } + return m.Lineup +} + +func (m *MediaContainerWithLineupMediaContainer) GetUUID() *string { + if m == nil { + return nil + } + return m.UUID +} + +type MediaContainerWithLineup struct { + MediaContainer *MediaContainerWithLineupMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithLineup) GetMediaContainer() *MediaContainerWithLineupMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithmetadata.go b/models/components/mediacontainerwithmetadata.go new file mode 100644 index 0000000..a3dab7f --- /dev/null +++ b/models/components/mediacontainerwithmetadata.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainerWithMetadataMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithMetadataMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata []Metadata `json:"Metadata,omitempty"` +} + +func (m *MediaContainerWithMetadataMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithMetadataMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithMetadataMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithMetadataMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithMetadataMediaContainer) GetMetadata() []Metadata { + if m == nil { + return nil + } + return m.Metadata +} + +type MediaContainerWithMetadata struct { + MediaContainer *MediaContainerWithMetadataMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithMetadata) GetMediaContainer() *MediaContainerWithMetadataMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithnestedmetadata.go b/models/components/mediacontainerwithnestedmetadata.go new file mode 100644 index 0000000..3479fa2 --- /dev/null +++ b/models/components/mediacontainerwithnestedmetadata.go @@ -0,0 +1,696 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +// MetadataItem - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type MetadataItem struct { + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []Tag `json:"Country,omitempty"` + Director []Tag `json:"Director,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []Filter `json:"Filter,omitempty"` + Genre []Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + Media []Media `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + MetadataItem []Items `json:"MetadataItem,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MetadataItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MetadataItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MetadataItem) GetTitle() any { + if m == nil { + return nil + } + return m.Title +} + +func (m *MetadataItem) GetType() any { + if m == nil { + return nil + } + return m.Type +} + +func (m *MetadataItem) GetAbsoluteIndex() *int64 { + if m == nil { + return nil + } + return m.AbsoluteIndex +} + +func (m *MetadataItem) GetAddedAt() *int64 { + if m == nil { + return nil + } + return m.AddedAt +} + +func (m *MetadataItem) GetArt() any { + if m == nil { + return nil + } + return m.Art +} + +func (m *MetadataItem) GetAudienceRating() *float64 { + if m == nil { + return nil + } + return m.AudienceRating +} + +func (m *MetadataItem) GetAudienceRatingImage() any { + if m == nil { + return nil + } + return m.AudienceRatingImage +} + +func (m *MetadataItem) GetAutotag() []Tag { + if m == nil { + return nil + } + return m.Autotag +} + +func (m *MetadataItem) GetBanner() any { + if m == nil { + return nil + } + return m.Banner +} + +func (m *MetadataItem) GetChapterSource() any { + if m == nil { + return nil + } + return m.ChapterSource +} + +func (m *MetadataItem) GetComposite() any { + if m == nil { + return nil + } + return m.Composite +} + +func (m *MetadataItem) GetContentRating() any { + if m == nil { + return nil + } + return m.ContentRating +} + +func (m *MetadataItem) GetCountry() []Tag { + if m == nil { + return nil + } + return m.Country +} + +func (m *MetadataItem) GetDirector() []Tag { + if m == nil { + return nil + } + return m.Director +} + +func (m *MetadataItem) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *MetadataItem) GetFilter() []Filter { + if m == nil { + return nil + } + return m.Filter +} + +func (m *MetadataItem) GetGenre() []Tag { + if m == nil { + return nil + } + return m.Genre +} + +func (m *MetadataItem) GetGrandparentArt() *string { + if m == nil { + return nil + } + return m.GrandparentArt +} + +func (m *MetadataItem) GetGrandparentHero() *string { + if m == nil { + return nil + } + return m.GrandparentHero +} + +func (m *MetadataItem) GetGrandparentKey() *string { + if m == nil { + return nil + } + return m.GrandparentKey +} + +func (m *MetadataItem) GetGrandparentRatingKey() *string { + if m == nil { + return nil + } + return m.GrandparentRatingKey +} + +func (m *MetadataItem) GetGrandparentTheme() *string { + if m == nil { + return nil + } + return m.GrandparentTheme +} + +func (m *MetadataItem) GetGrandparentThumb() *string { + if m == nil { + return nil + } + return m.GrandparentThumb +} + +func (m *MetadataItem) GetGrandparentTitle() *string { + if m == nil { + return nil + } + return m.GrandparentTitle +} + +func (m *MetadataItem) GetGUID() []Tag { + if m == nil { + return nil + } + return m.GUID +} + +func (m *MetadataItem) GetHero() any { + if m == nil { + return nil + } + return m.Hero +} + +func (m *MetadataItem) GetImage() []Image { + if m == nil { + return nil + } + return m.Image +} + +func (m *MetadataItem) GetIndex() *int64 { + if m == nil { + return nil + } + return m.Index +} + +func (m *MetadataItem) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *MetadataItem) GetLastViewedAt() *int64 { + if m == nil { + return nil + } + return m.LastViewedAt +} + +func (m *MetadataItem) GetLeafCount() *int64 { + if m == nil { + return nil + } + return m.LeafCount +} + +func (m *MetadataItem) GetMedia() []Media { + if m == nil { + return nil + } + return m.Media +} + +func (m *MetadataItem) GetOriginallyAvailableAt() any { + if m == nil { + return nil + } + return m.OriginallyAvailableAt +} + +func (m *MetadataItem) GetOriginalTitle() any { + if m == nil { + return nil + } + return m.OriginalTitle +} + +func (m *MetadataItem) GetParentHero() *string { + if m == nil { + return nil + } + return m.ParentHero +} + +func (m *MetadataItem) GetParentIndex() *int64 { + if m == nil { + return nil + } + return m.ParentIndex +} + +func (m *MetadataItem) GetParentKey() *string { + if m == nil { + return nil + } + return m.ParentKey +} + +func (m *MetadataItem) GetParentRatingKey() *string { + if m == nil { + return nil + } + return m.ParentRatingKey +} + +func (m *MetadataItem) GetParentThumb() *string { + if m == nil { + return nil + } + return m.ParentThumb +} + +func (m *MetadataItem) GetParentTitle() *string { + if m == nil { + return nil + } + return m.ParentTitle +} + +func (m *MetadataItem) GetPrimaryExtraKey() any { + if m == nil { + return nil + } + return m.PrimaryExtraKey +} + +func (m *MetadataItem) GetPrompt() *string { + if m == nil { + return nil + } + return m.Prompt +} + +func (m *MetadataItem) GetRating() *float64 { + if m == nil { + return nil + } + return m.Rating +} + +func (m *MetadataItem) GetRatingArray() []Tag { + if m == nil { + return nil + } + return m.RatingArray +} + +func (m *MetadataItem) GetRatingCount() *int64 { + if m == nil { + return nil + } + return m.RatingCount +} + +func (m *MetadataItem) GetRatingImage() any { + if m == nil { + return nil + } + return m.RatingImage +} + +func (m *MetadataItem) GetRatingKey() any { + if m == nil { + return nil + } + return m.RatingKey +} + +func (m *MetadataItem) GetRole() []Tag { + if m == nil { + return nil + } + return m.Role +} + +func (m *MetadataItem) GetSearch() *bool { + if m == nil { + return nil + } + return m.Search +} + +func (m *MetadataItem) GetSecondary() *bool { + if m == nil { + return nil + } + return m.Secondary +} + +func (m *MetadataItem) GetSkipChildren() *bool { + if m == nil { + return nil + } + return m.SkipChildren +} + +func (m *MetadataItem) GetSkipParent() *bool { + if m == nil { + return nil + } + return m.SkipParent +} + +func (m *MetadataItem) GetSort() []Sort { + if m == nil { + return nil + } + return m.Sort +} + +func (m *MetadataItem) GetStudio() any { + if m == nil { + return nil + } + return m.Studio +} + +func (m *MetadataItem) GetSubtype() any { + if m == nil { + return nil + } + return m.Subtype +} + +func (m *MetadataItem) GetSummary() any { + if m == nil { + return nil + } + return m.Summary +} + +func (m *MetadataItem) GetTagline() any { + if m == nil { + return nil + } + return m.Tagline +} + +func (m *MetadataItem) GetTheme() any { + if m == nil { + return nil + } + return m.Theme +} + +func (m *MetadataItem) GetThumb() any { + if m == nil { + return nil + } + return m.Thumb +} + +func (m *MetadataItem) GetTitleSort() any { + if m == nil { + return nil + } + return m.TitleSort +} + +func (m *MetadataItem) GetUpdatedAt() *int64 { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *MetadataItem) GetUserRating() *float64 { + if m == nil { + return nil + } + return m.UserRating +} + +func (m *MetadataItem) GetViewCount() *int64 { + if m == nil { + return nil + } + return m.ViewCount +} + +func (m *MetadataItem) GetViewedLeafCount() *int64 { + if m == nil { + return nil + } + return m.ViewedLeafCount +} + +func (m *MetadataItem) GetViewOffset() *int64 { + if m == nil { + return nil + } + return m.ViewOffset +} + +func (m *MetadataItem) GetWriter() []Tag { + if m == nil { + return nil + } + return m.Writer +} + +func (m *MetadataItem) GetYear() *int64 { + if m == nil { + return nil + } + return m.Year +} + +func (m *MetadataItem) GetMetadataItem() []Items { + if m == nil { + return nil + } + return m.MetadataItem +} + +func (m *MetadataItem) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// MediaContainerWithNestedMetadataMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithNestedMetadataMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + MetadataItem []MetadataItem `json:"MetadataItem,omitempty"` +} + +func (m *MediaContainerWithNestedMetadataMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithNestedMetadataMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithNestedMetadataMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithNestedMetadataMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithNestedMetadataMediaContainer) GetMetadataItem() []MetadataItem { + if m == nil { + return nil + } + return m.MetadataItem +} + +type MediaContainerWithNestedMetadata struct { + MediaContainer *MediaContainerWithNestedMetadataMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithNestedMetadata) GetMediaContainer() *MediaContainerWithNestedMetadataMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithplaylistmetadata.go b/models/components/mediacontainerwithplaylistmetadata.go new file mode 100644 index 0000000..061ad9a --- /dev/null +++ b/models/components/mediacontainerwithplaylistmetadata.go @@ -0,0 +1,756 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" +) + +// PlaylistType - The type of the 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) + } +} + +// MediaContainerWithPlaylistMetadataMetadata - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type MediaContainerWithPlaylistMetadataMetadata struct { + // If we return this as true then this playlist cannot be altered or deleted directly by the client. + ReadOnly *bool `json:"readOnly,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + // The type of the playlist. + PlaylistType *PlaylistType `json:"playlistType,omitempty"` + // Whether or not the playlist is smart. + Smart *bool `json:"smart,omitempty"` + // If this is a special playlist, this returns its type (e.g. favorites). + SpecialPlaylistType *string `json:"specialPlaylistType,omitempty"` + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []Tag `json:"Country,omitempty"` + Director []Tag `json:"Director,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []Filter `json:"Filter,omitempty"` + Genre []Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + Media []Media `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MediaContainerWithPlaylistMetadataMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetReadOnly() *bool { + if m == nil { + return nil + } + return m.ReadOnly +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetComposite() any { + if m == nil { + return nil + } + return m.Composite +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetLeafCount() *int64 { + if m == nil { + return nil + } + return m.LeafCount +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetPlaylistType() *PlaylistType { + if m == nil { + return nil + } + return m.PlaylistType +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSmart() *bool { + if m == nil { + return nil + } + return m.Smart +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSpecialPlaylistType() *string { + if m == nil { + return nil + } + return m.SpecialPlaylistType +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetTitle() any { + if m == nil { + return nil + } + return m.Title +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetType() any { + if m == nil { + return nil + } + return m.Type +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetAbsoluteIndex() *int64 { + if m == nil { + return nil + } + return m.AbsoluteIndex +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetAddedAt() *int64 { + if m == nil { + return nil + } + return m.AddedAt +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetArt() any { + if m == nil { + return nil + } + return m.Art +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetAudienceRating() *float64 { + if m == nil { + return nil + } + return m.AudienceRating +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetAudienceRatingImage() any { + if m == nil { + return nil + } + return m.AudienceRatingImage +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetAutotag() []Tag { + if m == nil { + return nil + } + return m.Autotag +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetBanner() any { + if m == nil { + return nil + } + return m.Banner +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetChapterSource() any { + if m == nil { + return nil + } + return m.ChapterSource +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetContentRating() any { + if m == nil { + return nil + } + return m.ContentRating +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetCountry() []Tag { + if m == nil { + return nil + } + return m.Country +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetDirector() []Tag { + if m == nil { + return nil + } + return m.Director +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetFilter() []Filter { + if m == nil { + return nil + } + return m.Filter +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGenre() []Tag { + if m == nil { + return nil + } + return m.Genre +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentArt() *string { + if m == nil { + return nil + } + return m.GrandparentArt +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentHero() *string { + if m == nil { + return nil + } + return m.GrandparentHero +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentKey() *string { + if m == nil { + return nil + } + return m.GrandparentKey +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentRatingKey() *string { + if m == nil { + return nil + } + return m.GrandparentRatingKey +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentTheme() *string { + if m == nil { + return nil + } + return m.GrandparentTheme +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentThumb() *string { + if m == nil { + return nil + } + return m.GrandparentThumb +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGrandparentTitle() *string { + if m == nil { + return nil + } + return m.GrandparentTitle +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetGUID() []Tag { + if m == nil { + return nil + } + return m.GUID +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetHero() any { + if m == nil { + return nil + } + return m.Hero +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetImage() []Image { + if m == nil { + return nil + } + return m.Image +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetIndex() *int64 { + if m == nil { + return nil + } + return m.Index +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetLastViewedAt() *int64 { + if m == nil { + return nil + } + return m.LastViewedAt +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetMedia() []Media { + if m == nil { + return nil + } + return m.Media +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetOriginallyAvailableAt() any { + if m == nil { + return nil + } + return m.OriginallyAvailableAt +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetOriginalTitle() any { + if m == nil { + return nil + } + return m.OriginalTitle +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetParentHero() *string { + if m == nil { + return nil + } + return m.ParentHero +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetParentIndex() *int64 { + if m == nil { + return nil + } + return m.ParentIndex +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetParentKey() *string { + if m == nil { + return nil + } + return m.ParentKey +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetParentRatingKey() *string { + if m == nil { + return nil + } + return m.ParentRatingKey +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetParentThumb() *string { + if m == nil { + return nil + } + return m.ParentThumb +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetParentTitle() *string { + if m == nil { + return nil + } + return m.ParentTitle +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetPrimaryExtraKey() any { + if m == nil { + return nil + } + return m.PrimaryExtraKey +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetPrompt() *string { + if m == nil { + return nil + } + return m.Prompt +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetRating() *float64 { + if m == nil { + return nil + } + return m.Rating +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetRatingArray() []Tag { + if m == nil { + return nil + } + return m.RatingArray +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetRatingCount() *int64 { + if m == nil { + return nil + } + return m.RatingCount +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetRatingImage() any { + if m == nil { + return nil + } + return m.RatingImage +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetRatingKey() any { + if m == nil { + return nil + } + return m.RatingKey +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetRole() []Tag { + if m == nil { + return nil + } + return m.Role +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSearch() *bool { + if m == nil { + return nil + } + return m.Search +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSecondary() *bool { + if m == nil { + return nil + } + return m.Secondary +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSkipChildren() *bool { + if m == nil { + return nil + } + return m.SkipChildren +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSkipParent() *bool { + if m == nil { + return nil + } + return m.SkipParent +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSort() []Sort { + if m == nil { + return nil + } + return m.Sort +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetStudio() any { + if m == nil { + return nil + } + return m.Studio +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSubtype() any { + if m == nil { + return nil + } + return m.Subtype +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetSummary() any { + if m == nil { + return nil + } + return m.Summary +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetTagline() any { + if m == nil { + return nil + } + return m.Tagline +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetTheme() any { + if m == nil { + return nil + } + return m.Theme +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetThumb() any { + if m == nil { + return nil + } + return m.Thumb +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetTitleSort() any { + if m == nil { + return nil + } + return m.TitleSort +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetUpdatedAt() *int64 { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetUserRating() *float64 { + if m == nil { + return nil + } + return m.UserRating +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetViewCount() *int64 { + if m == nil { + return nil + } + return m.ViewCount +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetViewedLeafCount() *int64 { + if m == nil { + return nil + } + return m.ViewedLeafCount +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetViewOffset() *int64 { + if m == nil { + return nil + } + return m.ViewOffset +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetWriter() []Tag { + if m == nil { + return nil + } + return m.Writer +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetYear() *int64 { + if m == nil { + return nil + } + return m.Year +} + +func (m *MediaContainerWithPlaylistMetadataMetadata) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// MediaContainerWithPlaylistMetadataMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithPlaylistMetadataMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata []MediaContainerWithPlaylistMetadataMetadata `json:"Metadata,omitempty"` +} + +func (m *MediaContainerWithPlaylistMetadataMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithPlaylistMetadataMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithPlaylistMetadataMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithPlaylistMetadataMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithPlaylistMetadataMediaContainer) GetMetadata() []MediaContainerWithPlaylistMetadataMetadata { + if m == nil { + return nil + } + return m.Metadata +} + +type MediaContainerWithPlaylistMetadata struct { + MediaContainer *MediaContainerWithPlaylistMetadataMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithPlaylistMetadata) GetMediaContainer() *MediaContainerWithPlaylistMetadataMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithsettings.go b/models/components/mediacontainerwithsettings.go new file mode 100644 index 0000000..b2e8851 --- /dev/null +++ b/models/components/mediacontainerwithsettings.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainerWithSettingsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithSettingsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Setting []Setting `json:"Setting,omitempty"` +} + +func (m *MediaContainerWithSettingsMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithSettingsMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithSettingsMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithSettingsMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithSettingsMediaContainer) GetSetting() []Setting { + if m == nil { + return nil + } + return m.Setting +} + +type MediaContainerWithSettings struct { + MediaContainer *MediaContainerWithSettingsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithSettings) GetMediaContainer() *MediaContainerWithSettingsMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediacontainerwithsubscription.go b/models/components/mediacontainerwithsubscription.go new file mode 100644 index 0000000..a57c2b6 --- /dev/null +++ b/models/components/mediacontainerwithsubscription.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MediaContainerWithSubscriptionMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainerWithSubscriptionMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + MediaSubscription []MediaSubscription `json:"MediaSubscription,omitempty"` +} + +func (m *MediaContainerWithSubscriptionMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainerWithSubscriptionMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainerWithSubscriptionMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainerWithSubscriptionMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainerWithSubscriptionMediaContainer) GetMediaSubscription() []MediaSubscription { + if m == nil { + return nil + } + return m.MediaSubscription +} + +type MediaContainerWithSubscription struct { + MediaContainer *MediaContainerWithSubscriptionMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *MediaContainerWithSubscription) GetMediaContainer() *MediaContainerWithSubscriptionMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} diff --git a/models/components/mediagraboperation.go b/models/components/mediagraboperation.go new file mode 100644 index 0000000..e4f88c6 --- /dev/null +++ b/models/components/mediagraboperation.go @@ -0,0 +1,150 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Status string + +const ( + StatusInactive Status = "inactive" + StatusScheduled Status = "scheduled" + StatusInprogress Status = "inprogress" + StatusComplete Status = "complete" + StatusCancelled Status = "cancelled" + StatusError Status = "error" + StatusPostprocessing Status = "postprocessing" + StatusPaused Status = "paused" +) + +func (e Status) ToPointer() *Status { + return &e +} +func (e *Status) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "inactive": + fallthrough + case "scheduled": + fallthrough + case "inprogress": + fallthrough + case "complete": + fallthrough + case "cancelled": + fallthrough + case "error": + fallthrough + case "postprocessing": + fallthrough + case "paused": + *e = Status(v) + return nil + default: + return fmt.Errorf("invalid value for Status: %v", v) + } +} + +// MediaGrabOperation - A media grab opration represents a scheduled or active recording of media +type MediaGrabOperation struct { + CurrentSize *int64 `json:"currentSize,omitempty"` + GrabberIdentifier *string `json:"grabberIdentifier,omitempty"` + GrabberProtocol *string `json:"grabberProtocol,omitempty"` + ID *string `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + MediaIndex *int64 `json:"mediaIndex,omitempty"` + MediaSubscriptionID *int64 `json:"mediaSubscriptionID,omitempty"` + // Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. + // + // Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. + // + // Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. + // + Metadata *Metadata `json:"Metadata,omitempty"` + Percent *float64 `json:"percent,omitempty"` + Provider *string `json:"provider,omitempty"` + Status *Status `json:"status,omitempty"` +} + +func (m *MediaGrabOperation) GetCurrentSize() *int64 { + if m == nil { + return nil + } + return m.CurrentSize +} + +func (m *MediaGrabOperation) GetGrabberIdentifier() *string { + if m == nil { + return nil + } + return m.GrabberIdentifier +} + +func (m *MediaGrabOperation) GetGrabberProtocol() *string { + if m == nil { + return nil + } + return m.GrabberProtocol +} + +func (m *MediaGrabOperation) GetID() *string { + if m == nil { + return nil + } + return m.ID +} + +func (m *MediaGrabOperation) GetKey() *string { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaGrabOperation) GetMediaIndex() *int64 { + if m == nil { + return nil + } + return m.MediaIndex +} + +func (m *MediaGrabOperation) GetMediaSubscriptionID() *int64 { + if m == nil { + return nil + } + return m.MediaSubscriptionID +} + +func (m *MediaGrabOperation) GetMetadata() *Metadata { + if m == nil { + return nil + } + return m.Metadata +} + +func (m *MediaGrabOperation) GetPercent() *float64 { + if m == nil { + return nil + } + return m.Percent +} + +func (m *MediaGrabOperation) GetProvider() *string { + if m == nil { + return nil + } + return m.Provider +} + +func (m *MediaGrabOperation) GetStatus() *Status { + if m == nil { + return nil + } + return m.Status +} diff --git a/models/components/mediaquery.go b/models/components/mediaquery.go new file mode 100644 index 0000000..eac5bf2 --- /dev/null +++ b/models/components/mediaquery.go @@ -0,0 +1,6 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type MediaQuery struct { +} diff --git a/models/components/mediasubscription.go b/models/components/mediasubscription.go new file mode 100644 index 0000000..2054ab0 --- /dev/null +++ b/models/components/mediasubscription.go @@ -0,0 +1,174 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type AiringsType string + +const ( + AiringsTypeNewAiringsOnly AiringsType = "New Airings Only" + AiringsTypeNewAndRepeatAirings AiringsType = "New and Repeat Airings" +) + +func (e AiringsType) ToPointer() *AiringsType { + return &e +} +func (e *AiringsType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "New Airings Only": + fallthrough + case "New and Repeat Airings": + *e = AiringsType(v) + return nil + default: + return fmt.Errorf("invalid value for AiringsType: %v", v) + } +} + +// MediaSubscription - A media subscription contains a representation of metadata desired to be recorded +type MediaSubscription struct { + Title *string `json:"title,omitempty"` + // The metadata type of the root item of the subscription + Type *int64 `json:"type,omitempty"` + AiringsType *AiringsType `json:"airingsType,omitempty"` + CreatedAt *int64 `json:"createdAt,omitempty"` + // Media Matching Hints + Directory map[string]any `json:"Directory,omitempty"` + // Only included if `includeStorage` is specified + DurationTotal *int64 `json:"durationTotal,omitempty"` + Key *string `json:"key,omitempty"` + LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` + LocationPath *string `json:"locationPath,omitempty"` + MediaGrabOperation []MediaGrabOperation `json:"MediaGrabOperation,omitempty"` + // Media Matching Hints + Playlist map[string]any `json:"Playlist,omitempty"` + Setting []Setting `json:"Setting,omitempty"` + // Only included if `includeStorage` is specified + StorageTotal *int64 `json:"storageTotal,omitempty"` + // The library section id for where the item is to be recorded + TargetLibrarySectionID *int64 `json:"targetLibrarySectionID,omitempty"` + // The library section location id for where the item is to be recorded + TargetSectionLocationID *int64 `json:"targetSectionLocationID,omitempty"` + // Media Matching Hints + Video map[string]any `json:"Video,omitempty"` +} + +func (m *MediaSubscription) GetTitle() *string { + if m == nil { + return nil + } + return m.Title +} + +func (m *MediaSubscription) GetType() *int64 { + if m == nil { + return nil + } + return m.Type +} + +func (m *MediaSubscription) GetAiringsType() *AiringsType { + if m == nil { + return nil + } + return m.AiringsType +} + +func (m *MediaSubscription) GetCreatedAt() *int64 { + if m == nil { + return nil + } + return m.CreatedAt +} + +func (m *MediaSubscription) GetDirectory() map[string]any { + if m == nil { + return nil + } + return m.Directory +} + +func (m *MediaSubscription) GetDurationTotal() *int64 { + if m == nil { + return nil + } + return m.DurationTotal +} + +func (m *MediaSubscription) GetKey() *string { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaSubscription) GetLibrarySectionTitle() *string { + if m == nil { + return nil + } + return m.LibrarySectionTitle +} + +func (m *MediaSubscription) GetLocationPath() *string { + if m == nil { + return nil + } + return m.LocationPath +} + +func (m *MediaSubscription) GetMediaGrabOperation() []MediaGrabOperation { + if m == nil { + return nil + } + return m.MediaGrabOperation +} + +func (m *MediaSubscription) GetPlaylist() map[string]any { + if m == nil { + return nil + } + return m.Playlist +} + +func (m *MediaSubscription) GetSetting() []Setting { + if m == nil { + return nil + } + return m.Setting +} + +func (m *MediaSubscription) GetStorageTotal() *int64 { + if m == nil { + return nil + } + return m.StorageTotal +} + +func (m *MediaSubscription) GetTargetLibrarySectionID() *int64 { + if m == nil { + return nil + } + return m.TargetLibrarySectionID +} + +func (m *MediaSubscription) GetTargetSectionLocationID() *int64 { + if m == nil { + return nil + } + return m.TargetSectionLocationID +} + +func (m *MediaSubscription) GetVideo() map[string]any { + if m == nil { + return nil + } + return m.Video +} diff --git a/models/components/metadata.go b/models/components/metadata.go new file mode 100644 index 0000000..287eb52 --- /dev/null +++ b/models/components/metadata.go @@ -0,0 +1,627 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +// Metadata - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type Metadata struct { + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []Tag `json:"Country,omitempty"` + Director []Tag `json:"Director,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []Filter `json:"Filter,omitempty"` + Genre []Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + Media []Media `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +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, nil); err != nil { + return err + } + return nil +} + +func (m *Metadata) GetTitle() any { + if m == nil { + return nil + } + return m.Title +} + +func (m *Metadata) GetType() any { + if m == nil { + return nil + } + return m.Type +} + +func (m *Metadata) GetAbsoluteIndex() *int64 { + if m == nil { + return nil + } + return m.AbsoluteIndex +} + +func (m *Metadata) GetAddedAt() *int64 { + if m == nil { + return nil + } + return m.AddedAt +} + +func (m *Metadata) GetArt() any { + if m == nil { + return nil + } + return m.Art +} + +func (m *Metadata) GetAudienceRating() *float64 { + if m == nil { + return nil + } + return m.AudienceRating +} + +func (m *Metadata) GetAudienceRatingImage() any { + if m == nil { + return nil + } + return m.AudienceRatingImage +} + +func (m *Metadata) GetAutotag() []Tag { + if m == nil { + return nil + } + return m.Autotag +} + +func (m *Metadata) GetBanner() any { + if m == nil { + return nil + } + return m.Banner +} + +func (m *Metadata) GetChapterSource() any { + if m == nil { + return nil + } + return m.ChapterSource +} + +func (m *Metadata) GetComposite() any { + if m == nil { + return nil + } + return m.Composite +} + +func (m *Metadata) GetContentRating() any { + if m == nil { + return nil + } + return m.ContentRating +} + +func (m *Metadata) GetCountry() []Tag { + if m == nil { + return nil + } + return m.Country +} + +func (m *Metadata) GetDirector() []Tag { + if m == nil { + return nil + } + return m.Director +} + +func (m *Metadata) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *Metadata) GetFilter() []Filter { + if m == nil { + return nil + } + return m.Filter +} + +func (m *Metadata) GetGenre() []Tag { + if m == nil { + return nil + } + return m.Genre +} + +func (m *Metadata) GetGrandparentArt() *string { + if m == nil { + return nil + } + return m.GrandparentArt +} + +func (m *Metadata) GetGrandparentHero() *string { + if m == nil { + return nil + } + return m.GrandparentHero +} + +func (m *Metadata) GetGrandparentKey() *string { + if m == nil { + return nil + } + return m.GrandparentKey +} + +func (m *Metadata) GetGrandparentRatingKey() *string { + if m == nil { + return nil + } + return m.GrandparentRatingKey +} + +func (m *Metadata) GetGrandparentTheme() *string { + if m == nil { + return nil + } + return m.GrandparentTheme +} + +func (m *Metadata) GetGrandparentThumb() *string { + if m == nil { + return nil + } + return m.GrandparentThumb +} + +func (m *Metadata) GetGrandparentTitle() *string { + if m == nil { + return nil + } + return m.GrandparentTitle +} + +func (m *Metadata) GetGUID() []Tag { + if m == nil { + return nil + } + return m.GUID +} + +func (m *Metadata) GetHero() any { + if m == nil { + return nil + } + return m.Hero +} + +func (m *Metadata) GetImage() []Image { + if m == nil { + return nil + } + return m.Image +} + +func (m *Metadata) GetIndex() *int64 { + if m == nil { + return nil + } + return m.Index +} + +func (m *Metadata) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *Metadata) GetLastViewedAt() *int64 { + if m == nil { + return nil + } + return m.LastViewedAt +} + +func (m *Metadata) GetLeafCount() *int64 { + if m == nil { + return nil + } + return m.LeafCount +} + +func (m *Metadata) GetMedia() []Media { + if m == nil { + return nil + } + return m.Media +} + +func (m *Metadata) GetOriginallyAvailableAt() any { + if m == nil { + return nil + } + return m.OriginallyAvailableAt +} + +func (m *Metadata) GetOriginalTitle() any { + if m == nil { + return nil + } + return m.OriginalTitle +} + +func (m *Metadata) GetParentHero() *string { + if m == nil { + return nil + } + return m.ParentHero +} + +func (m *Metadata) GetParentIndex() *int64 { + if m == nil { + return nil + } + return m.ParentIndex +} + +func (m *Metadata) GetParentKey() *string { + if m == nil { + return nil + } + return m.ParentKey +} + +func (m *Metadata) GetParentRatingKey() *string { + if m == nil { + return nil + } + return m.ParentRatingKey +} + +func (m *Metadata) GetParentThumb() *string { + if m == nil { + return nil + } + return m.ParentThumb +} + +func (m *Metadata) GetParentTitle() *string { + if m == nil { + return nil + } + return m.ParentTitle +} + +func (m *Metadata) GetPrimaryExtraKey() any { + if m == nil { + return nil + } + return m.PrimaryExtraKey +} + +func (m *Metadata) GetPrompt() *string { + if m == nil { + return nil + } + return m.Prompt +} + +func (m *Metadata) GetRating() *float64 { + if m == nil { + return nil + } + return m.Rating +} + +func (m *Metadata) GetRatingArray() []Tag { + if m == nil { + return nil + } + return m.RatingArray +} + +func (m *Metadata) GetRatingCount() *int64 { + if m == nil { + return nil + } + return m.RatingCount +} + +func (m *Metadata) GetRatingImage() any { + if m == nil { + return nil + } + return m.RatingImage +} + +func (m *Metadata) GetRatingKey() any { + if m == nil { + return nil + } + return m.RatingKey +} + +func (m *Metadata) GetRole() []Tag { + if m == nil { + return nil + } + return m.Role +} + +func (m *Metadata) GetSearch() *bool { + if m == nil { + return nil + } + return m.Search +} + +func (m *Metadata) GetSecondary() *bool { + if m == nil { + return nil + } + return m.Secondary +} + +func (m *Metadata) GetSkipChildren() *bool { + if m == nil { + return nil + } + return m.SkipChildren +} + +func (m *Metadata) GetSkipParent() *bool { + if m == nil { + return nil + } + return m.SkipParent +} + +func (m *Metadata) GetSort() []Sort { + if m == nil { + return nil + } + return m.Sort +} + +func (m *Metadata) GetStudio() any { + if m == nil { + return nil + } + return m.Studio +} + +func (m *Metadata) GetSubtype() any { + if m == nil { + return nil + } + return m.Subtype +} + +func (m *Metadata) GetSummary() any { + if m == nil { + return nil + } + return m.Summary +} + +func (m *Metadata) GetTagline() any { + if m == nil { + return nil + } + return m.Tagline +} + +func (m *Metadata) GetTheme() any { + if m == nil { + return nil + } + return m.Theme +} + +func (m *Metadata) GetThumb() any { + if m == nil { + return nil + } + return m.Thumb +} + +func (m *Metadata) GetTitleSort() any { + if m == nil { + return nil + } + return m.TitleSort +} + +func (m *Metadata) GetUpdatedAt() *int64 { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *Metadata) GetUserRating() *float64 { + if m == nil { + return nil + } + return m.UserRating +} + +func (m *Metadata) GetViewCount() *int64 { + if m == nil { + return nil + } + return m.ViewCount +} + +func (m *Metadata) GetViewedLeafCount() *int64 { + if m == nil { + return nil + } + return m.ViewedLeafCount +} + +func (m *Metadata) GetViewOffset() *int64 { + if m == nil { + return nil + } + return m.ViewOffset +} + +func (m *Metadata) GetWriter() []Tag { + if m == nil { + return nil + } + return m.Writer +} + +func (m *Metadata) GetYear() *int64 { + if m == nil { + return nil + } + return m.Year +} + +func (m *Metadata) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} diff --git a/models/components/part.go b/models/components/part.go new file mode 100644 index 0000000..516b6b1 --- /dev/null +++ b/models/components/part.go @@ -0,0 +1,123 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +// Part - `Part` represents a particular file or "part" of a media item. The part is the playable unit of the media hierarchy. Suppose that a movie library contains a movie that is broken up into files, reminiscent of a movie split across two BDs. The metadata item represents information about the movie, the media item represents this instance of the movie at this resolution and quality, and the part items represent the two playable files. If another media were added which contained the joining of these two parts transcoded down to a lower resolution, then this metadata would contain 2 medias, one with 2 parts and one with 1 part. +type Part struct { + AudioProfile any `json:"audioProfile,omitempty"` + // The container of the media file, such as `mp4` or `mkv` + Container any `json:"container,omitempty"` + // The duration of the media item, in milliseconds + Duration *int64 `json:"duration,omitempty"` + // The local file path at which the part is stored on the server + File any `json:"file,omitempty"` + Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` + ID *int64 `json:"id,omitempty"` + // The key from which the media can be streamed + Key any `json:"key,omitempty"` + OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` + // The size of the media, in bytes + Size *int64 `json:"size,omitempty"` + Stream []Stream `json:"Stream,omitempty"` + VideoProfile any `json:"videoProfile,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (p Part) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *Part) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *Part) GetAudioProfile() any { + if p == nil { + return nil + } + return p.AudioProfile +} + +func (p *Part) GetContainer() any { + if p == nil { + return nil + } + return p.Container +} + +func (p *Part) GetDuration() *int64 { + if p == nil { + return nil + } + return p.Duration +} + +func (p *Part) GetFile() any { + if p == nil { + return nil + } + return p.File +} + +func (p *Part) GetHas64bitOffsets() *bool { + if p == nil { + return nil + } + return p.Has64bitOffsets +} + +func (p *Part) GetID() *int64 { + if p == nil { + return nil + } + return p.ID +} + +func (p *Part) GetKey() any { + if p == nil { + return nil + } + return p.Key +} + +func (p *Part) GetOptimizedForStreaming() *bool { + if p == nil { + return nil + } + return p.OptimizedForStreaming +} + +func (p *Part) GetSize() *int64 { + if p == nil { + return nil + } + return p.Size +} + +func (p *Part) GetStream() []Stream { + if p == nil { + return nil + } + return p.Stream +} + +func (p *Part) GetVideoProfile() any { + if p == nil { + return nil + } + return p.VideoProfile +} + +func (p *Part) GetAdditionalProperties() map[string]any { + if p == nil { + return nil + } + return p.AdditionalProperties +} diff --git a/models/components/player.go b/models/components/player.go new file mode 100644 index 0000000..18e9882 --- /dev/null +++ b/models/components/player.go @@ -0,0 +1,142 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Player - Information about the player being used for playback +type Player struct { + // The title of the client + Title *string `json:"title,omitempty"` + // The remote address + Address *string `json:"address,omitempty"` + // Indicating if the client is playing from the local LAN + Local *bool `json:"local,omitempty"` + // The identifier of the client + MachineIdentifier *string `json:"machineIdentifier,omitempty"` + // The model of the client + Model *string `json:"model,omitempty"` + // The platform of the client + Platform *string `json:"platform,omitempty"` + // The platformVersion of the client + PlatformVersion *string `json:"platformVersion,omitempty"` + // The product name of the client + Product *string `json:"product,omitempty"` + // Indicating if the client is playing over a relay connection + Relayed *bool `json:"relayed,omitempty"` + // The client's public address + RemotePublicAddress *string `json:"remotePublicAddress,omitempty"` + // Indicating if the client is playing over HTTPS + Secure *bool `json:"secure,omitempty"` + // The client's last reported state + State *string `json:"state,omitempty"` + // The id of the user + UserID *int64 `json:"userID,omitempty"` + // The vendor of the client + Vendor *string `json:"vendor,omitempty"` + // The version of the client + Version *string `json:"version,omitempty"` +} + +func (p *Player) GetTitle() *string { + if p == nil { + return nil + } + return p.Title +} + +func (p *Player) GetAddress() *string { + if p == nil { + return nil + } + return p.Address +} + +func (p *Player) GetLocal() *bool { + if p == nil { + return nil + } + return p.Local +} + +func (p *Player) GetMachineIdentifier() *string { + if p == nil { + return nil + } + return p.MachineIdentifier +} + +func (p *Player) GetModel() *string { + if p == nil { + return nil + } + return p.Model +} + +func (p *Player) GetPlatform() *string { + if p == nil { + return nil + } + return p.Platform +} + +func (p *Player) GetPlatformVersion() *string { + if p == nil { + return nil + } + return p.PlatformVersion +} + +func (p *Player) GetProduct() *string { + if p == nil { + return nil + } + return p.Product +} + +func (p *Player) GetRelayed() *bool { + if p == nil { + return nil + } + return p.Relayed +} + +func (p *Player) GetRemotePublicAddress() *string { + if p == nil { + return nil + } + return p.RemotePublicAddress +} + +func (p *Player) GetSecure() *bool { + if p == nil { + return nil + } + return p.Secure +} + +func (p *Player) GetState() *string { + if p == nil { + return nil + } + return p.State +} + +func (p *Player) GetUserID() *int64 { + if p == nil { + return nil + } + return p.UserID +} + +func (p *Player) GetVendor() *string { + if p == nil { + return nil + } + return p.Vendor +} + +func (p *Player) GetVersion() *string { + if p == nil { + return nil + } + return p.Version +} diff --git a/models/components/postresponses200.go b/models/components/postresponses200.go new file mode 100644 index 0000000..8c90490 --- /dev/null +++ b/models/components/postresponses200.go @@ -0,0 +1,165 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" +) + +type PostResponses200Type string + +const ( + PostResponses200TypeIntro PostResponses200Type = "intro" + PostResponses200TypeCommercial PostResponses200Type = "commercial" + PostResponses200TypeBookmark PostResponses200Type = "bookmark" + PostResponses200TypeResume PostResponses200Type = "resume" + PostResponses200TypeCredit PostResponses200Type = "credit" +) + +func (e PostResponses200Type) ToPointer() *PostResponses200Type { + return &e +} +func (e *PostResponses200Type) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "intro": + fallthrough + case "commercial": + fallthrough + case "bookmark": + fallthrough + case "resume": + fallthrough + case "credit": + *e = PostResponses200Type(v) + return nil + default: + return fmt.Errorf("invalid value for PostResponses200Type: %v", v) + } +} + +// PostResponses200MediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type PostResponses200MediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Color *string `json:"color,omitempty"` + EndTimeOffset *int64 `json:"endTimeOffset,omitempty"` + ID *int64 `json:"id,omitempty"` + StartTimeOffset *int64 `json:"startTimeOffset,omitempty"` + Title *string `json:"title,omitempty"` + Type *PostResponses200Type `json:"type,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (p PostResponses200MediaContainer) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PostResponses200MediaContainer) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PostResponses200MediaContainer) GetIdentifier() *string { + if p == nil { + return nil + } + return p.Identifier +} + +func (p *PostResponses200MediaContainer) GetOffset() *int64 { + if p == nil { + return nil + } + return p.Offset +} + +func (p *PostResponses200MediaContainer) GetSize() *int64 { + if p == nil { + return nil + } + return p.Size +} + +func (p *PostResponses200MediaContainer) GetTotalSize() *int64 { + if p == nil { + return nil + } + return p.TotalSize +} + +func (p *PostResponses200MediaContainer) GetColor() *string { + if p == nil { + return nil + } + return p.Color +} + +func (p *PostResponses200MediaContainer) GetEndTimeOffset() *int64 { + if p == nil { + return nil + } + return p.EndTimeOffset +} + +func (p *PostResponses200MediaContainer) GetID() *int64 { + if p == nil { + return nil + } + return p.ID +} + +func (p *PostResponses200MediaContainer) GetStartTimeOffset() *int64 { + if p == nil { + return nil + } + return p.StartTimeOffset +} + +func (p *PostResponses200MediaContainer) GetTitle() *string { + if p == nil { + return nil + } + return p.Title +} + +func (p *PostResponses200MediaContainer) GetType() *PostResponses200Type { + if p == nil { + return nil + } + return p.Type +} + +func (p *PostResponses200MediaContainer) GetAdditionalProperties() map[string]any { + if p == nil { + return nil + } + return p.AdditionalProperties +} + +// PostResponses200 - OK +type PostResponses200 struct { + MediaContainer *PostResponses200MediaContainer `json:"MediaContainer,omitempty"` +} + +func (p *PostResponses200) GetMediaContainer() *PostResponses200MediaContainer { + if p == nil { + return nil + } + return p.MediaContainer +} diff --git a/models/components/protocol.go b/models/components/protocol.go new file mode 100644 index 0000000..dc7c8f8 --- /dev/null +++ b/models/components/protocol.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Protocol string + +const ( + ProtocolHTTP Protocol = "http" + ProtocolHls Protocol = "hls" + ProtocolDash Protocol = "dash" +) + +func (e Protocol) ToPointer() *Protocol { + return &e +} +func (e *Protocol) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "http": + fallthrough + case "hls": + fallthrough + case "dash": + *e = Protocol(v) + return nil + default: + return fmt.Errorf("invalid value for Protocol: %v", v) + } +} diff --git a/models/components/requesthandlerslashgetresponses200.go b/models/components/requesthandlerslashgetresponses200.go new file mode 100644 index 0000000..58ae0b0 --- /dev/null +++ b/models/components/requesthandlerslashgetresponses200.go @@ -0,0 +1,480 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RequestHandlerSlashGetResponses200Directory struct { + Count *int64 `json:"count,omitempty"` + // The key where this directory is found + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (r *RequestHandlerSlashGetResponses200Directory) GetCount() *int64 { + if r == nil { + return nil + } + return r.Count +} + +func (r *RequestHandlerSlashGetResponses200Directory) GetKey() *string { + if r == nil { + return nil + } + return r.Key +} + +func (r *RequestHandlerSlashGetResponses200Directory) GetTitle() *string { + if r == nil { + return nil + } + return r.Title +} + +// RequestHandlerSlashGetResponses200MediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type RequestHandlerSlashGetResponses200MediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,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 *int64 `json:"livetv,omitempty"` + MachineIdentifier any `json:"machineIdentifier,omitempty"` + MediaProviders *bool `json:"mediaProviders,omitempty"` + Multiuser *bool `json:"multiuser,omitempty"` + MusicAnalysis *int64 `json:"musicAnalysis,omitempty"` + MyPlex *bool `json:"myPlex,omitempty"` + MyPlexMappingState any `json:"myPlexMappingState,omitempty"` + MyPlexSigninState any `json:"myPlexSigninState,omitempty"` + MyPlexSubscription *bool `json:"myPlexSubscription,omitempty"` + MyPlexUsername *string `json:"myPlexUsername,omitempty"` + OfflineTranscode any `json:"offlineTranscode,omitempty"` + // A comma-separated list of features which are enabled for the server owner + OwnerFeatures *string `json:"ownerFeatures,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 *int64 `json:"streamingBrainABRVersion,omitempty"` + StreamingBrainVersion *int64 `json:"streamingBrainVersion,omitempty"` + Sync *bool `json:"sync,omitempty"` + TranscoderActiveVideoSessions *int64 `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"` + // The suggested video quality bitrates to present to the user + TranscoderVideoBitrates any `json:"transcoderVideoBitrates,omitempty"` + TranscoderVideoQualities *string `json:"transcoderVideoQualities,omitempty"` + // The suggested video resolutions to the above quality bitrates + TranscoderVideoResolutions any `json:"transcoderVideoResolutions,omitempty"` + UpdatedAt *int64 `json:"updatedAt,omitempty"` + Updater *bool `json:"updater,omitempty"` + Version *string `json:"version,omitempty"` + VoiceSearch *bool `json:"voiceSearch,omitempty"` + Directory []RequestHandlerSlashGetResponses200Directory `json:"Directory,omitempty"` +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetIdentifier() *string { + if r == nil { + return nil + } + return r.Identifier +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetOffset() *int64 { + if r == nil { + return nil + } + return r.Offset +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetSize() *int64 { + if r == nil { + return nil + } + return r.Size +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTotalSize() *int64 { + if r == nil { + return nil + } + return r.TotalSize +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetAllowCameraUpload() *bool { + if r == nil { + return nil + } + return r.AllowCameraUpload +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetAllowChannelAccess() *bool { + if r == nil { + return nil + } + return r.AllowChannelAccess +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetAllowMediaDeletion() *bool { + if r == nil { + return nil + } + return r.AllowMediaDeletion +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetAllowSharing() *bool { + if r == nil { + return nil + } + return r.AllowSharing +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetAllowSync() *bool { + if r == nil { + return nil + } + return r.AllowSync +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetAllowTuners() *bool { + if r == nil { + return nil + } + return r.AllowTuners +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetBackgroundProcessing() *bool { + if r == nil { + return nil + } + return r.BackgroundProcessing +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetCertificate() *bool { + if r == nil { + return nil + } + return r.Certificate +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetCompanionProxy() *bool { + if r == nil { + return nil + } + return r.CompanionProxy +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetCountryCode() *string { + if r == nil { + return nil + } + return r.CountryCode +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetDiagnostics() *string { + if r == nil { + return nil + } + return r.Diagnostics +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetEventStream() *bool { + if r == nil { + return nil + } + return r.EventStream +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetFriendlyName() *string { + if r == nil { + return nil + } + return r.FriendlyName +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetHubSearch() *bool { + if r == nil { + return nil + } + return r.HubSearch +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetItemClusters() *bool { + if r == nil { + return nil + } + return r.ItemClusters +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetLivetv() *int64 { + if r == nil { + return nil + } + return r.Livetv +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMachineIdentifier() any { + if r == nil { + return nil + } + return r.MachineIdentifier +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMediaProviders() *bool { + if r == nil { + return nil + } + return r.MediaProviders +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMultiuser() *bool { + if r == nil { + return nil + } + return r.Multiuser +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMusicAnalysis() *int64 { + if r == nil { + return nil + } + return r.MusicAnalysis +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMyPlex() *bool { + if r == nil { + return nil + } + return r.MyPlex +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMyPlexMappingState() any { + if r == nil { + return nil + } + return r.MyPlexMappingState +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMyPlexSigninState() any { + if r == nil { + return nil + } + return r.MyPlexSigninState +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMyPlexSubscription() *bool { + if r == nil { + return nil + } + return r.MyPlexSubscription +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetMyPlexUsername() *string { + if r == nil { + return nil + } + return r.MyPlexUsername +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetOfflineTranscode() any { + if r == nil { + return nil + } + return r.OfflineTranscode +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetOwnerFeatures() *string { + if r == nil { + return nil + } + return r.OwnerFeatures +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetPluginHost() *bool { + if r == nil { + return nil + } + return r.PluginHost +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetPushNotifications() *bool { + if r == nil { + return nil + } + return r.PushNotifications +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetReadOnlyLibraries() *bool { + if r == nil { + return nil + } + return r.ReadOnlyLibraries +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetStreamingBrainABRVersion() *int64 { + if r == nil { + return nil + } + return r.StreamingBrainABRVersion +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetStreamingBrainVersion() *int64 { + if r == nil { + return nil + } + return r.StreamingBrainVersion +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetSync() *bool { + if r == nil { + return nil + } + return r.Sync +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderActiveVideoSessions() *int64 { + if r == nil { + return nil + } + return r.TranscoderActiveVideoSessions +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderAudio() *bool { + if r == nil { + return nil + } + return r.TranscoderAudio +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderLyrics() *bool { + if r == nil { + return nil + } + return r.TranscoderLyrics +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderPhoto() *bool { + if r == nil { + return nil + } + return r.TranscoderPhoto +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderSubtitles() *bool { + if r == nil { + return nil + } + return r.TranscoderSubtitles +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderVideo() *bool { + if r == nil { + return nil + } + return r.TranscoderVideo +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderVideoBitrates() any { + if r == nil { + return nil + } + return r.TranscoderVideoBitrates +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderVideoQualities() *string { + if r == nil { + return nil + } + return r.TranscoderVideoQualities +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetTranscoderVideoResolutions() any { + if r == nil { + return nil + } + return r.TranscoderVideoResolutions +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetUpdatedAt() *int64 { + if r == nil { + return nil + } + return r.UpdatedAt +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetUpdater() *bool { + if r == nil { + return nil + } + return r.Updater +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetVoiceSearch() *bool { + if r == nil { + return nil + } + return r.VoiceSearch +} + +func (r *RequestHandlerSlashGetResponses200MediaContainer) GetDirectory() []RequestHandlerSlashGetResponses200Directory { + if r == nil { + return nil + } + return r.Directory +} + +// RequestHandlerSlashGetResponses200 - OK +type RequestHandlerSlashGetResponses200 struct { + MediaContainer *RequestHandlerSlashGetResponses200MediaContainer `json:"MediaContainer,omitempty"` +} + +func (r *RequestHandlerSlashGetResponses200) GetMediaContainer() *RequestHandlerSlashGetResponses200MediaContainer { + if r == nil { + return nil + } + return r.MediaContainer +} diff --git a/models/components/security.go b/models/components/security.go index 167129e..cbeef54 100644 --- a/models/components/security.go +++ b/models/components/security.go @@ -3,12 +3,12 @@ package components type Security struct { - AccessToken *string `security:"scheme,type=apiKey,subtype=header,name=X-Plex-Token"` + Token *string `security:"scheme,type=apiKey,subtype=header,name=X-Plex-Token"` } -func (s *Security) GetAccessToken() *string { +func (s *Security) GetToken() *string { if s == nil { return nil } - return s.AccessToken + return s.Token } diff --git a/models/components/session.go b/models/components/session.go new file mode 100644 index 0000000..49702e1 --- /dev/null +++ b/models/components/session.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// SessionLocation - The location of the client +type SessionLocation string + +const ( + SessionLocationLan SessionLocation = "lan" + SessionLocationWan SessionLocation = "wan" +) + +func (e SessionLocation) ToPointer() *SessionLocation { + return &e +} +func (e *SessionLocation) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "lan": + fallthrough + case "wan": + *e = SessionLocation(v) + return nil + default: + return fmt.Errorf("invalid value for SessionLocation: %v", v) + } +} + +// Session - Information about the playback session +type Session struct { + // The bandwidth used by this client's playback in kbps + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The id of the playback session + ID *string `json:"id,omitempty"` + // The location of the client + Location *SessionLocation `json:"location,omitempty"` +} + +func (s *Session) GetBandwidth() *int64 { + if s == nil { + return nil + } + return s.Bandwidth +} + +func (s *Session) GetID() *string { + if s == nil { + return nil + } + return s.ID +} + +func (s *Session) GetLocation() *SessionLocation { + if s == nil { + return nil + } + return s.Location +} diff --git a/models/components/setting.go b/models/components/setting.go new file mode 100644 index 0000000..92b97fd --- /dev/null +++ b/models/components/setting.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" +) + +// Type - The type of the value of this setting +type Type string + +const ( + TypeBool Type = "bool" + TypeInt Type = "int" + TypeText Type = "text" + TypeDouble Type = "double" +) + +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 "bool": + fallthrough + case "int": + fallthrough + case "text": + fallthrough + case "double": + *e = Type(v) + return nil + default: + return fmt.Errorf("invalid value for Type: %v", v) + } +} + +type DefaultType string + +const ( + DefaultTypeStr DefaultType = "str" + DefaultTypeNumber DefaultType = "number" + DefaultTypeBoolean DefaultType = "boolean" +) + +// Default - The default value of this setting +type Default struct { + Str *string `queryParam:"inline,name=default"` + Number *float64 `queryParam:"inline,name=default"` + Boolean *bool `queryParam:"inline,name=default"` + + Type DefaultType +} + +func CreateDefaultStr(str string) Default { + typ := DefaultTypeStr + + return Default{ + Str: &str, + Type: typ, + } +} + +func CreateDefaultNumber(number float64) Default { + typ := DefaultTypeNumber + + return Default{ + Number: &number, + Type: typ, + } +} + +func CreateDefaultBoolean(boolean bool) Default { + typ := DefaultTypeBoolean + + return Default{ + Boolean: &boolean, + Type: typ, + } +} + +func (u *Default) UnmarshalJSON(data []byte) error { + + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + u.Str = &str + u.Type = DefaultTypeStr + return nil + } + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { + u.Number = &number + u.Type = DefaultTypeNumber + return nil + } + + var boolean bool = false + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { + u.Boolean = &boolean + u.Type = DefaultTypeBoolean + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Default", string(data)) +} + +func (u Default) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + if u.Boolean != nil { + return utils.MarshalJSON(u.Boolean, "", true) + } + + return nil, errors.New("could not marshal union type Default: all fields are null") +} + +type ValueType string + +const ( + ValueTypeStr ValueType = "str" + ValueTypeNumber ValueType = "number" + ValueTypeBoolean ValueType = "boolean" +) + +// Value - The current value of this setting +type Value struct { + Str *string `queryParam:"inline,name=value"` + Number *float64 `queryParam:"inline,name=value"` + Boolean *bool `queryParam:"inline,name=value"` + + Type ValueType +} + +func CreateValueStr(str string) Value { + typ := ValueTypeStr + + return Value{ + Str: &str, + Type: typ, + } +} + +func CreateValueNumber(number float64) Value { + typ := ValueTypeNumber + + return Value{ + Number: &number, + Type: typ, + } +} + +func CreateValueBoolean(boolean bool) Value { + typ := ValueTypeBoolean + + return Value{ + Boolean: &boolean, + Type: typ, + } +} + +func (u *Value) UnmarshalJSON(data []byte) error { + + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + u.Str = &str + u.Type = ValueTypeStr + return nil + } + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { + u.Number = &number + u.Type = ValueTypeNumber + return nil + } + + var boolean bool = false + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { + u.Boolean = &boolean + u.Type = ValueTypeBoolean + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value", string(data)) +} + +func (u Value) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + if u.Boolean != nil { + return utils.MarshalJSON(u.Boolean, "", true) + } + + return nil, errors.New("could not marshal union type Value: all fields are null") +} + +// Setting - A configuration setting or preference +type Setting struct { + // The type of the value of this setting + Type *Type `json:"type,omitempty"` + // The default value of this setting + Default *Default `json:"default,omitempty"` + // Whether the setting is considered advanced and normally hidden from the user + Advanced *bool `json:"advanced,omitempty"` + // The possible values for this setting if restricted. The list is `|` separated with `value:name` entries. + EnumValues *string `json:"enumValues,omitempty"` + // The group name of this setting to aid in display of a hierarchy + Group *string `json:"group,omitempty"` + // Whether the setting is hidden or not + Hidden *bool `json:"hidden,omitempty"` + // The query parameter name for this setting + ID *string `json:"id,omitempty"` + // A user-friendly name for the setting + Label *string `json:"label,omitempty"` + // A description of the setting + Summary *string `json:"summary,omitempty"` + // The current value of this setting + Value *Value `json:"value,omitempty"` +} + +func (s *Setting) GetType() *Type { + if s == nil { + return nil + } + return s.Type +} + +func (s *Setting) GetDefault() *Default { + if s == nil { + return nil + } + return s.Default +} + +func (s *Setting) GetAdvanced() *bool { + if s == nil { + return nil + } + return s.Advanced +} + +func (s *Setting) GetEnumValues() *string { + if s == nil { + return nil + } + return s.EnumValues +} + +func (s *Setting) GetGroup() *string { + if s == nil { + return nil + } + return s.Group +} + +func (s *Setting) GetHidden() *bool { + if s == nil { + return nil + } + return s.Hidden +} + +func (s *Setting) GetID() *string { + if s == nil { + return nil + } + return s.ID +} + +func (s *Setting) GetLabel() *string { + if s == nil { + return nil + } + return s.Label +} + +func (s *Setting) GetSummary() *string { + if s == nil { + return nil + } + return s.Summary +} + +func (s *Setting) GetValue() *Value { + if s == nil { + return nil + } + return s.Value +} diff --git a/models/components/slashgetresponses200.go b/models/components/slashgetresponses200.go new file mode 100644 index 0000000..e89c784 --- /dev/null +++ b/models/components/slashgetresponses200.go @@ -0,0 +1,134 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SlashGetResponses200MediaContainer struct { + // The 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": true` 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": true` which used to be used to allow clients to build search dialogs on the fly. + Content *string `json:"content,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Art *string `json:"art,omitempty"` + Directory []Metadata `json:"Directory,omitempty"` + Identifier *string `json:"identifier,omitempty"` + LibrarySectionID *int64 `json:"librarySectionID,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *int64 `json:"mediaTagVersion,omitempty"` + Size *int64 `json:"size,omitempty"` + SortAsc *bool `json:"sortAsc,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Title1 *string `json:"title1,omitempty"` + ViewGroup *string `json:"viewGroup,omitempty"` + ViewMode *int64 `json:"viewMode,omitempty"` +} + +func (s *SlashGetResponses200MediaContainer) GetContent() *string { + if s == nil { + return nil + } + return s.Content +} + +func (s *SlashGetResponses200MediaContainer) GetAllowSync() *bool { + if s == nil { + return nil + } + return s.AllowSync +} + +func (s *SlashGetResponses200MediaContainer) GetArt() *string { + if s == nil { + return nil + } + return s.Art +} + +func (s *SlashGetResponses200MediaContainer) GetDirectory() []Metadata { + if s == nil { + return nil + } + return s.Directory +} + +func (s *SlashGetResponses200MediaContainer) GetIdentifier() *string { + if s == nil { + return nil + } + return s.Identifier +} + +func (s *SlashGetResponses200MediaContainer) GetLibrarySectionID() *int64 { + if s == nil { + return nil + } + return s.LibrarySectionID +} + +func (s *SlashGetResponses200MediaContainer) GetMediaTagPrefix() *string { + if s == nil { + return nil + } + return s.MediaTagPrefix +} + +func (s *SlashGetResponses200MediaContainer) GetMediaTagVersion() *int64 { + if s == nil { + return nil + } + return s.MediaTagVersion +} + +func (s *SlashGetResponses200MediaContainer) GetSize() *int64 { + if s == nil { + return nil + } + return s.Size +} + +func (s *SlashGetResponses200MediaContainer) GetSortAsc() *bool { + if s == nil { + return nil + } + return s.SortAsc +} + +func (s *SlashGetResponses200MediaContainer) GetThumb() *string { + if s == nil { + return nil + } + return s.Thumb +} + +func (s *SlashGetResponses200MediaContainer) GetTitle1() *string { + if s == nil { + return nil + } + return s.Title1 +} + +func (s *SlashGetResponses200MediaContainer) GetViewGroup() *string { + if s == nil { + return nil + } + return s.ViewGroup +} + +func (s *SlashGetResponses200MediaContainer) GetViewMode() *int64 { + if s == nil { + return nil + } + return s.ViewMode +} + +// SlashGetResponses200 - OK +type SlashGetResponses200 struct { + MediaContainer *SlashGetResponses200MediaContainer `json:"MediaContainer,omitempty"` +} + +func (s *SlashGetResponses200) GetMediaContainer() *SlashGetResponses200MediaContainer { + if s == nil { + return nil + } + return s.MediaContainer +} diff --git a/models/components/sort.go b/models/components/sort.go new file mode 100644 index 0000000..ec4323f --- /dev/null +++ b/models/components/sort.go @@ -0,0 +1,295 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" +) + +type SortPivot struct { + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Context *string `json:"context,omitempty"` + ID *string `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Symbol *string `json:"symbol,omitempty"` +} + +func (s *SortPivot) GetTitle() *string { + if s == nil { + return nil + } + return s.Title +} + +func (s *SortPivot) GetType() *string { + if s == nil { + return nil + } + return s.Type +} + +func (s *SortPivot) GetContext() *string { + if s == nil { + return nil + } + return s.Context +} + +func (s *SortPivot) GetID() *string { + if s == nil { + return nil + } + return s.ID +} + +func (s *SortPivot) GetKey() *string { + if s == nil { + return nil + } + return s.Key +} + +func (s *SortPivot) GetSymbol() *string { + if s == nil { + return nil + } + return s.Symbol +} + +// SortDefault - If present, this sort is the default and in this direction +type SortDefault string + +const ( + SortDefaultAsc SortDefault = "asc" + SortDefaultDesc SortDefault = "desc" +) + +func (e SortDefault) ToPointer() *SortDefault { + return &e +} +func (e *SortDefault) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "asc": + fallthrough + case "desc": + *e = SortDefault(v) + return nil + default: + return fmt.Errorf("invalid value for SortDefault: %v", v) + } +} + +// DefaultDirection - This default diction of this sort +type DefaultDirection string + +const ( + DefaultDirectionAsc DefaultDirection = "asc" + DefaultDirectionDesc DefaultDirection = "desc" +) + +func (e DefaultDirection) ToPointer() *DefaultDirection { + return &e +} +func (e *DefaultDirection) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "asc": + fallthrough + case "desc": + *e = DefaultDirection(v) + return nil + default: + return fmt.Errorf("invalid value for DefaultDirection: %v", v) + } +} + +// Sort - Each `Sort` object contains a description of the sort field. +type Sort struct { + // The title of the field. + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + Art *string `json:"art,omitempty"` + Content *bool `json:"content,omitempty"` + Filter *string `json:"filter,omitempty"` + HasPrefs *bool `json:"hasPrefs,omitempty"` + HasStoreServices *bool `json:"hasStoreServices,omitempty"` + HubKey *string `json:"hubKey,omitempty"` + Identifier *string `json:"identifier,omitempty"` + // The key to use in the sort field to make items sort by this item + Key *string `json:"key,omitempty"` + LastAccessedAt *int64 `json:"lastAccessedAt,omitempty"` + Pivot []SortPivot `json:"Pivot,omitempty"` + Share *int64 `json:"share,omitempty"` + Thumb *string `json:"thumb,omitempty"` + TitleBar *string `json:"titleBar,omitempty"` + // If present, this sort is the default and in this direction + Default *SortDefault `json:"default,omitempty"` + // This default diction of this sort + DefaultDirection *DefaultDirection `json:"defaultDirection,omitempty"` + // The key for sorting this field in reverse order + DescKey *string `json:"descKey,omitempty"` + // The key to use to get items sorted by this field and indexed by the first character + FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (s Sort) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *Sort) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *Sort) GetTitle() *string { + if s == nil { + return nil + } + return s.Title +} + +func (s *Sort) GetType() *string { + if s == nil { + return nil + } + return s.Type +} + +func (s *Sort) GetArt() *string { + if s == nil { + return nil + } + return s.Art +} + +func (s *Sort) GetContent() *bool { + if s == nil { + return nil + } + return s.Content +} + +func (s *Sort) GetFilter() *string { + if s == nil { + return nil + } + return s.Filter +} + +func (s *Sort) GetHasPrefs() *bool { + if s == nil { + return nil + } + return s.HasPrefs +} + +func (s *Sort) GetHasStoreServices() *bool { + if s == nil { + return nil + } + return s.HasStoreServices +} + +func (s *Sort) GetHubKey() *string { + if s == nil { + return nil + } + return s.HubKey +} + +func (s *Sort) GetIdentifier() *string { + if s == nil { + return nil + } + return s.Identifier +} + +func (s *Sort) GetKey() *string { + if s == nil { + return nil + } + return s.Key +} + +func (s *Sort) GetLastAccessedAt() *int64 { + if s == nil { + return nil + } + return s.LastAccessedAt +} + +func (s *Sort) GetPivot() []SortPivot { + if s == nil { + return nil + } + return s.Pivot +} + +func (s *Sort) GetShare() *int64 { + if s == nil { + return nil + } + return s.Share +} + +func (s *Sort) GetThumb() *string { + if s == nil { + return nil + } + return s.Thumb +} + +func (s *Sort) GetTitleBar() *string { + if s == nil { + return nil + } + return s.TitleBar +} + +func (s *Sort) GetDefault() *SortDefault { + if s == nil { + return nil + } + return s.Default +} + +func (s *Sort) GetDefaultDirection() *DefaultDirection { + if s == nil { + return nil + } + return s.DefaultDirection +} + +func (s *Sort) GetDescKey() *string { + if s == nil { + return nil + } + return s.DescKey +} + +func (s *Sort) GetFirstCharacterKey() *string { + if s == nil { + return nil + } + return s.FirstCharacterKey +} + +func (s *Sort) GetAdditionalProperties() map[string]any { + if s == nil { + return nil + } + return s.AdditionalProperties +} diff --git a/models/components/stream.go b/models/components/stream.go new file mode 100644 index 0000000..415d7ea --- /dev/null +++ b/models/components/stream.go @@ -0,0 +1,269 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/LukeHagar/plexgo/internal/utils" +) + +// Stream - `Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream. Note that photos do not have streams (mostly as an optimization). +type Stream struct { + Default *bool `json:"default,omitempty"` + AudioChannelLayout any `json:"audioChannelLayout,omitempty"` + BitDepth *int64 `json:"bitDepth,omitempty"` + Bitrate *int64 `json:"bitrate,omitempty"` + // For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video. + CanAutoSync *bool `json:"canAutoSync,omitempty"` + ChromaLocation any `json:"chromaLocation,omitempty"` + ChromaSubsampling any `json:"chromaSubsampling,omitempty"` + // The codec of the stream, such as `h264` or `aac` + Codec any `json:"codec,omitempty"` + ColorPrimaries any `json:"colorPrimaries,omitempty"` + ColorRange any `json:"colorRange,omitempty"` + ColorSpace any `json:"colorSpace,omitempty"` + ColorTrc any `json:"colorTrc,omitempty"` + // A friendly name for the stream, often comprised of the language and codec information + DisplayTitle any `json:"displayTitle,omitempty"` + FrameRate *float64 `json:"frameRate,omitempty"` + HasScalingMatrix any `json:"hasScalingMatrix,omitempty"` + Height *int64 `json:"height,omitempty"` + ID *int64 `json:"id,omitempty"` + // If the stream is part of the `Part` and not an external resource, the index of the stream within that part + Index *int64 `json:"index,omitempty"` + // If the stream is independently streamable, the key from which it can be streamed + Key any `json:"key,omitempty"` + Language any `json:"language,omitempty"` + // The three character language code for the stream contents + LanguageCode any `json:"languageCode,omitempty"` + Level *int64 `json:"level,omitempty"` + Profile any `json:"profile,omitempty"` + RefFrames *int64 `json:"refFrames,omitempty"` + SamplingRate *int64 `json:"samplingRate,omitempty"` + Selected *bool `json:"selected,omitempty"` + StreamIdentifier *int64 `json:"streamIdentifier,omitempty"` + // A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics + StreamType *int64 `json:"streamType,omitempty"` + Width *int64 `json:"width,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (s Stream) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *Stream) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *Stream) GetDefault() *bool { + if s == nil { + return nil + } + return s.Default +} + +func (s *Stream) GetAudioChannelLayout() any { + if s == nil { + return nil + } + return s.AudioChannelLayout +} + +func (s *Stream) GetBitDepth() *int64 { + if s == nil { + return nil + } + return s.BitDepth +} + +func (s *Stream) GetBitrate() *int64 { + if s == nil { + return nil + } + return s.Bitrate +} + +func (s *Stream) GetCanAutoSync() *bool { + if s == nil { + return nil + } + return s.CanAutoSync +} + +func (s *Stream) GetChromaLocation() any { + if s == nil { + return nil + } + return s.ChromaLocation +} + +func (s *Stream) GetChromaSubsampling() any { + if s == nil { + return nil + } + return s.ChromaSubsampling +} + +func (s *Stream) GetCodec() any { + if s == nil { + return nil + } + return s.Codec +} + +func (s *Stream) GetColorPrimaries() any { + if s == nil { + return nil + } + return s.ColorPrimaries +} + +func (s *Stream) GetColorRange() any { + if s == nil { + return nil + } + return s.ColorRange +} + +func (s *Stream) GetColorSpace() any { + if s == nil { + return nil + } + return s.ColorSpace +} + +func (s *Stream) GetColorTrc() any { + if s == nil { + return nil + } + return s.ColorTrc +} + +func (s *Stream) GetDisplayTitle() any { + if s == nil { + return nil + } + return s.DisplayTitle +} + +func (s *Stream) GetFrameRate() *float64 { + if s == nil { + return nil + } + return s.FrameRate +} + +func (s *Stream) GetHasScalingMatrix() any { + if s == nil { + return nil + } + return s.HasScalingMatrix +} + +func (s *Stream) GetHeight() *int64 { + if s == nil { + return nil + } + return s.Height +} + +func (s *Stream) GetID() *int64 { + if s == nil { + return nil + } + return s.ID +} + +func (s *Stream) GetIndex() *int64 { + if s == nil { + return nil + } + return s.Index +} + +func (s *Stream) GetKey() any { + if s == nil { + return nil + } + return s.Key +} + +func (s *Stream) GetLanguage() any { + if s == nil { + return nil + } + return s.Language +} + +func (s *Stream) GetLanguageCode() any { + if s == nil { + return nil + } + return s.LanguageCode +} + +func (s *Stream) GetLevel() *int64 { + if s == nil { + return nil + } + return s.Level +} + +func (s *Stream) GetProfile() any { + if s == nil { + return nil + } + return s.Profile +} + +func (s *Stream) GetRefFrames() *int64 { + if s == nil { + return nil + } + return s.RefFrames +} + +func (s *Stream) GetSamplingRate() *int64 { + if s == nil { + return nil + } + return s.SamplingRate +} + +func (s *Stream) GetSelected() *bool { + if s == nil { + return nil + } + return s.Selected +} + +func (s *Stream) GetStreamIdentifier() *int64 { + if s == nil { + return nil + } + return s.StreamIdentifier +} + +func (s *Stream) GetStreamType() *int64 { + if s == nil { + return nil + } + return s.StreamType +} + +func (s *Stream) GetWidth() *int64 { + if s == nil { + return nil + } + return s.Width +} + +func (s *Stream) GetAdditionalProperties() map[string]any { + if s == nil { + return nil + } + return s.AdditionalProperties +} diff --git a/models/components/subtitles.go b/models/components/subtitles.go new file mode 100644 index 0000000..ac9c8b4 --- /dev/null +++ b/models/components/subtitles.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Subtitles string + +const ( + SubtitlesAuto Subtitles = "auto" + SubtitlesBurn Subtitles = "burn" + SubtitlesNone Subtitles = "none" + SubtitlesSidecar Subtitles = "sidecar" + SubtitlesEmbedded Subtitles = "embedded" + SubtitlesSegmented Subtitles = "segmented" + SubtitlesUnknown Subtitles = "unknown" +) + +func (e Subtitles) ToPointer() *Subtitles { + return &e +} +func (e *Subtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + fallthrough + case "burn": + fallthrough + case "none": + fallthrough + case "sidecar": + fallthrough + case "embedded": + fallthrough + case "segmented": + fallthrough + case "unknown": + *e = Subtitles(v) + return nil + default: + return fmt.Errorf("invalid value for Subtitles: %v", v) + } +} diff --git a/models/components/tag.go b/models/components/tag.go new file mode 100644 index 0000000..8ed016c --- /dev/null +++ b/models/components/tag.go @@ -0,0 +1,92 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Tag - A variety of extra information about a metadata item is included as tags. These tags use their own element names such as `Genre`, `Writer`, `Directory`, and `Role`. Individual tag types may introduce their own extra attributes. +type Tag struct { + // Measure of the confidence of an automatic tag + Confidence *float64 `json:"confidence,omitempty"` + Context *string `json:"context,omitempty"` + // A filter parameter that can be used to query for more content that matches this tag value. + Filter any `json:"filter,omitempty"` + ID *int64 `json:"id,omitempty"` + RatingKey *string `json:"ratingKey,omitempty"` + // The role this actor played + Role any `json:"role,omitempty"` + // The value of the tag (the name) + Tag any `json:"tag,omitempty"` + // Plex identifier for this tag which can be used to fetch additional information from plex.tv + TagKey any `json:"tagKey,omitempty"` + TagType *int64 `json:"tagType,omitempty"` + Thumb any `json:"thumb,omitempty"` +} + +func (t *Tag) GetConfidence() *float64 { + if t == nil { + return nil + } + return t.Confidence +} + +func (t *Tag) GetContext() *string { + if t == nil { + return nil + } + return t.Context +} + +func (t *Tag) GetFilter() any { + if t == nil { + return nil + } + return t.Filter +} + +func (t *Tag) GetID() *int64 { + if t == nil { + return nil + } + return t.ID +} + +func (t *Tag) GetRatingKey() *string { + if t == nil { + return nil + } + return t.RatingKey +} + +func (t *Tag) GetRole() any { + if t == nil { + return nil + } + return t.Role +} + +func (t *Tag) GetTag() any { + if t == nil { + return nil + } + return t.Tag +} + +func (t *Tag) GetTagKey() any { + if t == nil { + return nil + } + return t.TagKey +} + +func (t *Tag) GetTagType() *int64 { + if t == nil { + return nil + } + return t.TagType +} + +func (t *Tag) GetThumb() any { + if t == nil { + return nil + } + return t.Thumb +} diff --git a/models/components/transcodesession.go b/models/components/transcodesession.go new file mode 100644 index 0000000..cf95216 --- /dev/null +++ b/models/components/transcodesession.go @@ -0,0 +1,119 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// TranscodeSession - The transcode session if item is currently being transcoded +type TranscodeSession struct { + Complete *bool `json:"complete,omitempty"` + Context *string `json:"context,omitempty"` + Duration *int64 `json:"duration,omitempty"` + Error *bool `json:"error,omitempty"` + Key *string `json:"key,omitempty"` + Progress *float64 `json:"progress,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Size *int64 `json:"size,omitempty"` + SourceAudioCodec *string `json:"sourceAudioCodec,omitempty"` + SourceVideoCodec *string `json:"sourceVideoCodec,omitempty"` + Speed *float64 `json:"speed,omitempty"` + Throttled *bool `json:"throttled,omitempty"` + TranscodeHwFullPipeline *bool `json:"transcodeHwFullPipeline,omitempty"` + TranscodeHwRequested *bool `json:"transcodeHwRequested,omitempty"` +} + +func (t *TranscodeSession) GetComplete() *bool { + if t == nil { + return nil + } + return t.Complete +} + +func (t *TranscodeSession) GetContext() *string { + if t == nil { + return nil + } + return t.Context +} + +func (t *TranscodeSession) GetDuration() *int64 { + if t == nil { + return nil + } + return t.Duration +} + +func (t *TranscodeSession) GetError() *bool { + if t == nil { + return nil + } + return t.Error +} + +func (t *TranscodeSession) GetKey() *string { + if t == nil { + return nil + } + return t.Key +} + +func (t *TranscodeSession) GetProgress() *float64 { + if t == nil { + return nil + } + return t.Progress +} + +func (t *TranscodeSession) GetProtocol() *string { + if t == nil { + return nil + } + return t.Protocol +} + +func (t *TranscodeSession) GetSize() *int64 { + if t == nil { + return nil + } + return t.Size +} + +func (t *TranscodeSession) GetSourceAudioCodec() *string { + if t == nil { + return nil + } + return t.SourceAudioCodec +} + +func (t *TranscodeSession) GetSourceVideoCodec() *string { + if t == nil { + return nil + } + return t.SourceVideoCodec +} + +func (t *TranscodeSession) GetSpeed() *float64 { + if t == nil { + return nil + } + return t.Speed +} + +func (t *TranscodeSession) GetThrottled() *bool { + if t == nil { + return nil + } + return t.Throttled +} + +func (t *TranscodeSession) GetTranscodeHwFullPipeline() *bool { + if t == nil { + return nil + } + return t.TranscodeHwFullPipeline +} + +func (t *TranscodeSession) GetTranscodeHwRequested() *bool { + if t == nil { + return nil + } + return t.TranscodeHwRequested +} diff --git a/models/components/transcodetype.go b/models/components/transcodetype.go new file mode 100644 index 0000000..3a4a54e --- /dev/null +++ b/models/components/transcodetype.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type TranscodeType string + +const ( + TranscodeTypeVideo TranscodeType = "video" + TranscodeTypeMusic TranscodeType = "music" + TranscodeTypeAudio TranscodeType = "audio" + TranscodeTypeSubtitles TranscodeType = "subtitles" +) + +func (e TranscodeType) ToPointer() *TranscodeType { + return &e +} +func (e *TranscodeType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "video": + fallthrough + case "music": + fallthrough + case "audio": + fallthrough + case "subtitles": + *e = TranscodeType(v) + return nil + default: + return fmt.Errorf("invalid value for TranscodeType: %v", v) + } +} diff --git a/models/components/user.go b/models/components/user.go new file mode 100644 index 0000000..71c138c --- /dev/null +++ b/models/components/user.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// User - The user playing the content +type User struct { + // The username + Title *string `json:"title,omitempty"` + // The id of the user + ID *string `json:"id,omitempty"` + // Thumb image to display for the user + Thumb *string `json:"thumb,omitempty"` +} + +func (u *User) GetTitle() *string { + if u == nil { + return nil + } + return u.Title +} + +func (u *User) GetID() *string { + if u == nil { + return nil + } + return u.ID +} + +func (u *User) GetThumb() *string { + if u == nil { + return nil + } + return u.Thumb +} diff --git a/models/operations/addcollectionitems.go b/models/operations/addcollectionitems.go new file mode 100644 index 0000000..4379577 --- /dev/null +++ b/models/operations/addcollectionitems.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddCollectionItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddCollectionItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddCollectionItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddCollectionItemsGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddCollectionItemsGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddCollectionItemsGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddCollectionItemsGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddCollectionItemsGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddCollectionItemsGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddCollectionItemsGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddCollectionItemsGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddCollectionItemsGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddCollectionItemsGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddCollectionItemsGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddCollectionItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The collection id + CollectionID int64 `pathParam:"style=simple,explode=false,name=collectionId"` + // The URI describing the items to add to this collection + URI string `queryParam:"style=form,explode=true,name=uri"` +} + +func (a AddCollectionItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddCollectionItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"collectionId", "uri"}); err != nil { + return err + } + return nil +} + +func (a *AddCollectionItemsRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddCollectionItemsRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddCollectionItemsRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddCollectionItemsRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddCollectionItemsRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddCollectionItemsRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddCollectionItemsRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddCollectionItemsRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddCollectionItemsRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddCollectionItemsRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddCollectionItemsRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddCollectionItemsRequest) GetCollectionID() int64 { + if a == nil { + return 0 + } + return a.CollectionID +} + +func (a *AddCollectionItemsRequest) GetURI() string { + if a == nil { + return "" + } + return a.URI +} + +type AddCollectionItemsResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (a *AddCollectionItemsResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddCollectionItemsResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddCollectionItemsResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddCollectionItemsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if a == nil { + return nil + } + return a.MediaContainerWithMetadata +} diff --git a/models/operations/adddevice.go b/models/operations/adddevice.go new file mode 100644 index 0000000..d284af9 --- /dev/null +++ b/models/operations/adddevice.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddDeviceGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddDeviceGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddDeviceGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddDeviceGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddDeviceGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddDeviceGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddDeviceGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddDeviceGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddDeviceGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddDeviceGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDeviceGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddDeviceGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddDeviceGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddDeviceGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddDeviceRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The URI of the device. + URI *string `queryParam:"style=form,explode=true,name=uri"` +} + +func (a AddDeviceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddDeviceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddDeviceRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddDeviceRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddDeviceRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddDeviceRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddDeviceRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddDeviceRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddDeviceRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDeviceRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddDeviceRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddDeviceRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddDeviceRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddDeviceRequest) GetURI() *string { + if a == nil { + return nil + } + return a.URI +} + +type AddDeviceResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice +} + +func (a *AddDeviceResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddDeviceResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddDeviceResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddDeviceResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if a == nil { + return nil + } + return a.MediaContainerWithDevice +} diff --git a/models/operations/adddevicetodvr.go b/models/operations/adddevicetodvr.go new file mode 100644 index 0000000..5f0b18f --- /dev/null +++ b/models/operations/adddevicetodvr.go @@ -0,0 +1,425 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddDeviceToDVRGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddDeviceToDVRGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddDeviceToDVRGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddDeviceToDVRGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddDeviceToDVRGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddDeviceToDVRGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddDeviceToDVRGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddDeviceToDVRGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddDeviceToDVRGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddDeviceToDVRGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDeviceToDVRGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddDeviceToDVRGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddDeviceToDVRGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddDeviceToDVRGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddDeviceToDVRRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` + // The ID of the device to add. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` +} + +func (a AddDeviceToDVRRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddDeviceToDVRRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"dvrId", "deviceId"}); err != nil { + return err + } + return nil +} + +func (a *AddDeviceToDVRRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddDeviceToDVRRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddDeviceToDVRRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddDeviceToDVRRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddDeviceToDVRRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddDeviceToDVRRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddDeviceToDVRRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDeviceToDVRRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddDeviceToDVRRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddDeviceToDVRRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddDeviceToDVRRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddDeviceToDVRRequest) GetDvrID() int64 { + if a == nil { + return 0 + } + return a.DvrID +} + +func (a *AddDeviceToDVRRequest) GetDeviceID() int64 { + if a == nil { + return 0 + } + return a.DeviceID +} + +// AddDeviceToDVRDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type AddDeviceToDVRDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (a *AddDeviceToDVRDVRsMediaContainer) GetIdentifier() *string { + if a == nil { + return nil + } + return a.Identifier +} + +func (a *AddDeviceToDVRDVRsMediaContainer) GetOffset() *int64 { + if a == nil { + return nil + } + return a.Offset +} + +func (a *AddDeviceToDVRDVRsMediaContainer) GetSize() *int64 { + if a == nil { + return nil + } + return a.Size +} + +func (a *AddDeviceToDVRDVRsMediaContainer) GetTotalSize() *int64 { + if a == nil { + return nil + } + return a.TotalSize +} + +func (a *AddDeviceToDVRDVRsMediaContainer) GetStatus() *int64 { + if a == nil { + return nil + } + return a.Status +} + +type AddDeviceToDVRDVR struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (a *AddDeviceToDVRDVR) GetDevice() []components.Device { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDeviceToDVRDVR) GetKey() *string { + if a == nil { + return nil + } + return a.Key +} + +func (a *AddDeviceToDVRDVR) GetLanguage() *string { + if a == nil { + return nil + } + return a.Language +} + +func (a *AddDeviceToDVRDVR) GetLineup() *string { + if a == nil { + return nil + } + return a.Lineup +} + +func (a *AddDeviceToDVRDVR) GetUUID() *string { + if a == nil { + return nil + } + return a.UUID +} + +type AddDeviceToDVRMediaContainer struct { + MediaContainer *AddDeviceToDVRDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []AddDeviceToDVRDVR `json:"DVR,omitempty"` +} + +func (a *AddDeviceToDVRMediaContainer) GetMediaContainer() *AddDeviceToDVRDVRsMediaContainer { + if a == nil { + return nil + } + return a.MediaContainer +} + +func (a *AddDeviceToDVRMediaContainer) GetDvr() []AddDeviceToDVRDVR { + if a == nil { + return nil + } + return a.Dvr +} + +// AddDeviceToDVRResponseBody - OK +type AddDeviceToDVRResponseBody struct { + MediaContainer *AddDeviceToDVRMediaContainer `json:"MediaContainer,omitempty"` +} + +func (a *AddDeviceToDVRResponseBody) GetMediaContainer() *AddDeviceToDVRMediaContainer { + if a == nil { + return nil + } + return a.MediaContainer +} + +type AddDeviceToDVRResponse 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 + // OK + Object *AddDeviceToDVRResponseBody + Headers map[string][]string +} + +func (a *AddDeviceToDVRResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddDeviceToDVRResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddDeviceToDVRResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddDeviceToDVRResponse) GetObject() *AddDeviceToDVRResponseBody { + if a == nil { + return nil + } + return a.Object +} + +func (a *AddDeviceToDVRResponse) GetHeaders() map[string][]string { + if a == nil { + return map[string][]string{} + } + return a.Headers +} diff --git a/models/operations/adddownloadqueueitems.go b/models/operations/adddownloadqueueitems.go new file mode 100644 index 0000000..1948e38 --- /dev/null +++ b/models/operations/adddownloadqueueitems.go @@ -0,0 +1,612 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddDownloadQueueItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddDownloadQueueItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddDownloadQueueItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddDownloadQueueItemsGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddDownloadQueueItemsGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddDownloadQueueItemsGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddDownloadQueueItemsGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddDownloadQueueItemsGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddDownloadQueueItemsGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddDownloadQueueItemsGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDownloadQueueItemsGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddDownloadQueueItemsGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddDownloadQueueItemsGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddDownloadQueueItemsGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddDownloadQueueItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` + // Keys to add + Keys []string `queryParam:"style=form,explode=false,name=keys"` + // Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost + // + AdvancedSubtitles *components.AdvancedSubtitles `queryParam:"style=form,explode=true,name=advancedSubtitles"` + // Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) + AudioBoost *int64 `queryParam:"style=form,explode=true,name=audioBoost"` + // Target video number of audio channels. + AudioChannelCount *int64 `queryParam:"style=form,explode=true,name=audioChannelCount"` + // Indicates the client supports ABR. + AutoAdjustQuality *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustQuality"` + // Indicates if the server should adjust subtitles based on Voice Activity Data. + AutoAdjustSubtitle *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustSubtitle"` + // Indicates the client supports direct playing the indicated content. + DirectPlay *components.BoolInt `queryParam:"style=form,explode=true,name=directPlay"` + // Indicates the client supports direct streaming the video of the indicated content. + DirectStream *components.BoolInt `queryParam:"style=form,explode=true,name=directStream"` + // Indicates the client supports direct streaming the audio of the indicated content. + DirectStreamAudio *components.BoolInt `queryParam:"style=form,explode=true,name=directStreamAudio"` + // Indicates if resolution should be adjusted for orientation. + DisableResolutionRotation *components.BoolInt `queryParam:"style=form,explode=true,name=disableResolutionRotation"` + // Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 + HasMDE *components.BoolInt `queryParam:"style=form,explode=true,name=hasMDE"` + // Network type of the client, can be used to help determine target bitrate. + Location *components.Location `queryParam:"style=form,explode=true,name=location"` + // Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. + MediaBufferSize *int64 `queryParam:"style=form,explode=true,name=mediaBufferSize"` + // Index of the media to transcode. -1 or not specified indicates let the server choose. + MediaIndex *int64 `queryParam:"style=form,explode=true,name=mediaIndex"` + // Target bitrate for audio only files (in kbps, used to transcode). + MusicBitrate *int64 `queryParam:"style=form,explode=true,name=musicBitrate"` + // Offset from the start of the media (in seconds). + Offset *float64 `queryParam:"style=form,explode=true,name=offset"` + // Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode + PartIndex *int64 `queryParam:"style=form,explode=true,name=partIndex"` + // Internal PMS path of the media to transcode. + Path *string `queryParam:"style=form,explode=true,name=path"` + // Maximum bitrate (in kbps) to use in ABR. + PeakBitrate *int64 `queryParam:"style=form,explode=true,name=peakBitrate"` + // Target photo resolution. + PhotoResolution *string `queryParam:"style=form,explode=true,name=photoResolution"` + // Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + // + Protocol *components.Protocol `queryParam:"style=form,explode=true,name=protocol"` + // Number of seconds to include in each transcoded segment + SecondsPerSegment *int64 `queryParam:"style=form,explode=true,name=secondsPerSegment"` + // Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) + SubtitleSize *int64 `queryParam:"style=form,explode=true,name=subtitleSize"` + // Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + // + Subtitles *components.Subtitles `queryParam:"style=form,explode=true,name=subtitles"` + // Target video bitrate (in kbps). + VideoBitrate *int64 `queryParam:"style=form,explode=true,name=videoBitrate"` + // Target photo quality. + VideoQuality *int64 `queryParam:"style=form,explode=true,name=videoQuality"` + // Target maximum video resolution. + VideoResolution *string `queryParam:"style=form,explode=true,name=videoResolution"` +} + +func (a AddDownloadQueueItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddDownloadQueueItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"queueId", "keys"}); err != nil { + return err + } + return nil +} + +func (a *AddDownloadQueueItemsRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddDownloadQueueItemsRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddDownloadQueueItemsRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddDownloadQueueItemsRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddDownloadQueueItemsRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddDownloadQueueItemsRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddDownloadQueueItemsRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddDownloadQueueItemsRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddDownloadQueueItemsRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddDownloadQueueItemsRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddDownloadQueueItemsRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddDownloadQueueItemsRequest) GetQueueID() int64 { + if a == nil { + return 0 + } + return a.QueueID +} + +func (a *AddDownloadQueueItemsRequest) GetKeys() []string { + if a == nil { + return []string{} + } + return a.Keys +} + +func (a *AddDownloadQueueItemsRequest) GetAdvancedSubtitles() *components.AdvancedSubtitles { + if a == nil { + return nil + } + return a.AdvancedSubtitles +} + +func (a *AddDownloadQueueItemsRequest) GetAudioBoost() *int64 { + if a == nil { + return nil + } + return a.AudioBoost +} + +func (a *AddDownloadQueueItemsRequest) GetAudioChannelCount() *int64 { + if a == nil { + return nil + } + return a.AudioChannelCount +} + +func (a *AddDownloadQueueItemsRequest) GetAutoAdjustQuality() *components.BoolInt { + if a == nil { + return nil + } + return a.AutoAdjustQuality +} + +func (a *AddDownloadQueueItemsRequest) GetAutoAdjustSubtitle() *components.BoolInt { + if a == nil { + return nil + } + return a.AutoAdjustSubtitle +} + +func (a *AddDownloadQueueItemsRequest) GetDirectPlay() *components.BoolInt { + if a == nil { + return nil + } + return a.DirectPlay +} + +func (a *AddDownloadQueueItemsRequest) GetDirectStream() *components.BoolInt { + if a == nil { + return nil + } + return a.DirectStream +} + +func (a *AddDownloadQueueItemsRequest) GetDirectStreamAudio() *components.BoolInt { + if a == nil { + return nil + } + return a.DirectStreamAudio +} + +func (a *AddDownloadQueueItemsRequest) GetDisableResolutionRotation() *components.BoolInt { + if a == nil { + return nil + } + return a.DisableResolutionRotation +} + +func (a *AddDownloadQueueItemsRequest) GetHasMDE() *components.BoolInt { + if a == nil { + return nil + } + return a.HasMDE +} + +func (a *AddDownloadQueueItemsRequest) GetLocation() *components.Location { + if a == nil { + return nil + } + return a.Location +} + +func (a *AddDownloadQueueItemsRequest) GetMediaBufferSize() *int64 { + if a == nil { + return nil + } + return a.MediaBufferSize +} + +func (a *AddDownloadQueueItemsRequest) GetMediaIndex() *int64 { + if a == nil { + return nil + } + return a.MediaIndex +} + +func (a *AddDownloadQueueItemsRequest) GetMusicBitrate() *int64 { + if a == nil { + return nil + } + return a.MusicBitrate +} + +func (a *AddDownloadQueueItemsRequest) GetOffset() *float64 { + if a == nil { + return nil + } + return a.Offset +} + +func (a *AddDownloadQueueItemsRequest) GetPartIndex() *int64 { + if a == nil { + return nil + } + return a.PartIndex +} + +func (a *AddDownloadQueueItemsRequest) GetPath() *string { + if a == nil { + return nil + } + return a.Path +} + +func (a *AddDownloadQueueItemsRequest) GetPeakBitrate() *int64 { + if a == nil { + return nil + } + return a.PeakBitrate +} + +func (a *AddDownloadQueueItemsRequest) GetPhotoResolution() *string { + if a == nil { + return nil + } + return a.PhotoResolution +} + +func (a *AddDownloadQueueItemsRequest) GetProtocol() *components.Protocol { + if a == nil { + return nil + } + return a.Protocol +} + +func (a *AddDownloadQueueItemsRequest) GetSecondsPerSegment() *int64 { + if a == nil { + return nil + } + return a.SecondsPerSegment +} + +func (a *AddDownloadQueueItemsRequest) GetSubtitleSize() *int64 { + if a == nil { + return nil + } + return a.SubtitleSize +} + +func (a *AddDownloadQueueItemsRequest) GetSubtitles() *components.Subtitles { + if a == nil { + return nil + } + return a.Subtitles +} + +func (a *AddDownloadQueueItemsRequest) GetVideoBitrate() *int64 { + if a == nil { + return nil + } + return a.VideoBitrate +} + +func (a *AddDownloadQueueItemsRequest) GetVideoQuality() *int64 { + if a == nil { + return nil + } + return a.VideoQuality +} + +func (a *AddDownloadQueueItemsRequest) GetVideoResolution() *string { + if a == nil { + return nil + } + return a.VideoResolution +} + +type AddedQueueItems struct { + // The queue item id that was added or the existing one if an item already exists in this queue with the same parameters + ID *int64 `json:"id,omitempty"` + // The key added to the queue + Key *string `json:"key,omitempty"` +} + +func (a *AddedQueueItems) GetID() *int64 { + if a == nil { + return nil + } + return a.ID +} + +func (a *AddedQueueItems) GetKey() *string { + if a == nil { + return nil + } + return a.Key +} + +// AddDownloadQueueItemsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type AddDownloadQueueItemsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + AddedQueueItems []AddedQueueItems `json:"AddedQueueItems,omitempty"` +} + +func (a *AddDownloadQueueItemsMediaContainer) GetIdentifier() *string { + if a == nil { + return nil + } + return a.Identifier +} + +func (a *AddDownloadQueueItemsMediaContainer) GetOffset() *int64 { + if a == nil { + return nil + } + return a.Offset +} + +func (a *AddDownloadQueueItemsMediaContainer) GetSize() *int64 { + if a == nil { + return nil + } + return a.Size +} + +func (a *AddDownloadQueueItemsMediaContainer) GetTotalSize() *int64 { + if a == nil { + return nil + } + return a.TotalSize +} + +func (a *AddDownloadQueueItemsMediaContainer) GetAddedQueueItems() []AddedQueueItems { + if a == nil { + return nil + } + return a.AddedQueueItems +} + +// AddDownloadQueueItemsResponseBody - OK +type AddDownloadQueueItemsResponseBody struct { + MediaContainer *AddDownloadQueueItemsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (a *AddDownloadQueueItemsResponseBody) GetMediaContainer() *AddDownloadQueueItemsMediaContainer { + if a == nil { + return nil + } + return a.MediaContainer +} + +type AddDownloadQueueItemsResponse 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 + // OK + Object *AddDownloadQueueItemsResponseBody +} + +func (a *AddDownloadQueueItemsResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddDownloadQueueItemsResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddDownloadQueueItemsResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddDownloadQueueItemsResponse) GetObject() *AddDownloadQueueItemsResponseBody { + if a == nil { + return nil + } + return a.Object +} diff --git a/models/operations/addextras.go b/models/operations/addextras.go new file mode 100644 index 0000000..ba3bb97 --- /dev/null +++ b/models/operations/addextras.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddExtrasGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddExtrasGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddExtrasGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddExtrasGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddExtrasGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddExtrasGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddExtrasGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddExtrasGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddExtrasGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddExtrasGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddExtrasGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddExtrasGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddExtrasGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddExtrasGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddExtrasRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // The metadata type of the extra + ExtraType *int64 `queryParam:"style=form,explode=true,name=extraType"` + // The URL of the extra + URL string `queryParam:"style=form,explode=true,name=url"` + // The title to filter by or assign + Title *string `queryParam:"style=form,explode=true,name=title"` +} + +func (a AddExtrasRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddExtrasRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"ids", "url"}); err != nil { + return err + } + return nil +} + +func (a *AddExtrasRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddExtrasRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddExtrasRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddExtrasRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddExtrasRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddExtrasRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddExtrasRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddExtrasRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddExtrasRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddExtrasRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddExtrasRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddExtrasRequest) GetIds() string { + if a == nil { + return "" + } + return a.Ids +} + +func (a *AddExtrasRequest) GetExtraType() *int64 { + if a == nil { + return nil + } + return a.ExtraType +} + +func (a *AddExtrasRequest) GetURL() string { + if a == nil { + return "" + } + return a.URL +} + +func (a *AddExtrasRequest) GetTitle() *string { + if a == nil { + return nil + } + return a.Title +} + +type AddExtrasResponse 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 (a *AddExtrasResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddExtrasResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddExtrasResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} diff --git a/models/operations/addlineup.go b/models/operations/addlineup.go new file mode 100644 index 0000000..266759f --- /dev/null +++ b/models/operations/addlineup.go @@ -0,0 +1,425 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddLineupGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddLineupGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddLineupGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddLineupGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddLineupGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddLineupGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddLineupGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddLineupGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddLineupGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddLineupGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddLineupGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddLineupGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddLineupGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddLineupGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddLineupRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` + // The lineup to delete + Lineup string `queryParam:"style=form,explode=true,name=lineup"` +} + +func (a AddLineupRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddLineupRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"dvrId", "lineup"}); err != nil { + return err + } + return nil +} + +func (a *AddLineupRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddLineupRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddLineupRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddLineupRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddLineupRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddLineupRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddLineupRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddLineupRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddLineupRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddLineupRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddLineupRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddLineupRequest) GetDvrID() int64 { + if a == nil { + return 0 + } + return a.DvrID +} + +func (a *AddLineupRequest) GetLineup() string { + if a == nil { + return "" + } + return a.Lineup +} + +// AddLineupDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type AddLineupDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (a *AddLineupDVRsMediaContainer) GetIdentifier() *string { + if a == nil { + return nil + } + return a.Identifier +} + +func (a *AddLineupDVRsMediaContainer) GetOffset() *int64 { + if a == nil { + return nil + } + return a.Offset +} + +func (a *AddLineupDVRsMediaContainer) GetSize() *int64 { + if a == nil { + return nil + } + return a.Size +} + +func (a *AddLineupDVRsMediaContainer) GetTotalSize() *int64 { + if a == nil { + return nil + } + return a.TotalSize +} + +func (a *AddLineupDVRsMediaContainer) GetStatus() *int64 { + if a == nil { + return nil + } + return a.Status +} + +type AddLineupDVR struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (a *AddLineupDVR) GetDevice() []components.Device { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddLineupDVR) GetKey() *string { + if a == nil { + return nil + } + return a.Key +} + +func (a *AddLineupDVR) GetLanguage() *string { + if a == nil { + return nil + } + return a.Language +} + +func (a *AddLineupDVR) GetLineup() *string { + if a == nil { + return nil + } + return a.Lineup +} + +func (a *AddLineupDVR) GetUUID() *string { + if a == nil { + return nil + } + return a.UUID +} + +type AddLineupMediaContainer struct { + MediaContainer *AddLineupDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []AddLineupDVR `json:"DVR,omitempty"` +} + +func (a *AddLineupMediaContainer) GetMediaContainer() *AddLineupDVRsMediaContainer { + if a == nil { + return nil + } + return a.MediaContainer +} + +func (a *AddLineupMediaContainer) GetDvr() []AddLineupDVR { + if a == nil { + return nil + } + return a.Dvr +} + +// AddLineupResponseBody - OK +type AddLineupResponseBody struct { + MediaContainer *AddLineupMediaContainer `json:"MediaContainer,omitempty"` +} + +func (a *AddLineupResponseBody) GetMediaContainer() *AddLineupMediaContainer { + if a == nil { + return nil + } + return a.MediaContainer +} + +type AddLineupResponse 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 + // OK + Object *AddLineupResponseBody + Headers map[string][]string +} + +func (a *AddLineupResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddLineupResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddLineupResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddLineupResponse) GetObject() *AddLineupResponseBody { + if a == nil { + return nil + } + return a.Object +} + +func (a *AddLineupResponse) GetHeaders() map[string][]string { + if a == nil { + return map[string][]string{} + } + return a.Headers +} diff --git a/models/operations/addplaylistcontents.go b/models/operations/addplaylistcontents.go deleted file mode 100644 index 50ad94a..0000000 --- a/models/operations/addplaylistcontents.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (a *AddPlaylistContentsRequest) GetPlaylistID() float64 { - if a == nil { - return 0.0 - } - return a.PlaylistID -} - -func (a *AddPlaylistContentsRequest) GetURI() string { - if a == nil { - return "" - } - return a.URI -} - -func (a *AddPlaylistContentsRequest) GetPlayQueueID() *float64 { - if a == nil { - return nil - } - return a.PlayQueueID -} - -type AddPlaylistContentsMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - GUID *string `json:"guid,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - Summary *string `json:"summary,omitempty"` - Smart *bool `json:"smart,omitempty"` - PlaylistType *string `json:"playlistType,omitempty"` - Composite *string `json:"composite,omitempty"` - Duration *int `json:"duration,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` -} - -func (a *AddPlaylistContentsMetadata) GetRatingKey() *string { - if a == nil { - return nil - } - return a.RatingKey -} - -func (a *AddPlaylistContentsMetadata) GetKey() *string { - if a == nil { - return nil - } - return a.Key -} - -func (a *AddPlaylistContentsMetadata) GetGUID() *string { - if a == nil { - return nil - } - return a.GUID -} - -func (a *AddPlaylistContentsMetadata) GetType() *string { - if a == nil { - return nil - } - return a.Type -} - -func (a *AddPlaylistContentsMetadata) GetTitle() *string { - if a == nil { - return nil - } - return a.Title -} - -func (a *AddPlaylistContentsMetadata) GetSummary() *string { - if a == nil { - return nil - } - return a.Summary -} - -func (a *AddPlaylistContentsMetadata) GetSmart() *bool { - if a == nil { - return nil - } - return a.Smart -} - -func (a *AddPlaylistContentsMetadata) GetPlaylistType() *string { - if a == nil { - return nil - } - return a.PlaylistType -} - -func (a *AddPlaylistContentsMetadata) GetComposite() *string { - if a == nil { - return nil - } - return a.Composite -} - -func (a *AddPlaylistContentsMetadata) GetDuration() *int { - if a == nil { - return nil - } - return a.Duration -} - -func (a *AddPlaylistContentsMetadata) GetLeafCount() *int { - if a == nil { - return nil - } - return a.LeafCount -} - -func (a *AddPlaylistContentsMetadata) GetAddedAt() *int { - if a == nil { - return nil - } - return a.AddedAt -} - -func (a *AddPlaylistContentsMetadata) GetUpdatedAt() *int { - if a == nil { - return nil - } - return a.UpdatedAt -} - -type AddPlaylistContentsMediaContainer struct { - Size *int `json:"size,omitempty"` - LeafCountAdded *int `json:"leafCountAdded,omitempty"` - LeafCountRequested *int `json:"leafCountRequested,omitempty"` - Metadata []AddPlaylistContentsMetadata `json:"Metadata,omitempty"` -} - -func (a *AddPlaylistContentsMediaContainer) GetSize() *int { - if a == nil { - return nil - } - return a.Size -} - -func (a *AddPlaylistContentsMediaContainer) GetLeafCountAdded() *int { - if a == nil { - return nil - } - return a.LeafCountAdded -} - -func (a *AddPlaylistContentsMediaContainer) GetLeafCountRequested() *int { - if a == nil { - return nil - } - return a.LeafCountRequested -} - -func (a *AddPlaylistContentsMediaContainer) GetMetadata() []AddPlaylistContentsMetadata { - if a == nil { - return nil - } - return a.Metadata -} - -// AddPlaylistContentsResponseBody - Playlist Updated -type AddPlaylistContentsResponseBody struct { - MediaContainer *AddPlaylistContentsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (a *AddPlaylistContentsResponseBody) GetMediaContainer() *AddPlaylistContentsMediaContainer { - if a == nil { - return nil - } - return a.MediaContainer -} - -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 - // Playlist Updated - Object *AddPlaylistContentsResponseBody -} - -func (a *AddPlaylistContentsResponse) GetContentType() string { - if a == nil { - return "" - } - return a.ContentType -} - -func (a *AddPlaylistContentsResponse) GetStatusCode() int { - if a == nil { - return 0 - } - return a.StatusCode -} - -func (a *AddPlaylistContentsResponse) GetRawResponse() *http.Response { - if a == nil { - return nil - } - return a.RawResponse -} - -func (a *AddPlaylistContentsResponse) GetObject() *AddPlaylistContentsResponseBody { - if a == nil { - return nil - } - return a.Object -} diff --git a/models/operations/addplaylistitems.go b/models/operations/addplaylistitems.go new file mode 100644 index 0000000..de19187 --- /dev/null +++ b/models/operations/addplaylistitems.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddPlaylistItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddPlaylistItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddPlaylistItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddPlaylistItemsGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddPlaylistItemsGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddPlaylistItemsGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddPlaylistItemsGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddPlaylistItemsGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddPlaylistItemsGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddPlaylistItemsGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddPlaylistItemsGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddPlaylistItemsGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddPlaylistItemsGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddPlaylistItemsGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddPlaylistItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `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 *int64 `queryParam:"style=form,explode=true,name=playQueueID"` +} + +func (a AddPlaylistItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddPlaylistItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (a *AddPlaylistItemsRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddPlaylistItemsRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddPlaylistItemsRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddPlaylistItemsRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddPlaylistItemsRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddPlaylistItemsRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddPlaylistItemsRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddPlaylistItemsRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddPlaylistItemsRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddPlaylistItemsRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddPlaylistItemsRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddPlaylistItemsRequest) GetPlaylistID() int64 { + if a == nil { + return 0 + } + return a.PlaylistID +} + +func (a *AddPlaylistItemsRequest) GetURI() *string { + if a == nil { + return nil + } + return a.URI +} + +func (a *AddPlaylistItemsRequest) GetPlayQueueID() *int64 { + if a == nil { + return nil + } + return a.PlayQueueID +} + +type AddPlaylistItemsResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (a *AddPlaylistItemsResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddPlaylistItemsResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddPlaylistItemsResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddPlaylistItemsResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if a == nil { + return nil + } + return a.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/addprovider.go b/models/operations/addprovider.go new file mode 100644 index 0000000..4a0cdf7 --- /dev/null +++ b/models/operations/addprovider.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddProviderGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddProviderGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddProviderGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddProviderGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddProviderGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddProviderGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddProviderGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddProviderGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddProviderGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddProviderGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddProviderGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddProviderGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddProviderGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddProviderGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddProviderRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The URL of the media provider to add. + URL string `queryParam:"style=form,explode=true,name=url"` +} + +func (a AddProviderRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddProviderRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"url"}); err != nil { + return err + } + return nil +} + +func (a *AddProviderRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddProviderRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddProviderRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddProviderRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddProviderRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddProviderRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddProviderRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddProviderRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddProviderRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddProviderRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddProviderRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddProviderRequest) GetURL() string { + if a == nil { + return "" + } + return a.URL +} + +type AddProviderResponse 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 (a *AddProviderResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddProviderResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddProviderResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} diff --git a/models/operations/addsection.go b/models/operations/addsection.go new file mode 100644 index 0000000..ca0fbb4 --- /dev/null +++ b/models/operations/addsection.go @@ -0,0 +1,368 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddSectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddSectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddSectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddSectionGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddSectionGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddSectionGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddSectionGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddSectionGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddSectionGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddSectionGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddSectionGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddSectionGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddSectionGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddSectionGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +// QueryParamPrefs - The preferences for this section +type QueryParamPrefs struct { +} + +type AddSectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The name of the new section + Name string `queryParam:"style=form,explode=true,name=name"` + // The type of library section + Type int64 `queryParam:"style=form,explode=true,name=type"` + // The scanner this section should use + Scanner *string `queryParam:"style=form,explode=true,name=scanner"` + // The agent this section should use for metadata + Agent string `queryParam:"style=form,explode=true,name=agent"` + // The agent group id for this section + MetadataAgentProviderGroupID *string `queryParam:"style=form,explode=true,name=metadataAgentProviderGroupId"` + // The language of this section + Language string `queryParam:"style=form,explode=true,name=language"` + // The locations on disk to add to this section + Locations []string `queryParam:"style=form,explode=true,name=locations"` + // The preferences for this section + Prefs *QueryParamPrefs `queryParam:"style=deepObject,explode=true,name=prefs"` + // If set, paths are relative to `Media Upload` path + Relative *components.BoolInt `queryParam:"style=form,explode=true,name=relative"` + // If set, import media from iTunes. + ImportFromiTunes *components.BoolInt `queryParam:"style=form,explode=true,name=importFromiTunes"` +} + +func (a AddSectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddSectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"name", "type", "agent", "language"}); err != nil { + return err + } + return nil +} + +func (a *AddSectionRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddSectionRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddSectionRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddSectionRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddSectionRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddSectionRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddSectionRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddSectionRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddSectionRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddSectionRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddSectionRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddSectionRequest) GetName() string { + if a == nil { + return "" + } + return a.Name +} + +func (a *AddSectionRequest) GetType() int64 { + if a == nil { + return 0 + } + return a.Type +} + +func (a *AddSectionRequest) GetScanner() *string { + if a == nil { + return nil + } + return a.Scanner +} + +func (a *AddSectionRequest) GetAgent() string { + if a == nil { + return "" + } + return a.Agent +} + +func (a *AddSectionRequest) GetMetadataAgentProviderGroupID() *string { + if a == nil { + return nil + } + return a.MetadataAgentProviderGroupID +} + +func (a *AddSectionRequest) GetLanguage() string { + if a == nil { + return "" + } + return a.Language +} + +func (a *AddSectionRequest) GetLocations() []string { + if a == nil { + return nil + } + return a.Locations +} + +func (a *AddSectionRequest) GetPrefs() *QueryParamPrefs { + if a == nil { + return nil + } + return a.Prefs +} + +func (a *AddSectionRequest) GetRelative() *components.BoolInt { + if a == nil { + return nil + } + return a.Relative +} + +func (a *AddSectionRequest) GetImportFromiTunes() *components.BoolInt { + if a == nil { + return nil + } + return a.ImportFromiTunes +} + +type AddSectionResponse 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 + // OK + SlashGetResponses200 *components.SlashGetResponses200 +} + +func (a *AddSectionResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddSectionResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddSectionResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddSectionResponse) GetSlashGetResponses200() *components.SlashGetResponses200 { + if a == nil { + return nil + } + return a.SlashGetResponses200 +} diff --git a/models/operations/addsubtitles.go b/models/operations/addsubtitles.go new file mode 100644 index 0000000..1f5aa88 --- /dev/null +++ b/models/operations/addsubtitles.go @@ -0,0 +1,330 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddSubtitlesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddSubtitlesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddSubtitlesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddSubtitlesGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddSubtitlesGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddSubtitlesGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddSubtitlesGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddSubtitlesGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddSubtitlesGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddSubtitlesGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddSubtitlesGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddSubtitlesGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddSubtitlesGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddSubtitlesGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddSubtitlesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Title *string `queryParam:"style=form,explode=true,name=title"` + Language *string `queryParam:"style=form,explode=true,name=language"` + MediaItemID *int64 `queryParam:"style=form,explode=true,name=mediaItemID"` + // The URL of the subtitle. If not provided, the contents of the subtitle must be in the post body + URL *string `queryParam:"style=form,explode=true,name=url"` + Format *string `queryParam:"style=form,explode=true,name=format"` + Forced *components.BoolInt `queryParam:"style=form,explode=true,name=forced"` + HearingImpaired *components.BoolInt `queryParam:"style=form,explode=true,name=hearingImpaired"` +} + +func (a AddSubtitlesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddSubtitlesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (a *AddSubtitlesRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddSubtitlesRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddSubtitlesRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddSubtitlesRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddSubtitlesRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddSubtitlesRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddSubtitlesRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddSubtitlesRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddSubtitlesRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddSubtitlesRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddSubtitlesRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddSubtitlesRequest) GetIds() string { + if a == nil { + return "" + } + return a.Ids +} + +func (a *AddSubtitlesRequest) GetTitle() *string { + if a == nil { + return nil + } + return a.Title +} + +func (a *AddSubtitlesRequest) GetLanguage() *string { + if a == nil { + return nil + } + return a.Language +} + +func (a *AddSubtitlesRequest) GetMediaItemID() *int64 { + if a == nil { + return nil + } + return a.MediaItemID +} + +func (a *AddSubtitlesRequest) GetURL() *string { + if a == nil { + return nil + } + return a.URL +} + +func (a *AddSubtitlesRequest) GetFormat() *string { + if a == nil { + return nil + } + return a.Format +} + +func (a *AddSubtitlesRequest) GetForced() *components.BoolInt { + if a == nil { + return nil + } + return a.Forced +} + +func (a *AddSubtitlesRequest) GetHearingImpaired() *components.BoolInt { + if a == nil { + return nil + } + return a.HearingImpaired +} + +type AddSubtitlesResponse 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 (a *AddSubtitlesResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddSubtitlesResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddSubtitlesResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} diff --git a/models/operations/addtoplayqueue.go b/models/operations/addtoplayqueue.go new file mode 100644 index 0000000..dcd883e --- /dev/null +++ b/models/operations/addtoplayqueue.go @@ -0,0 +1,310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AddToPlayQueueGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AddToPlayQueueGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddToPlayQueueGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AddToPlayQueueGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddToPlayQueueGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddToPlayQueueGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddToPlayQueueGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddToPlayQueueGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddToPlayQueueGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddToPlayQueueGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddToPlayQueueGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddToPlayQueueGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddToPlayQueueGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddToPlayQueueGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AddToPlayQueueRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` + // The content URI for what we're adding to the queue. + URI *string `queryParam:"style=form,explode=true,name=uri"` + // The ID of the playlist to add to the playQueue. + PlaylistID *string `queryParam:"style=form,explode=true,name=playlistID"` + // Play this item next (defaults to 0 - queueing at the end of manually queued items). + Next *components.BoolInt `queryParam:"style=form,explode=true,name=next"` +} + +func (a AddToPlayQueueRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddToPlayQueueRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"playQueueId"}); err != nil { + return err + } + return nil +} + +func (a *AddToPlayQueueRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AddToPlayQueueRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AddToPlayQueueRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AddToPlayQueueRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AddToPlayQueueRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AddToPlayQueueRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AddToPlayQueueRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AddToPlayQueueRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AddToPlayQueueRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AddToPlayQueueRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AddToPlayQueueRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AddToPlayQueueRequest) GetPlayQueueID() int64 { + if a == nil { + return 0 + } + return a.PlayQueueID +} + +func (a *AddToPlayQueueRequest) GetURI() *string { + if a == nil { + return nil + } + return a.URI +} + +func (a *AddToPlayQueueRequest) GetPlaylistID() *string { + if a == nil { + return nil + } + return a.PlaylistID +} + +func (a *AddToPlayQueueRequest) GetNext() *components.BoolInt { + if a == nil { + return nil + } + return a.Next +} + +type AddToPlayQueueResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (a *AddToPlayQueueResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AddToPlayQueueResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AddToPlayQueueResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AddToPlayQueueResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if a == nil { + return nil + } + return a.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/analyzemetadata.go b/models/operations/analyzemetadata.go new file mode 100644 index 0000000..84a308d --- /dev/null +++ b/models/operations/analyzemetadata.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AnalyzeMetadataGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AnalyzeMetadataGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnalyzeMetadataGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnalyzeMetadataGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AnalyzeMetadataGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AnalyzeMetadataGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AnalyzeMetadataGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AnalyzeMetadataGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AnalyzeMetadataGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AnalyzeMetadataGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AnalyzeMetadataGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AnalyzeMetadataGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AnalyzeMetadataGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AnalyzeMetadataGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AnalyzeMetadataRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // Set the offset to be used for thumbnails + ThumbOffset *float64 `queryParam:"style=form,explode=true,name=thumbOffset"` + // Set the offset to be used for artwork + ArtOffset *float64 `queryParam:"style=form,explode=true,name=artOffset"` +} + +func (a AnalyzeMetadataRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnalyzeMetadataRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (a *AnalyzeMetadataRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AnalyzeMetadataRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AnalyzeMetadataRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AnalyzeMetadataRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AnalyzeMetadataRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AnalyzeMetadataRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AnalyzeMetadataRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AnalyzeMetadataRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AnalyzeMetadataRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AnalyzeMetadataRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AnalyzeMetadataRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AnalyzeMetadataRequest) GetIds() string { + if a == nil { + return "" + } + return a.Ids +} + +func (a *AnalyzeMetadataRequest) GetThumbOffset() *float64 { + if a == nil { + return nil + } + return a.ThumbOffset +} + +func (a *AnalyzeMetadataRequest) GetArtOffset() *float64 { + if a == nil { + return nil + } + return a.ArtOffset +} + +type AnalyzeMetadataResponse 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 (a *AnalyzeMetadataResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AnalyzeMetadataResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AnalyzeMetadataResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} diff --git a/models/operations/applyupdates.go b/models/operations/applyupdates.go index 13cfac8..66de249 100644 --- a/models/operations/applyupdates.go +++ b/models/operations/applyupdates.go @@ -3,80 +3,249 @@ package operations import ( - "encoding/json" - "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "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 +type ApplyUpdatesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (e *Tonight) UnmarshalJSON(data []byte) error { - var v int64 - if err := json.Unmarshal(data, &v); err != nil { + +func (a ApplyUpdatesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyUpdatesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); 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) - } + return nil } -// Skip - Indicate that the latest version should be marked as skipped. The [Release] 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) +func (a *ApplyUpdatesGlobals) GetAccepts() *components.Accepts { + if a == nil { return nil - default: - return fmt.Errorf("invalid value for Skip: %v", v) } + return a.Accepts +} + +func (a *ApplyUpdatesGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *ApplyUpdatesGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *ApplyUpdatesGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *ApplyUpdatesGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *ApplyUpdatesGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *ApplyUpdatesGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *ApplyUpdatesGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *ApplyUpdatesGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *ApplyUpdatesGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *ApplyUpdatesGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace } 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 [Release] entry for this version will have the `state` set to `skipped`. - Skip *Skip `queryParam:"style=form,explode=true,name=skip"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 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 immediately. + Tonight *components.BoolInt `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 *components.BoolInt `queryParam:"style=form,explode=true,name=skip"` } -func (a *ApplyUpdatesRequest) GetTonight() *Tonight { +func (a ApplyUpdatesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyUpdatesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyUpdatesRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *ApplyUpdatesRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *ApplyUpdatesRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *ApplyUpdatesRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *ApplyUpdatesRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *ApplyUpdatesRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *ApplyUpdatesRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *ApplyUpdatesRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *ApplyUpdatesRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *ApplyUpdatesRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *ApplyUpdatesRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *ApplyUpdatesRequest) GetTonight() *components.BoolInt { if a == nil { return nil } return a.Tonight } -func (a *ApplyUpdatesRequest) GetSkip() *Skip { +func (a *ApplyUpdatesRequest) GetSkip() *components.BoolInt { if a == nil { return nil } diff --git a/models/operations/autocomplete.go b/models/operations/autocomplete.go new file mode 100644 index 0000000..5414851 --- /dev/null +++ b/models/operations/autocomplete.go @@ -0,0 +1,318 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type AutocompleteGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (a AutocompleteGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AutocompleteGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AutocompleteGlobals) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AutocompleteGlobals) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AutocompleteGlobals) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AutocompleteGlobals) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AutocompleteGlobals) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AutocompleteGlobals) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AutocompleteGlobals) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AutocompleteGlobals) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AutocompleteGlobals) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AutocompleteGlobals) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AutocompleteGlobals) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +type AutocompleteRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Item type + Type *int64 `queryParam:"style=form,explode=true,name=type"` + // The "field" stands in for any field, the value is a partial string for matching + FieldQuery *string `queryParam:"style=form,explode=true,name=field.query"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` +} + +func (a AutocompleteRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AutocompleteRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (a *AutocompleteRequest) GetAccepts() *components.Accepts { + if a == nil { + return nil + } + return a.Accepts +} + +func (a *AutocompleteRequest) GetClientIdentifier() *string { + if a == nil { + return nil + } + return a.ClientIdentifier +} + +func (a *AutocompleteRequest) GetProduct() *string { + if a == nil { + return nil + } + return a.Product +} + +func (a *AutocompleteRequest) GetVersion() *string { + if a == nil { + return nil + } + return a.Version +} + +func (a *AutocompleteRequest) GetPlatform() *string { + if a == nil { + return nil + } + return a.Platform +} + +func (a *AutocompleteRequest) GetPlatformVersion() *string { + if a == nil { + return nil + } + return a.PlatformVersion +} + +func (a *AutocompleteRequest) GetDevice() *string { + if a == nil { + return nil + } + return a.Device +} + +func (a *AutocompleteRequest) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AutocompleteRequest) GetDeviceVendor() *string { + if a == nil { + return nil + } + return a.DeviceVendor +} + +func (a *AutocompleteRequest) GetDeviceName() *string { + if a == nil { + return nil + } + return a.DeviceName +} + +func (a *AutocompleteRequest) GetMarketplace() *string { + if a == nil { + return nil + } + return a.Marketplace +} + +func (a *AutocompleteRequest) GetSectionID() int64 { + if a == nil { + return 0 + } + return a.SectionID +} + +func (a *AutocompleteRequest) GetType() *int64 { + if a == nil { + return nil + } + return a.Type +} + +func (a *AutocompleteRequest) GetFieldQuery() *string { + if a == nil { + return nil + } + return a.FieldQuery +} + +func (a *AutocompleteRequest) GetMediaQuery() *components.MediaQuery { + if a == nil { + return nil + } + return a.MediaQuery +} + +type AutocompleteResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (a *AutocompleteResponse) GetContentType() string { + if a == nil { + return "" + } + return a.ContentType +} + +func (a *AutocompleteResponse) GetStatusCode() int { + if a == nil { + return 0 + } + return a.StatusCode +} + +func (a *AutocompleteResponse) GetRawResponse() *http.Response { + if a == nil { + return nil + } + return a.RawResponse +} + +func (a *AutocompleteResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if a == nil { + return nil + } + return a.MediaContainerWithMetadata +} + +func (a *AutocompleteResponse) GetHeaders() map[string][]string { + if a == nil { + return map[string][]string{} + } + return a.Headers +} diff --git a/models/operations/cancelactivity.go b/models/operations/cancelactivity.go new file mode 100644 index 0000000..47c929a --- /dev/null +++ b/models/operations/cancelactivity.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CancelActivityGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CancelActivityGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CancelActivityGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CancelActivityGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CancelActivityGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CancelActivityGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CancelActivityGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CancelActivityGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CancelActivityGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CancelActivityGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CancelActivityGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CancelActivityGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CancelActivityGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CancelActivityGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CancelActivityRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The UUID of the activity to cancel. + ActivityID string `pathParam:"style=simple,explode=false,name=activityId"` +} + +func (c CancelActivityRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CancelActivityRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"activityId"}); err != nil { + return err + } + return nil +} + +func (c *CancelActivityRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CancelActivityRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CancelActivityRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CancelActivityRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CancelActivityRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CancelActivityRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CancelActivityRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CancelActivityRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CancelActivityRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CancelActivityRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CancelActivityRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CancelActivityRequest) GetActivityID() string { + if c == nil { + return "" + } + return c.ActivityID +} + +type CancelActivityResponse 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 (c *CancelActivityResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CancelActivityResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CancelActivityResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} diff --git a/models/operations/cancelgrab.go b/models/operations/cancelgrab.go new file mode 100644 index 0000000..7fc4606 --- /dev/null +++ b/models/operations/cancelgrab.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CancelGrabGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CancelGrabGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CancelGrabGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CancelGrabGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CancelGrabGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CancelGrabGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CancelGrabGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CancelGrabGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CancelGrabGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CancelGrabGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CancelGrabGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CancelGrabGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CancelGrabGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CancelGrabGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CancelGrabRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the operation. + OperationID string `pathParam:"style=simple,explode=false,name=operationId"` +} + +func (c CancelGrabRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CancelGrabRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"operationId"}); err != nil { + return err + } + return nil +} + +func (c *CancelGrabRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CancelGrabRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CancelGrabRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CancelGrabRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CancelGrabRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CancelGrabRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CancelGrabRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CancelGrabRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CancelGrabRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CancelGrabRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CancelGrabRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CancelGrabRequest) GetOperationID() string { + if c == nil { + return "" + } + return c.OperationID +} + +type CancelGrabResponse 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 (c *CancelGrabResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CancelGrabResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CancelGrabResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} diff --git a/models/operations/cancelrefresh.go b/models/operations/cancelrefresh.go new file mode 100644 index 0000000..bd1da0c --- /dev/null +++ b/models/operations/cancelrefresh.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CancelRefreshGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CancelRefreshGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CancelRefreshGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CancelRefreshGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CancelRefreshGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CancelRefreshGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CancelRefreshGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CancelRefreshGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CancelRefreshGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CancelRefreshGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CancelRefreshGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CancelRefreshGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CancelRefreshGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CancelRefreshGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CancelRefreshRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (c CancelRefreshRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CancelRefreshRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (c *CancelRefreshRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CancelRefreshRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CancelRefreshRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CancelRefreshRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CancelRefreshRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CancelRefreshRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CancelRefreshRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CancelRefreshRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CancelRefreshRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CancelRefreshRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CancelRefreshRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CancelRefreshRequest) GetSectionID() int64 { + if c == nil { + return 0 + } + return c.SectionID +} + +type CancelRefreshResponse 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 (c *CancelRefreshResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CancelRefreshResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CancelRefreshResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} diff --git a/models/operations/cancelserveractivities.go b/models/operations/cancelserveractivities.go deleted file mode 100644 index ceec833..0000000 --- a/models/operations/cancelserveractivities.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (c *CancelServerActivitiesRequest) GetActivityUUID() string { - if c == nil { - return "" - } - return c.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 (c *CancelServerActivitiesResponse) GetContentType() string { - if c == nil { - return "" - } - return c.ContentType -} - -func (c *CancelServerActivitiesResponse) GetStatusCode() int { - if c == nil { - return 0 - } - return c.StatusCode -} - -func (c *CancelServerActivitiesResponse) GetRawResponse() *http.Response { - if c == nil { - return nil - } - return c.RawResponse -} diff --git a/models/operations/checkforupdates.go b/models/operations/checkforupdates.go deleted file mode 100644 index 460436c..0000000 --- a/models/operations/checkforupdates.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (c *CheckForUpdatesRequest) GetDownload() *Download { - if c == nil { - return nil - } - return c.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 (c *CheckForUpdatesResponse) GetContentType() string { - if c == nil { - return "" - } - return c.ContentType -} - -func (c *CheckForUpdatesResponse) GetStatusCode() int { - if c == nil { - return 0 - } - return c.StatusCode -} - -func (c *CheckForUpdatesResponse) GetRawResponse() *http.Response { - if c == nil { - return nil - } - return c.RawResponse -} diff --git a/models/operations/checkupdates.go b/models/operations/checkupdates.go new file mode 100644 index 0000000..7e25e1e --- /dev/null +++ b/models/operations/checkupdates.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CheckUpdatesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CheckUpdatesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CheckUpdatesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CheckUpdatesGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CheckUpdatesGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CheckUpdatesGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CheckUpdatesGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CheckUpdatesGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CheckUpdatesGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CheckUpdatesGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CheckUpdatesGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CheckUpdatesGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CheckUpdatesGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CheckUpdatesGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CheckUpdatesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Indicate that you want to start download any updates found. + Download *components.BoolInt `queryParam:"style=form,explode=true,name=download"` +} + +func (c CheckUpdatesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CheckUpdatesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CheckUpdatesRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CheckUpdatesRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CheckUpdatesRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CheckUpdatesRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CheckUpdatesRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CheckUpdatesRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CheckUpdatesRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CheckUpdatesRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CheckUpdatesRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CheckUpdatesRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CheckUpdatesRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CheckUpdatesRequest) GetDownload() *components.BoolInt { + if c == nil { + return nil + } + return c.Download +} + +type CheckUpdatesResponse 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 (c *CheckUpdatesResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CheckUpdatesResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CheckUpdatesResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} diff --git a/models/operations/cleanbundles.go b/models/operations/cleanbundles.go new file mode 100644 index 0000000..9a23d06 --- /dev/null +++ b/models/operations/cleanbundles.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type CleanBundlesResponse 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 (c *CleanBundlesResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CleanBundlesResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CleanBundlesResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} diff --git a/models/operations/clearplaylistcontents.go b/models/operations/clearplaylistcontents.go deleted file mode 100644 index 5af937a..0000000 --- a/models/operations/clearplaylistcontents.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (c *ClearPlaylistContentsRequest) GetPlaylistID() float64 { - if c == nil { - return 0.0 - } - return c.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 (c *ClearPlaylistContentsResponse) GetContentType() string { - if c == nil { - return "" - } - return c.ContentType -} - -func (c *ClearPlaylistContentsResponse) GetStatusCode() int { - if c == nil { - return 0 - } - return c.StatusCode -} - -func (c *ClearPlaylistContentsResponse) GetRawResponse() *http.Response { - if c == nil { - return nil - } - return c.RawResponse -} diff --git a/models/operations/clearplaylistitems.go b/models/operations/clearplaylistitems.go new file mode 100644 index 0000000..e77524a --- /dev/null +++ b/models/operations/clearplaylistitems.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ClearPlaylistItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c ClearPlaylistItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ClearPlaylistItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ClearPlaylistItemsGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ClearPlaylistItemsGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ClearPlaylistItemsGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ClearPlaylistItemsGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ClearPlaylistItemsGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ClearPlaylistItemsGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ClearPlaylistItemsGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ClearPlaylistItemsGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ClearPlaylistItemsGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ClearPlaylistItemsGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ClearPlaylistItemsGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type ClearPlaylistItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` +} + +func (c ClearPlaylistItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ClearPlaylistItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (c *ClearPlaylistItemsRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ClearPlaylistItemsRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ClearPlaylistItemsRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ClearPlaylistItemsRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ClearPlaylistItemsRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ClearPlaylistItemsRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ClearPlaylistItemsRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ClearPlaylistItemsRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ClearPlaylistItemsRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ClearPlaylistItemsRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ClearPlaylistItemsRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *ClearPlaylistItemsRequest) GetPlaylistID() int64 { + if c == nil { + return 0 + } + return c.PlaylistID +} + +type ClearPlaylistItemsResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (c *ClearPlaylistItemsResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *ClearPlaylistItemsResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *ClearPlaylistItemsResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *ClearPlaylistItemsResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if c == nil { + return nil + } + return c.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/clearplayqueue.go b/models/operations/clearplayqueue.go new file mode 100644 index 0000000..1c85353 --- /dev/null +++ b/models/operations/clearplayqueue.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ClearPlayQueueGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c ClearPlayQueueGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ClearPlayQueueGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ClearPlayQueueGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ClearPlayQueueGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ClearPlayQueueGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ClearPlayQueueGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ClearPlayQueueGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ClearPlayQueueGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ClearPlayQueueGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ClearPlayQueueGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ClearPlayQueueGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ClearPlayQueueGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ClearPlayQueueGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type ClearPlayQueueRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` +} + +func (c ClearPlayQueueRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ClearPlayQueueRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"playQueueId"}); err != nil { + return err + } + return nil +} + +func (c *ClearPlayQueueRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ClearPlayQueueRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ClearPlayQueueRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ClearPlayQueueRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ClearPlayQueueRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ClearPlayQueueRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ClearPlayQueueRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ClearPlayQueueRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ClearPlayQueueRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ClearPlayQueueRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ClearPlayQueueRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *ClearPlayQueueRequest) GetPlayQueueID() int64 { + if c == nil { + return 0 + } + return c.PlayQueueID +} + +type ClearPlayQueueResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (c *ClearPlayQueueResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *ClearPlayQueueResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *ClearPlayQueueResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *ClearPlayQueueResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if c == nil { + return nil + } + return c.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/computechannelmap.go b/models/operations/computechannelmap.go new file mode 100644 index 0000000..0b83848 --- /dev/null +++ b/models/operations/computechannelmap.go @@ -0,0 +1,399 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ComputeChannelMapGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c ComputeChannelMapGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ComputeChannelMapGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ComputeChannelMapGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ComputeChannelMapGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ComputeChannelMapGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ComputeChannelMapGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ComputeChannelMapGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ComputeChannelMapGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ComputeChannelMapGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ComputeChannelMapGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ComputeChannelMapGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ComputeChannelMapGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ComputeChannelMapGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type ComputeChannelMapRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The URI describing the device + DeviceQueryParameter string `queryParam:"style=form,explode=true,name=device"` + // The URI describing the lineup + Lineup string `queryParam:"style=form,explode=true,name=lineup"` +} + +func (c ComputeChannelMapRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ComputeChannelMapRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"device", "lineup"}); err != nil { + return err + } + return nil +} + +func (c *ComputeChannelMapRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ComputeChannelMapRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ComputeChannelMapRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ComputeChannelMapRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ComputeChannelMapRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ComputeChannelMapRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ComputeChannelMapRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ComputeChannelMapRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ComputeChannelMapRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ComputeChannelMapRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ComputeChannelMapRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *ComputeChannelMapRequest) GetDeviceQueryParameter() string { + if c == nil { + return "" + } + return c.DeviceQueryParameter +} + +func (c *ComputeChannelMapRequest) GetLineup() string { + if c == nil { + return "" + } + return c.Lineup +} + +type ComputeChannelMapChannelMapping struct { + ChannelKey *string `json:"channelKey,omitempty"` + // The channel description on the device + DeviceIdentifier *string `json:"deviceIdentifier,omitempty"` + Favorite *bool `json:"favorite,omitempty"` + // The channel identifier in the lineup + LineupIdentifier *string `json:"lineupIdentifier,omitempty"` +} + +func (c *ComputeChannelMapChannelMapping) GetChannelKey() *string { + if c == nil { + return nil + } + return c.ChannelKey +} + +func (c *ComputeChannelMapChannelMapping) GetDeviceIdentifier() *string { + if c == nil { + return nil + } + return c.DeviceIdentifier +} + +func (c *ComputeChannelMapChannelMapping) GetFavorite() *bool { + if c == nil { + return nil + } + return c.Favorite +} + +func (c *ComputeChannelMapChannelMapping) GetLineupIdentifier() *string { + if c == nil { + return nil + } + return c.LineupIdentifier +} + +// ComputeChannelMapMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ComputeChannelMapMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + ChannelMapping []ComputeChannelMapChannelMapping `json:"ChannelMapping,omitempty"` +} + +func (c *ComputeChannelMapMediaContainer) GetIdentifier() *string { + if c == nil { + return nil + } + return c.Identifier +} + +func (c *ComputeChannelMapMediaContainer) GetOffset() *int64 { + if c == nil { + return nil + } + return c.Offset +} + +func (c *ComputeChannelMapMediaContainer) GetSize() *int64 { + if c == nil { + return nil + } + return c.Size +} + +func (c *ComputeChannelMapMediaContainer) GetTotalSize() *int64 { + if c == nil { + return nil + } + return c.TotalSize +} + +func (c *ComputeChannelMapMediaContainer) GetChannelMapping() []ComputeChannelMapChannelMapping { + if c == nil { + return nil + } + return c.ChannelMapping +} + +// ComputeChannelMapResponseBody - OK +type ComputeChannelMapResponseBody struct { + MediaContainer *ComputeChannelMapMediaContainer `json:"MediaContainer,omitempty"` +} + +func (c *ComputeChannelMapResponseBody) GetMediaContainer() *ComputeChannelMapMediaContainer { + if c == nil { + return nil + } + return c.MediaContainer +} + +type ComputeChannelMapResponse 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 + // OK + Object *ComputeChannelMapResponseBody + Headers map[string][]string +} + +func (c *ComputeChannelMapResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *ComputeChannelMapResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *ComputeChannelMapResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *ComputeChannelMapResponse) GetObject() *ComputeChannelMapResponseBody { + if c == nil { + return nil + } + return c.Object +} + +func (c *ComputeChannelMapResponse) GetHeaders() map[string][]string { + if c == nil { + return map[string][]string{} + } + return c.Headers +} diff --git a/models/operations/connectwebsocket.go b/models/operations/connectwebsocket.go new file mode 100644 index 0000000..aa105d5 --- /dev/null +++ b/models/operations/connectwebsocket.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type ConnectWebSocketGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c ConnectWebSocketGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ConnectWebSocketGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ConnectWebSocketGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ConnectWebSocketGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ConnectWebSocketGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ConnectWebSocketGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ConnectWebSocketGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ConnectWebSocketGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ConnectWebSocketGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ConnectWebSocketGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ConnectWebSocketGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ConnectWebSocketGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ConnectWebSocketGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type ConnectWebSocketRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // By default, all events except logs are sent. A rich filtering mechanism is provided to allow clients to opt into or out of each event type using the `filters` parameter. For example: + // + // - `filters=-log`: All event types except logs (the default). + // - `filters=foo,bar`: Only the foo and bar event types. + // - `filters=`: All events types. + // - `filters=-foo,bar`: All event types except foo and bar. + // + Filter []string `queryParam:"style=form,explode=true,name=filter"` +} + +func (c ConnectWebSocketRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ConnectWebSocketRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ConnectWebSocketRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *ConnectWebSocketRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *ConnectWebSocketRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *ConnectWebSocketRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *ConnectWebSocketRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *ConnectWebSocketRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *ConnectWebSocketRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *ConnectWebSocketRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *ConnectWebSocketRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *ConnectWebSocketRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *ConnectWebSocketRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *ConnectWebSocketRequest) GetFilter() []string { + if c == nil { + return nil + } + return c.Filter +} + +type ConnectWebSocketResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (c *ConnectWebSocketResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *ConnectWebSocketResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *ConnectWebSocketResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *ConnectWebSocketResponse) GetResponseStream() io.ReadCloser { + if c == nil { + return nil + } + return c.ResponseStream +} diff --git a/models/operations/createcollection.go b/models/operations/createcollection.go new file mode 100644 index 0000000..a91bd1b --- /dev/null +++ b/models/operations/createcollection.go @@ -0,0 +1,319 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CreateCollectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CreateCollectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateCollectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateCollectionGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateCollectionGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateCollectionGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateCollectionGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateCollectionGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateCollectionGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateCollectionGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateCollectionGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateCollectionGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateCollectionGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateCollectionGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CreateCollectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section where this collection will be created + SectionID string `queryParam:"style=form,explode=true,name=sectionId"` + // The title to filter by or assign + Title *string `queryParam:"style=form,explode=true,name=title"` + // Whether this is a smart collection/playlist + Smart *bool `queryParam:"style=form,explode=true,name=smart"` + // The URI for processing the smart collection. Required for a smart collection + URI *string `queryParam:"style=form,explode=true,name=uri"` + // The metadata type to filter by + Type *int64 `queryParam:"style=form,explode=true,name=type"` +} + +func (c CreateCollectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateCollectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (c *CreateCollectionRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateCollectionRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateCollectionRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateCollectionRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateCollectionRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateCollectionRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateCollectionRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateCollectionRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateCollectionRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateCollectionRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateCollectionRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreateCollectionRequest) GetSectionID() string { + if c == nil { + return "" + } + return c.SectionID +} + +func (c *CreateCollectionRequest) GetTitle() *string { + if c == nil { + return nil + } + return c.Title +} + +func (c *CreateCollectionRequest) GetSmart() *bool { + if c == nil { + return nil + } + return c.Smart +} + +func (c *CreateCollectionRequest) GetURI() *string { + if c == nil { + return nil + } + return c.URI +} + +func (c *CreateCollectionRequest) GetType() *int64 { + if c == nil { + return nil + } + return c.Type +} + +type CreateCollectionResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (c *CreateCollectionResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreateCollectionResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreateCollectionResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *CreateCollectionResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if c == nil { + return nil + } + return c.MediaContainerWithMetadata +} diff --git a/models/operations/createcustomhub.go b/models/operations/createcustomhub.go new file mode 100644 index 0000000..908301c --- /dev/null +++ b/models/operations/createcustomhub.go @@ -0,0 +1,310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CreateCustomHubGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CreateCustomHubGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateCustomHubGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateCustomHubGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateCustomHubGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateCustomHubGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateCustomHubGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateCustomHubGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateCustomHubGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateCustomHubGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateCustomHubGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateCustomHubGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateCustomHubGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateCustomHubGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CreateCustomHubRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to reorder + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The metadata item on which to base this hub. This must currently be a collection + MetadataItemID int64 `queryParam:"style=form,explode=true,name=metadataItemId"` + // Whether this hub should be displayed in recommended + PromotedToRecommended *components.BoolInt `queryParam:"style=form,explode=true,name=promotedToRecommended"` + // Whether this hub should be displayed in admin's home + PromotedToOwnHome *components.BoolInt `queryParam:"style=form,explode=true,name=promotedToOwnHome"` + // Whether this hub should be displayed in shared user's home + PromotedToSharedHome *components.BoolInt `queryParam:"style=form,explode=true,name=promotedToSharedHome"` +} + +func (c CreateCustomHubRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateCustomHubRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"sectionId", "metadataItemId"}); err != nil { + return err + } + return nil +} + +func (c *CreateCustomHubRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateCustomHubRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateCustomHubRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateCustomHubRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateCustomHubRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateCustomHubRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateCustomHubRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateCustomHubRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateCustomHubRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateCustomHubRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateCustomHubRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreateCustomHubRequest) GetSectionID() int64 { + if c == nil { + return 0 + } + return c.SectionID +} + +func (c *CreateCustomHubRequest) GetMetadataItemID() int64 { + if c == nil { + return 0 + } + return c.MetadataItemID +} + +func (c *CreateCustomHubRequest) GetPromotedToRecommended() *components.BoolInt { + if c == nil { + return nil + } + return c.PromotedToRecommended +} + +func (c *CreateCustomHubRequest) GetPromotedToOwnHome() *components.BoolInt { + if c == nil { + return nil + } + return c.PromotedToOwnHome +} + +func (c *CreateCustomHubRequest) GetPromotedToSharedHome() *components.BoolInt { + if c == nil { + return nil + } + return c.PromotedToSharedHome +} + +type CreateCustomHubResponse 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 (c *CreateCustomHubResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreateCustomHubResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreateCustomHubResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} diff --git a/models/operations/createdownloadqueue.go b/models/operations/createdownloadqueue.go new file mode 100644 index 0000000..cc39bf7 --- /dev/null +++ b/models/operations/createdownloadqueue.go @@ -0,0 +1,185 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Status - The state of this queue +// - deciding: At least one item is still being decided +// - waiting: At least one item is waiting for transcode and none are currently transcoding +// - processing: At least one item is being transcoded +// - done: All items are available (or potentially expired) +// - error: At least one item has encountered an error +type Status string + +const ( + StatusDeciding Status = "deciding" + StatusWaiting Status = "waiting" + StatusProcessing Status = "processing" + StatusDone Status = "done" + StatusError Status = "error" +) + +func (e Status) ToPointer() *Status { + return &e +} +func (e *Status) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "deciding": + fallthrough + case "waiting": + fallthrough + case "processing": + fallthrough + case "done": + fallthrough + case "error": + *e = Status(v) + return nil + default: + return fmt.Errorf("invalid value for Status: %v", v) + } +} + +type DownloadQueue struct { + ID *int64 `json:"id,omitempty"` + ItemCount *int64 `json:"itemCount,omitempty"` + // The state of this queue + // - deciding: At least one item is still being decided + // - waiting: At least one item is waiting for transcode and none are currently transcoding + // - processing: At least one item is being transcoded + // - done: All items are available (or potentially expired) + // - error: At least one item has encountered an error + // + Status *Status `json:"status,omitempty"` +} + +func (d *DownloadQueue) GetID() *int64 { + if d == nil { + return nil + } + return d.ID +} + +func (d *DownloadQueue) GetItemCount() *int64 { + if d == nil { + return nil + } + return d.ItemCount +} + +func (d *DownloadQueue) GetStatus() *Status { + if d == nil { + return nil + } + return d.Status +} + +// CreateDownloadQueueMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type CreateDownloadQueueMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + DownloadQueue []DownloadQueue `json:"DownloadQueue,omitempty"` +} + +func (c *CreateDownloadQueueMediaContainer) GetIdentifier() *string { + if c == nil { + return nil + } + return c.Identifier +} + +func (c *CreateDownloadQueueMediaContainer) GetOffset() *int64 { + if c == nil { + return nil + } + return c.Offset +} + +func (c *CreateDownloadQueueMediaContainer) GetSize() *int64 { + if c == nil { + return nil + } + return c.Size +} + +func (c *CreateDownloadQueueMediaContainer) GetTotalSize() *int64 { + if c == nil { + return nil + } + return c.TotalSize +} + +func (c *CreateDownloadQueueMediaContainer) GetDownloadQueue() []DownloadQueue { + if c == nil { + return nil + } + return c.DownloadQueue +} + +// CreateDownloadQueueResponseBody - OK +type CreateDownloadQueueResponseBody struct { + MediaContainer *CreateDownloadQueueMediaContainer `json:"MediaContainer,omitempty"` +} + +func (c *CreateDownloadQueueResponseBody) GetMediaContainer() *CreateDownloadQueueMediaContainer { + if c == nil { + return nil + } + return c.MediaContainer +} + +type CreateDownloadQueueResponse 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 + // OK + Object *CreateDownloadQueueResponseBody +} + +func (c *CreateDownloadQueueResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreateDownloadQueueResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreateDownloadQueueResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *CreateDownloadQueueResponse) GetObject() *CreateDownloadQueueResponseBody { + if c == nil { + return nil + } + return c.Object +} diff --git a/models/operations/createdvr.go b/models/operations/createdvr.go new file mode 100644 index 0000000..5f4a414 --- /dev/null +++ b/models/operations/createdvr.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CreateDVRGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CreateDVRGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateDVRGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateDVRGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateDVRGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateDVRGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateDVRGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateDVRGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateDVRGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateDVRGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateDVRGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateDVRGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateDVRGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateDVRGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +type CreateDVRRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The EPG lineup. + Lineup *string `queryParam:"style=form,explode=true,name=lineup"` + // The device. + DeviceQueryParameter []string `queryParam:"style=form,explode=true,name=device"` + // The language. + Language *string `queryParam:"style=form,explode=true,name=language"` +} + +func (c CreateDVRRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateDVRRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateDVRRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateDVRRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateDVRRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateDVRRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateDVRRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateDVRRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateDVRRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateDVRRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateDVRRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateDVRRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateDVRRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreateDVRRequest) GetLineup() *string { + if c == nil { + return nil + } + return c.Lineup +} + +func (c *CreateDVRRequest) GetDeviceQueryParameter() []string { + if c == nil { + return nil + } + return c.DeviceQueryParameter +} + +func (c *CreateDVRRequest) GetLanguage() *string { + if c == nil { + return nil + } + return c.Language +} + +type CreateDVRResponse 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 + // OK + DvrRequestHandlerSlashGetResponses200 *components.DvrRequestHandlerSlashGetResponses200 + Headers map[string][]string +} + +func (c *CreateDVRResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreateDVRResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreateDVRResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *CreateDVRResponse) GetDvrRequestHandlerSlashGetResponses200() *components.DvrRequestHandlerSlashGetResponses200 { + if c == nil { + return nil + } + return c.DvrRequestHandlerSlashGetResponses200 +} + +func (c *CreateDVRResponse) GetHeaders() map[string][]string { + if c == nil { + return map[string][]string{} + } + return c.Headers +} diff --git a/models/operations/createmarker.go b/models/operations/createmarker.go new file mode 100644 index 0000000..aad9ecb --- /dev/null +++ b/models/operations/createmarker.go @@ -0,0 +1,480 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CreateMarkerGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CreateMarkerGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateMarkerGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateMarkerGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateMarkerGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateMarkerGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateMarkerGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateMarkerGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateMarkerGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateMarkerGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateMarkerGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateMarkerGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateMarkerGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateMarkerGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +// Attributes - The attributes to assign to this marker +type Attributes struct { +} + +type CreateMarkerRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // The type of marker to edit/create + Type int64 `queryParam:"style=form,explode=true,name=type"` + // The start time of the marker + StartTimeOffset int64 `queryParam:"style=form,explode=true,name=startTimeOffset"` + // The end time of the marker + EndTimeOffset *int64 `queryParam:"style=form,explode=true,name=endTimeOffset"` + // The attributes to assign to this marker + Attributes *Attributes `queryParam:"style=deepObject,explode=true,name=attributes"` +} + +func (c CreateMarkerRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateMarkerRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"ids", "type", "startTimeOffset"}); err != nil { + return err + } + return nil +} + +func (c *CreateMarkerRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateMarkerRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateMarkerRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateMarkerRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateMarkerRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateMarkerRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateMarkerRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateMarkerRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateMarkerRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateMarkerRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateMarkerRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreateMarkerRequest) GetIds() string { + if c == nil { + return "" + } + return c.Ids +} + +func (c *CreateMarkerRequest) GetType() int64 { + if c == nil { + return 0 + } + return c.Type +} + +func (c *CreateMarkerRequest) GetStartTimeOffset() int64 { + if c == nil { + return 0 + } + return c.StartTimeOffset +} + +func (c *CreateMarkerRequest) GetEndTimeOffset() *int64 { + if c == nil { + return nil + } + return c.EndTimeOffset +} + +func (c *CreateMarkerRequest) GetAttributes() *Attributes { + if c == nil { + return nil + } + return c.Attributes +} + +type CreateMarkerType string + +const ( + CreateMarkerTypeIntro CreateMarkerType = "intro" + CreateMarkerTypeCommercial CreateMarkerType = "commercial" + CreateMarkerTypeBookmark CreateMarkerType = "bookmark" + CreateMarkerTypeResume CreateMarkerType = "resume" + CreateMarkerTypeCredit CreateMarkerType = "credit" +) + +func (e CreateMarkerType) ToPointer() *CreateMarkerType { + return &e +} +func (e *CreateMarkerType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "intro": + fallthrough + case "commercial": + fallthrough + case "bookmark": + fallthrough + case "resume": + fallthrough + case "credit": + *e = CreateMarkerType(v) + return nil + default: + return fmt.Errorf("invalid value for CreateMarkerType: %v", v) + } +} + +// CreateMarkerMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type CreateMarkerMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Color *string `json:"color,omitempty"` + EndTimeOffset *int64 `json:"endTimeOffset,omitempty"` + ID *int64 `json:"id,omitempty"` + StartTimeOffset *int64 `json:"startTimeOffset,omitempty"` + Title *string `json:"title,omitempty"` + Type *CreateMarkerType `json:"type,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (c CreateMarkerMediaContainer) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateMarkerMediaContainer) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateMarkerMediaContainer) GetIdentifier() *string { + if c == nil { + return nil + } + return c.Identifier +} + +func (c *CreateMarkerMediaContainer) GetOffset() *int64 { + if c == nil { + return nil + } + return c.Offset +} + +func (c *CreateMarkerMediaContainer) GetSize() *int64 { + if c == nil { + return nil + } + return c.Size +} + +func (c *CreateMarkerMediaContainer) GetTotalSize() *int64 { + if c == nil { + return nil + } + return c.TotalSize +} + +func (c *CreateMarkerMediaContainer) GetColor() *string { + if c == nil { + return nil + } + return c.Color +} + +func (c *CreateMarkerMediaContainer) GetEndTimeOffset() *int64 { + if c == nil { + return nil + } + return c.EndTimeOffset +} + +func (c *CreateMarkerMediaContainer) GetID() *int64 { + if c == nil { + return nil + } + return c.ID +} + +func (c *CreateMarkerMediaContainer) GetStartTimeOffset() *int64 { + if c == nil { + return nil + } + return c.StartTimeOffset +} + +func (c *CreateMarkerMediaContainer) GetTitle() *string { + if c == nil { + return nil + } + return c.Title +} + +func (c *CreateMarkerMediaContainer) GetType() *CreateMarkerType { + if c == nil { + return nil + } + return c.Type +} + +func (c *CreateMarkerMediaContainer) GetAdditionalProperties() map[string]any { + if c == nil { + return nil + } + return c.AdditionalProperties +} + +// CreateMarkerResponseBody - OK +type CreateMarkerResponseBody struct { + MediaContainer *CreateMarkerMediaContainer `json:"MediaContainer,omitempty"` +} + +func (c *CreateMarkerResponseBody) GetMediaContainer() *CreateMarkerMediaContainer { + if c == nil { + return nil + } + return c.MediaContainer +} + +type CreateMarkerResponse 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 + // OK + Object *CreateMarkerResponseBody +} + +func (c *CreateMarkerResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreateMarkerResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreateMarkerResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *CreateMarkerResponse) GetObject() *CreateMarkerResponseBody { + if c == nil { + return nil + } + return c.Object +} diff --git a/models/operations/createplaylist.go b/models/operations/createplaylist.go index 96817d2..2b12625 100644 --- a/models/operations/createplaylist.go +++ b/models/operations/createplaylist.go @@ -3,261 +3,255 @@ package operations import ( - "encoding/json" - "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -// CreatePlaylistQueryParamType - type of playlist to create -type CreatePlaylistQueryParamType string - -const ( - CreatePlaylistQueryParamTypeAudio CreatePlaylistQueryParamType = "audio" - CreatePlaylistQueryParamTypeVideo CreatePlaylistQueryParamType = "video" - CreatePlaylistQueryParamTypePhoto CreatePlaylistQueryParamType = "photo" -) - -func (e CreatePlaylistQueryParamType) ToPointer() *CreatePlaylistQueryParamType { - return &e +type CreatePlaylistGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -// 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 (c CreatePlaylistGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) } -func (e *Smart) UnmarshalJSON(data []byte) error { - var v int64 - if err := json.Unmarshal(data, &v); err != nil { + +func (c *CreatePlaylistGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { return err } - switch v { - case 0: - fallthrough - case 1: - *e = Smart(v) + return nil +} + +func (c *CreatePlaylistGlobals) GetAccepts() *components.Accepts { + if c == nil { return nil - default: - return fmt.Errorf("invalid value for Smart: %v", v) } + return c.Accepts +} + +func (c *CreatePlaylistGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreatePlaylistGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreatePlaylistGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreatePlaylistGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreatePlaylistGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreatePlaylistGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreatePlaylistGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreatePlaylistGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreatePlaylistGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreatePlaylistGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace } type CreatePlaylistRequest struct { - // name of the playlist - Title string `queryParam:"style=form,explode=true,name=title"` - // type of playlist to create - Type CreatePlaylistQueryParamType `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"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The content URI for what we're playing (e.g. `library://...`). + URI *string `queryParam:"style=form,explode=true,name=uri"` + // To create a playlist from an existing play queue. + PlayQueueID *int64 `queryParam:"style=form,explode=true,name=playQueueID"` } -func (c *CreatePlaylistRequest) GetTitle() string { - if c == nil { - return "" +func (c CreatePlaylistRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreatePlaylistRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err } - return c.Title + return nil } -func (c *CreatePlaylistRequest) GetType() CreatePlaylistQueryParamType { +func (c *CreatePlaylistRequest) GetAccepts() *components.Accepts { if c == nil { - return CreatePlaylistQueryParamType("") + return nil } - return c.Type + return c.Accepts } -func (c *CreatePlaylistRequest) GetSmart() Smart { +func (c *CreatePlaylistRequest) GetClientIdentifier() *string { if c == nil { - return Smart(0) + return nil } - return c.Smart + return c.ClientIdentifier } -func (c *CreatePlaylistRequest) GetURI() string { +func (c *CreatePlaylistRequest) GetProduct() *string { if c == nil { - return "" + return nil + } + return c.Product +} + +func (c *CreatePlaylistRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreatePlaylistRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreatePlaylistRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreatePlaylistRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreatePlaylistRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreatePlaylistRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreatePlaylistRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreatePlaylistRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreatePlaylistRequest) GetURI() *string { + if c == nil { + return nil } return c.URI } -func (c *CreatePlaylistRequest) GetPlayQueueID() *float64 { +func (c *CreatePlaylistRequest) GetPlayQueueID() *int64 { if c == nil { return nil } return c.PlayQueueID } -type CreatePlaylistMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - GUID *string `json:"guid,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - Summary *string `json:"summary,omitempty"` - Smart *bool `json:"smart,omitempty"` - PlaylistType *string `json:"playlistType,omitempty"` - Icon *string `json:"icon,omitempty"` - ViewCount *int `json:"viewCount,omitempty"` - LastViewedAt *int `json:"lastViewedAt,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` - Composite *string `json:"composite,omitempty"` - Duration *int `json:"duration,omitempty"` -} - -func (c *CreatePlaylistMetadata) GetRatingKey() *string { - if c == nil { - return nil - } - return c.RatingKey -} - -func (c *CreatePlaylistMetadata) GetKey() *string { - if c == nil { - return nil - } - return c.Key -} - -func (c *CreatePlaylistMetadata) GetGUID() *string { - if c == nil { - return nil - } - return c.GUID -} - -func (c *CreatePlaylistMetadata) GetType() *string { - if c == nil { - return nil - } - return c.Type -} - -func (c *CreatePlaylistMetadata) GetTitle() *string { - if c == nil { - return nil - } - return c.Title -} - -func (c *CreatePlaylistMetadata) GetSummary() *string { - if c == nil { - return nil - } - return c.Summary -} - -func (c *CreatePlaylistMetadata) GetSmart() *bool { - if c == nil { - return nil - } - return c.Smart -} - -func (c *CreatePlaylistMetadata) GetPlaylistType() *string { - if c == nil { - return nil - } - return c.PlaylistType -} - -func (c *CreatePlaylistMetadata) GetIcon() *string { - if c == nil { - return nil - } - return c.Icon -} - -func (c *CreatePlaylistMetadata) GetViewCount() *int { - if c == nil { - return nil - } - return c.ViewCount -} - -func (c *CreatePlaylistMetadata) GetLastViewedAt() *int { - if c == nil { - return nil - } - return c.LastViewedAt -} - -func (c *CreatePlaylistMetadata) GetLeafCount() *int { - if c == nil { - return nil - } - return c.LeafCount -} - -func (c *CreatePlaylistMetadata) GetAddedAt() *int { - if c == nil { - return nil - } - return c.AddedAt -} - -func (c *CreatePlaylistMetadata) GetUpdatedAt() *int { - if c == nil { - return nil - } - return c.UpdatedAt -} - -func (c *CreatePlaylistMetadata) GetComposite() *string { - if c == nil { - return nil - } - return c.Composite -} - -func (c *CreatePlaylistMetadata) GetDuration() *int { - if c == nil { - return nil - } - return c.Duration -} - -type CreatePlaylistMediaContainer struct { - Size *int `json:"size,omitempty"` - Metadata []CreatePlaylistMetadata `json:"Metadata,omitempty"` -} - -func (c *CreatePlaylistMediaContainer) GetSize() *int { - if c == nil { - return nil - } - return c.Size -} - -func (c *CreatePlaylistMediaContainer) GetMetadata() []CreatePlaylistMetadata { - if c == nil { - return nil - } - return c.Metadata -} - -// CreatePlaylistResponseBody - returns all playlists -type CreatePlaylistResponseBody struct { - MediaContainer *CreatePlaylistMediaContainer `json:"MediaContainer,omitempty"` -} - -func (c *CreatePlaylistResponseBody) GetMediaContainer() *CreatePlaylistMediaContainer { - if c == nil { - return nil - } - return c.MediaContainer -} - type CreatePlaylistResponse struct { // HTTP response content type for this operation ContentType string @@ -265,8 +259,8 @@ type CreatePlaylistResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response - // returns all playlists - Object *CreatePlaylistResponseBody + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata } func (c *CreatePlaylistResponse) GetContentType() string { @@ -290,9 +284,9 @@ func (c *CreatePlaylistResponse) GetRawResponse() *http.Response { return c.RawResponse } -func (c *CreatePlaylistResponse) GetObject() *CreatePlaylistResponseBody { +func (c *CreatePlaylistResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { if c == nil { return nil } - return c.Object + return c.MediaContainerWithPlaylistMetadata } diff --git a/models/operations/createplayqueue.go b/models/operations/createplayqueue.go new file mode 100644 index 0000000..7c89427 --- /dev/null +++ b/models/operations/createplayqueue.go @@ -0,0 +1,539 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CreatePlayQueueGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CreatePlayQueueGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreatePlayQueueGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreatePlayQueueGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreatePlayQueueGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreatePlayQueueGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreatePlayQueueGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreatePlayQueueGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreatePlayQueueGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreatePlayQueueGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreatePlayQueueGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreatePlayQueueGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreatePlayQueueGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreatePlayQueueGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +// Type - The type of play queue 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) + } +} + +type CreatePlayQueueRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The content URI for what we're playing. + URI *string `queryParam:"style=form,explode=true,name=uri"` + // the ID of the playlist we're playing. + PlaylistID *int64 `queryParam:"style=form,explode=true,name=playlistID"` + // The type of play queue to create + Type Type `queryParam:"style=form,explode=true,name=type"` + // The key of the first item to play, defaults to the first in the play queue. + Key *string `queryParam:"style=form,explode=true,name=key"` + // Whether to shuffle the playlist, defaults to 0. + Shuffle *components.BoolInt `queryParam:"style=form,explode=true,name=shuffle"` + // If the PQ is bigger than the window, fill any empty space with wraparound items, defaults to 0. + Repeat *components.BoolInt `queryParam:"style=form,explode=true,name=repeat"` + // Whether to create a continuous play queue (e.g. from an episode), defaults to 0. + Continuous *components.BoolInt `queryParam:"style=form,explode=true,name=continuous"` + // Number of trailers to prepend a movie with not including the pre-roll. If omitted the pre-roll will not be returned in the play queue. When resuming a movie `extrasPrefixCount` should be omitted as a parameter instead of passing 0. + ExtrasPrefixCount *int64 `queryParam:"style=form,explode=true,name=extrasPrefixCount"` + // Only applies to queues of type photo, whether to retrieve all descendent photos from an album or section, defaults to 1. + Recursive *components.BoolInt `queryParam:"style=form,explode=true,name=recursive"` + // Only applies to queues of type show or seasons, whether to return a queue that is started on the On Deck episode if one exists. Otherwise begins the play queue on the beginning of the show or season. + OnDeck *components.BoolInt `queryParam:"style=form,explode=true,name=onDeck"` +} + +func (c CreatePlayQueueRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreatePlayQueueRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, []string{"type"}); err != nil { + return err + } + return nil +} + +func (c *CreatePlayQueueRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreatePlayQueueRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreatePlayQueueRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreatePlayQueueRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreatePlayQueueRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreatePlayQueueRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreatePlayQueueRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreatePlayQueueRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreatePlayQueueRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreatePlayQueueRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreatePlayQueueRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreatePlayQueueRequest) GetURI() *string { + if c == nil { + return nil + } + return c.URI +} + +func (c *CreatePlayQueueRequest) GetPlaylistID() *int64 { + if c == nil { + return nil + } + return c.PlaylistID +} + +func (c *CreatePlayQueueRequest) GetType() Type { + if c == nil { + return Type("") + } + return c.Type +} + +func (c *CreatePlayQueueRequest) GetKey() *string { + if c == nil { + return nil + } + return c.Key +} + +func (c *CreatePlayQueueRequest) GetShuffle() *components.BoolInt { + if c == nil { + return nil + } + return c.Shuffle +} + +func (c *CreatePlayQueueRequest) GetRepeat() *components.BoolInt { + if c == nil { + return nil + } + return c.Repeat +} + +func (c *CreatePlayQueueRequest) GetContinuous() *components.BoolInt { + if c == nil { + return nil + } + return c.Continuous +} + +func (c *CreatePlayQueueRequest) GetExtrasPrefixCount() *int64 { + if c == nil { + return nil + } + return c.ExtrasPrefixCount +} + +func (c *CreatePlayQueueRequest) GetRecursive() *components.BoolInt { + if c == nil { + return nil + } + return c.Recursive +} + +func (c *CreatePlayQueueRequest) GetOnDeck() *components.BoolInt { + if c == nil { + return nil + } + return c.OnDeck +} + +// CreatePlayQueueMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type CreatePlayQueueMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // The ID of the play queue, which is used in subsequent requests. + PlayQueueID *int64 `json:"playQueueID,omitempty"` + // Defines where the "Up Next" region starts + PlayQueueLastAddedItemID *string `json:"playQueueLastAddedItemID,omitempty"` + // The queue item ID of the currently selected item. + PlayQueueSelectedItemID *int64 `json:"playQueueSelectedItemID,omitempty"` + // The offset of the selected item in the play queue, from the beginning of the queue. + PlayQueueSelectedItemOffset *int64 `json:"playQueueSelectedItemOffset,omitempty"` + // The metadata item ID of the currently selected item (matches `ratingKey` attribute in metadata item if the media provider is a library). + PlayQueueSelectedMetadataItemID *int64 `json:"playQueueSelectedMetadataItemID,omitempty"` + // Whether or not the queue is shuffled. + PlayQueueShuffled *bool `json:"playQueueShuffled,omitempty"` + // The original URI used to create the play queue. + PlayQueueSourceURI *string `json:"playQueueSourceURI,omitempty"` + // The total number of items in the play queue. + PlayQueueTotalCount *int64 `json:"playQueueTotalCount,omitempty"` + // The version of the play queue. It increments every time a change is made to the play queue to assist clients in knowing when to refresh. + PlayQueueVersion *int64 `json:"playQueueVersion,omitempty"` +} + +func (c *CreatePlayQueueMediaContainer) GetIdentifier() *string { + if c == nil { + return nil + } + return c.Identifier +} + +func (c *CreatePlayQueueMediaContainer) GetOffset() *int64 { + if c == nil { + return nil + } + return c.Offset +} + +func (c *CreatePlayQueueMediaContainer) GetSize() *int64 { + if c == nil { + return nil + } + return c.Size +} + +func (c *CreatePlayQueueMediaContainer) GetTotalSize() *int64 { + if c == nil { + return nil + } + return c.TotalSize +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueID() *int64 { + if c == nil { + return nil + } + return c.PlayQueueID +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueLastAddedItemID() *string { + if c == nil { + return nil + } + return c.PlayQueueLastAddedItemID +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueSelectedItemID() *int64 { + if c == nil { + return nil + } + return c.PlayQueueSelectedItemID +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueSelectedItemOffset() *int64 { + if c == nil { + return nil + } + return c.PlayQueueSelectedItemOffset +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueSelectedMetadataItemID() *int64 { + if c == nil { + return nil + } + return c.PlayQueueSelectedMetadataItemID +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueShuffled() *bool { + if c == nil { + return nil + } + return c.PlayQueueShuffled +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueSourceURI() *string { + if c == nil { + return nil + } + return c.PlayQueueSourceURI +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueTotalCount() *int64 { + if c == nil { + return nil + } + return c.PlayQueueTotalCount +} + +func (c *CreatePlayQueueMediaContainer) GetPlayQueueVersion() *int64 { + if c == nil { + return nil + } + return c.PlayQueueVersion +} + +// CreatePlayQueueResponseBody - OK +type CreatePlayQueueResponseBody struct { + MediaContainer *CreatePlayQueueMediaContainer `json:"MediaContainer,omitempty"` +} + +func (c *CreatePlayQueueResponseBody) GetMediaContainer() *CreatePlayQueueMediaContainer { + if c == nil { + return nil + } + return c.MediaContainer +} + +type CreatePlayQueueResponse 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 + // OK + Object *CreatePlayQueueResponseBody + Headers map[string][]string +} + +func (c *CreatePlayQueueResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreatePlayQueueResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreatePlayQueueResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *CreatePlayQueueResponse) GetObject() *CreatePlayQueueResponseBody { + if c == nil { + return nil + } + return c.Object +} + +func (c *CreatePlayQueueResponse) GetHeaders() map[string][]string { + if c == nil { + return map[string][]string{} + } + return c.Headers +} diff --git a/models/operations/createsubscription.go b/models/operations/createsubscription.go new file mode 100644 index 0000000..9799d48 --- /dev/null +++ b/models/operations/createsubscription.go @@ -0,0 +1,415 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type CreateSubscriptionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (c CreateSubscriptionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateSubscriptionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateSubscriptionGlobals) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateSubscriptionGlobals) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateSubscriptionGlobals) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateSubscriptionGlobals) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateSubscriptionGlobals) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateSubscriptionGlobals) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateSubscriptionGlobals) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateSubscriptionGlobals) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateSubscriptionGlobals) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateSubscriptionGlobals) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateSubscriptionGlobals) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +// Hints describing what we're looking for. Note: The hint `ratingKey` is required for downloading from a PMS remote. +type Hints struct { +} + +// CreateSubscriptionQueryParamPrefs - Subscription preferences. +type CreateSubscriptionQueryParamPrefs struct { +} + +// Params - Subscription parameters. +// - `mediaProviderID`: Required for downloads to indicate which MP the subscription will download into +// - `source`: Required for downloads to indicate the source of the downloaded content. +type Params struct { +} + +type CreateSubscriptionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The library section into which we'll grab the media. Not actually required when the subscription is to a playlist. + TargetLibrarySectionID *int64 `queryParam:"style=form,explode=true,name=targetLibrarySectionID"` + // The section location into which to grab. + TargetSectionLocationID *int64 `queryParam:"style=form,explode=true,name=targetSectionLocationID"` + // The type of the thing we're subscribing too (e.g. show, season). + Type *int64 `queryParam:"style=form,explode=true,name=type"` + // Hints describing what we're looking for. Note: The hint `ratingKey` is required for downloading from a PMS remote. + Hints *Hints `queryParam:"style=deepObject,explode=true,name=hints"` + // Subscription preferences. + Prefs *CreateSubscriptionQueryParamPrefs `queryParam:"style=deepObject,explode=true,name=prefs"` + // Subscription parameters. + // - `mediaProviderID`: Required for downloads to indicate which MP the subscription will download into + // - `source`: Required for downloads to indicate the source of the downloaded content. + // + Params *Params `queryParam:"style=deepObject,explode=true,name=params"` +} + +func (c CreateSubscriptionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateSubscriptionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateSubscriptionRequest) GetAccepts() *components.Accepts { + if c == nil { + return nil + } + return c.Accepts +} + +func (c *CreateSubscriptionRequest) GetClientIdentifier() *string { + if c == nil { + return nil + } + return c.ClientIdentifier +} + +func (c *CreateSubscriptionRequest) GetProduct() *string { + if c == nil { + return nil + } + return c.Product +} + +func (c *CreateSubscriptionRequest) GetVersion() *string { + if c == nil { + return nil + } + return c.Version +} + +func (c *CreateSubscriptionRequest) GetPlatform() *string { + if c == nil { + return nil + } + return c.Platform +} + +func (c *CreateSubscriptionRequest) GetPlatformVersion() *string { + if c == nil { + return nil + } + return c.PlatformVersion +} + +func (c *CreateSubscriptionRequest) GetDevice() *string { + if c == nil { + return nil + } + return c.Device +} + +func (c *CreateSubscriptionRequest) GetModel() *string { + if c == nil { + return nil + } + return c.Model +} + +func (c *CreateSubscriptionRequest) GetDeviceVendor() *string { + if c == nil { + return nil + } + return c.DeviceVendor +} + +func (c *CreateSubscriptionRequest) GetDeviceName() *string { + if c == nil { + return nil + } + return c.DeviceName +} + +func (c *CreateSubscriptionRequest) GetMarketplace() *string { + if c == nil { + return nil + } + return c.Marketplace +} + +func (c *CreateSubscriptionRequest) GetTargetLibrarySectionID() *int64 { + if c == nil { + return nil + } + return c.TargetLibrarySectionID +} + +func (c *CreateSubscriptionRequest) GetTargetSectionLocationID() *int64 { + if c == nil { + return nil + } + return c.TargetSectionLocationID +} + +func (c *CreateSubscriptionRequest) GetType() *int64 { + if c == nil { + return nil + } + return c.Type +} + +func (c *CreateSubscriptionRequest) GetHints() *Hints { + if c == nil { + return nil + } + return c.Hints +} + +func (c *CreateSubscriptionRequest) GetPrefs() *CreateSubscriptionQueryParamPrefs { + if c == nil { + return nil + } + return c.Prefs +} + +func (c *CreateSubscriptionRequest) GetParams() *Params { + if c == nil { + return nil + } + return c.Params +} + +// CreateSubscriptionMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type CreateSubscriptionMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + MediaSubscription []components.MediaSubscription `json:"MediaSubscription,omitempty"` +} + +func (c *CreateSubscriptionMediaContainer) GetIdentifier() *string { + if c == nil { + return nil + } + return c.Identifier +} + +func (c *CreateSubscriptionMediaContainer) GetOffset() *int64 { + if c == nil { + return nil + } + return c.Offset +} + +func (c *CreateSubscriptionMediaContainer) GetSize() *int64 { + if c == nil { + return nil + } + return c.Size +} + +func (c *CreateSubscriptionMediaContainer) GetTotalSize() *int64 { + if c == nil { + return nil + } + return c.TotalSize +} + +func (c *CreateSubscriptionMediaContainer) GetMediaSubscription() []components.MediaSubscription { + if c == nil { + return nil + } + return c.MediaSubscription +} + +// CreateSubscriptionResponseBody - OK +type CreateSubscriptionResponseBody struct { + MediaContainer *CreateSubscriptionMediaContainer `json:"MediaContainer,omitempty"` +} + +func (c *CreateSubscriptionResponseBody) GetMediaContainer() *CreateSubscriptionMediaContainer { + if c == nil { + return nil + } + return c.MediaContainer +} + +type CreateSubscriptionResponse 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 + // OK + Object *CreateSubscriptionResponseBody + Headers map[string][]string +} + +func (c *CreateSubscriptionResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *CreateSubscriptionResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *CreateSubscriptionResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *CreateSubscriptionResponse) GetObject() *CreateSubscriptionResponseBody { + if c == nil { + return nil + } + return c.Object +} + +func (c *CreateSubscriptionResponse) GetHeaders() map[string][]string { + if c == nil { + return map[string][]string{} + } + return c.Headers +} diff --git a/models/operations/deletecaches.go b/models/operations/deletecaches.go new file mode 100644 index 0000000..4c5a746 --- /dev/null +++ b/models/operations/deletecaches.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type DeleteCachesResponse 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 (d *DeleteCachesResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteCachesResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteCachesResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletecollection.go b/models/operations/deletecollection.go new file mode 100644 index 0000000..591e874 --- /dev/null +++ b/models/operations/deletecollection.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteCollectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteCollectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteCollectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteCollectionGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteCollectionGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteCollectionGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteCollectionGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteCollectionGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteCollectionGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteCollectionGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteCollectionGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteCollectionGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteCollectionGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteCollectionGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteCollectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Collection Id + CollectionID int64 `pathParam:"style=simple,explode=false,name=collectionId"` +} + +func (d DeleteCollectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteCollectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"sectionId", "collectionId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteCollectionRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteCollectionRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteCollectionRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteCollectionRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteCollectionRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteCollectionRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteCollectionRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteCollectionRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteCollectionRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteCollectionRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteCollectionRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteCollectionRequest) GetSectionID() int64 { + if d == nil { + return 0 + } + return d.SectionID +} + +func (d *DeleteCollectionRequest) GetCollectionID() int64 { + if d == nil { + return 0 + } + return d.CollectionID +} + +type DeleteCollectionResponse 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 (d *DeleteCollectionResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteCollectionResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteCollectionResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletecollectionitem.go b/models/operations/deletecollectionitem.go new file mode 100644 index 0000000..8982370 --- /dev/null +++ b/models/operations/deletecollectionitem.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteCollectionItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteCollectionItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteCollectionItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteCollectionItemGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteCollectionItemGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteCollectionItemGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteCollectionItemGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteCollectionItemGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteCollectionItemGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteCollectionItemGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteCollectionItemGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteCollectionItemGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteCollectionItemGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteCollectionItemGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteCollectionItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The collection id + CollectionID int64 `pathParam:"style=simple,explode=false,name=collectionId"` + // The item to delete + ItemID int64 `pathParam:"style=simple,explode=false,name=itemId"` +} + +func (d DeleteCollectionItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteCollectionItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"collectionId", "itemId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteCollectionItemRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteCollectionItemRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteCollectionItemRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteCollectionItemRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteCollectionItemRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteCollectionItemRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteCollectionItemRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteCollectionItemRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteCollectionItemRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteCollectionItemRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteCollectionItemRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteCollectionItemRequest) GetCollectionID() int64 { + if d == nil { + return 0 + } + return d.CollectionID +} + +func (d *DeleteCollectionItemRequest) GetItemID() int64 { + if d == nil { + return 0 + } + return d.ItemID +} + +type DeleteCollectionItemResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (d *DeleteCollectionItemResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteCollectionItemResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteCollectionItemResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} + +func (d *DeleteCollectionItemResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if d == nil { + return nil + } + return d.MediaContainerWithMetadata +} diff --git a/models/operations/deletecustomhub.go b/models/operations/deletecustomhub.go new file mode 100644 index 0000000..ef60485 --- /dev/null +++ b/models/operations/deletecustomhub.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteCustomHubGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteCustomHubGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteCustomHubGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteCustomHubGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteCustomHubGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteCustomHubGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteCustomHubGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteCustomHubGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteCustomHubGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteCustomHubGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteCustomHubGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteCustomHubGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteCustomHubGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteCustomHubGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteCustomHubRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to change + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The identifier of the hub to change + Identifier string `pathParam:"style=simple,explode=false,name=identifier"` +} + +func (d DeleteCustomHubRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteCustomHubRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"sectionId", "identifier"}); err != nil { + return err + } + return nil +} + +func (d *DeleteCustomHubRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteCustomHubRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteCustomHubRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteCustomHubRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteCustomHubRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteCustomHubRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteCustomHubRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteCustomHubRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteCustomHubRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteCustomHubRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteCustomHubRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteCustomHubRequest) GetSectionID() int64 { + if d == nil { + return 0 + } + return d.SectionID +} + +func (d *DeleteCustomHubRequest) GetIdentifier() string { + if d == nil { + return "" + } + return d.Identifier +} + +type DeleteCustomHubResponse 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 (d *DeleteCustomHubResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteCustomHubResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteCustomHubResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletedvr.go b/models/operations/deletedvr.go new file mode 100644 index 0000000..655acc3 --- /dev/null +++ b/models/operations/deletedvr.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteDVRGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteDVRGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteDVRGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteDVRGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteDVRGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteDVRGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteDVRGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteDVRGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteDVRGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteDVRGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteDVRGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteDVRGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteDVRGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteDVRGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteDVRRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` +} + +func (d DeleteDVRRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteDVRRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"dvrId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteDVRRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteDVRRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteDVRRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteDVRRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteDVRRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteDVRRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteDVRRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteDVRRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteDVRRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteDVRRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteDVRRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteDVRRequest) GetDvrID() int64 { + if d == nil { + return 0 + } + return d.DvrID +} + +type DeleteDVRResponse 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 (d *DeleteDVRResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteDVRResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteDVRResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletehistory.go b/models/operations/deletehistory.go new file mode 100644 index 0000000..a0f2d60 --- /dev/null +++ b/models/operations/deletehistory.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteHistoryGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteHistoryGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteHistoryGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteHistoryGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteHistoryGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteHistoryGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteHistoryGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteHistoryGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteHistoryGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteHistoryGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteHistoryGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteHistoryGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteHistoryGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteHistoryGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteHistoryRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the history item (the `historyKey` from above) + HistoryID int64 `pathParam:"style=simple,explode=false,name=historyId"` +} + +func (d DeleteHistoryRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteHistoryRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"historyId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteHistoryRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteHistoryRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteHistoryRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteHistoryRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteHistoryRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteHistoryRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteHistoryRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteHistoryRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteHistoryRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteHistoryRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteHistoryRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteHistoryRequest) GetHistoryID() int64 { + if d == nil { + return 0 + } + return d.HistoryID +} + +type DeleteHistoryResponse 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 + // OK + MediaContainer *components.MediaContainer + Headers map[string][]string +} + +func (d *DeleteHistoryResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteHistoryResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteHistoryResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} + +func (d *DeleteHistoryResponse) GetMediaContainer() *components.MediaContainer { + if d == nil { + return nil + } + return d.MediaContainer +} + +func (d *DeleteHistoryResponse) GetHeaders() map[string][]string { + if d == nil { + return map[string][]string{} + } + return d.Headers +} diff --git a/models/operations/deleteindexes.go b/models/operations/deleteindexes.go new file mode 100644 index 0000000..7c671c3 --- /dev/null +++ b/models/operations/deleteindexes.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteIndexesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteIndexesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteIndexesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteIndexesGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteIndexesGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteIndexesGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteIndexesGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteIndexesGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteIndexesGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteIndexesGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteIndexesGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteIndexesGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteIndexesGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteIndexesGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteIndexesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (d DeleteIndexesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteIndexesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteIndexesRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteIndexesRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteIndexesRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteIndexesRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteIndexesRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteIndexesRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteIndexesRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteIndexesRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteIndexesRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteIndexesRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteIndexesRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteIndexesRequest) GetSectionID() int64 { + if d == nil { + return 0 + } + return d.SectionID +} + +type DeleteIndexesResponse 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 (d *DeleteIndexesResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteIndexesResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteIndexesResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deleteintros.go b/models/operations/deleteintros.go new file mode 100644 index 0000000..5eda6ce --- /dev/null +++ b/models/operations/deleteintros.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteIntrosGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteIntrosGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteIntrosGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteIntrosGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteIntrosGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteIntrosGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteIntrosGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteIntrosGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteIntrosGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteIntrosGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteIntrosGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteIntrosGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteIntrosGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteIntrosGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteIntrosRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (d DeleteIntrosRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteIntrosRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteIntrosRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteIntrosRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteIntrosRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteIntrosRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteIntrosRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteIntrosRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteIntrosRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteIntrosRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteIntrosRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteIntrosRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteIntrosRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteIntrosRequest) GetSectionID() int64 { + if d == nil { + return 0 + } + return d.SectionID +} + +type DeleteIntrosResponse 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 (d *DeleteIntrosResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteIntrosResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteIntrosResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletelibrary.go b/models/operations/deletelibrary.go deleted file mode 100644 index 4579196..0000000 --- a/models/operations/deletelibrary.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type DeleteLibraryRequest struct { - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` -} - -func (d *DeleteLibraryRequest) GetSectionKey() int { - if d == nil { - return 0 - } - return d.SectionKey -} - -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 (d *DeleteLibraryResponse) GetContentType() string { - if d == nil { - return "" - } - return d.ContentType -} - -func (d *DeleteLibraryResponse) GetStatusCode() int { - if d == nil { - return 0 - } - return d.StatusCode -} - -func (d *DeleteLibraryResponse) GetRawResponse() *http.Response { - if d == nil { - return nil - } - return d.RawResponse -} diff --git a/models/operations/deletelibrarysection.go b/models/operations/deletelibrarysection.go new file mode 100644 index 0000000..f4b7eea --- /dev/null +++ b/models/operations/deletelibrarysection.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteLibrarySectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteLibrarySectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteLibrarySectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteLibrarySectionGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteLibrarySectionGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteLibrarySectionGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteLibrarySectionGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteLibrarySectionGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteLibrarySectionGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteLibrarySectionGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteLibrarySectionGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteLibrarySectionGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteLibrarySectionGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteLibrarySectionGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteLibrarySectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section identifier + SectionID string `pathParam:"style=simple,explode=false,name=sectionId"` + // If set, response will return an activity with the actual deletion process. Otherwise request will return when deletion is complete + Async *components.BoolInt `queryParam:"style=form,explode=true,name=async"` +} + +func (d DeleteLibrarySectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteLibrarySectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteLibrarySectionRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteLibrarySectionRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteLibrarySectionRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteLibrarySectionRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteLibrarySectionRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteLibrarySectionRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteLibrarySectionRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteLibrarySectionRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteLibrarySectionRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteLibrarySectionRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteLibrarySectionRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteLibrarySectionRequest) GetSectionID() string { + if d == nil { + return "" + } + return d.SectionID +} + +func (d *DeleteLibrarySectionRequest) GetAsync() *components.BoolInt { + if d == nil { + return nil + } + return d.Async +} + +type DeleteLibrarySectionResponse 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 (d *DeleteLibrarySectionResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteLibrarySectionResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteLibrarySectionResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletelineup.go b/models/operations/deletelineup.go new file mode 100644 index 0000000..fe4e19c --- /dev/null +++ b/models/operations/deletelineup.go @@ -0,0 +1,425 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteLineupGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteLineupGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteLineupGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteLineupGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteLineupGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteLineupGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteLineupGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteLineupGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteLineupGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteLineupGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteLineupGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteLineupGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteLineupGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteLineupGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteLineupRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` + // The lineup to delete + Lineup string `queryParam:"style=form,explode=true,name=lineup"` +} + +func (d DeleteLineupRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteLineupRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"dvrId", "lineup"}); err != nil { + return err + } + return nil +} + +func (d *DeleteLineupRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteLineupRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteLineupRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteLineupRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteLineupRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteLineupRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteLineupRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteLineupRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteLineupRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteLineupRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteLineupRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteLineupRequest) GetDvrID() int64 { + if d == nil { + return 0 + } + return d.DvrID +} + +func (d *DeleteLineupRequest) GetLineup() string { + if d == nil { + return "" + } + return d.Lineup +} + +// DeleteLineupDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type DeleteLineupDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (d *DeleteLineupDVRsMediaContainer) GetIdentifier() *string { + if d == nil { + return nil + } + return d.Identifier +} + +func (d *DeleteLineupDVRsMediaContainer) GetOffset() *int64 { + if d == nil { + return nil + } + return d.Offset +} + +func (d *DeleteLineupDVRsMediaContainer) GetSize() *int64 { + if d == nil { + return nil + } + return d.Size +} + +func (d *DeleteLineupDVRsMediaContainer) GetTotalSize() *int64 { + if d == nil { + return nil + } + return d.TotalSize +} + +func (d *DeleteLineupDVRsMediaContainer) GetStatus() *int64 { + if d == nil { + return nil + } + return d.Status +} + +type DeleteLineupDVR struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (d *DeleteLineupDVR) GetDevice() []components.Device { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteLineupDVR) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *DeleteLineupDVR) GetLanguage() *string { + if d == nil { + return nil + } + return d.Language +} + +func (d *DeleteLineupDVR) GetLineup() *string { + if d == nil { + return nil + } + return d.Lineup +} + +func (d *DeleteLineupDVR) GetUUID() *string { + if d == nil { + return nil + } + return d.UUID +} + +type DeleteLineupMediaContainer struct { + MediaContainer *DeleteLineupDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []DeleteLineupDVR `json:"DVR,omitempty"` +} + +func (d *DeleteLineupMediaContainer) GetMediaContainer() *DeleteLineupDVRsMediaContainer { + if d == nil { + return nil + } + return d.MediaContainer +} + +func (d *DeleteLineupMediaContainer) GetDvr() []DeleteLineupDVR { + if d == nil { + return nil + } + return d.Dvr +} + +// DeleteLineupResponseBody - OK +type DeleteLineupResponseBody struct { + MediaContainer *DeleteLineupMediaContainer `json:"MediaContainer,omitempty"` +} + +func (d *DeleteLineupResponseBody) GetMediaContainer() *DeleteLineupMediaContainer { + if d == nil { + return nil + } + return d.MediaContainer +} + +type DeleteLineupResponse 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 + // OK + Object *DeleteLineupResponseBody + Headers map[string][]string +} + +func (d *DeleteLineupResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteLineupResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteLineupResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} + +func (d *DeleteLineupResponse) GetObject() *DeleteLineupResponseBody { + if d == nil { + return nil + } + return d.Object +} + +func (d *DeleteLineupResponse) GetHeaders() map[string][]string { + if d == nil { + return map[string][]string{} + } + return d.Headers +} diff --git a/models/operations/deletemarker.go b/models/operations/deletemarker.go new file mode 100644 index 0000000..b3e14bf --- /dev/null +++ b/models/operations/deletemarker.go @@ -0,0 +1,281 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteMarkerGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteMarkerGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMarkerGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteMarkerGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMarkerGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMarkerGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMarkerGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMarkerGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMarkerGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMarkerGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMarkerGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMarkerGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMarkerGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMarkerGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteMarkerRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Marker string `pathParam:"style=simple,explode=false,name=marker"` +} + +func (d DeleteMarkerRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMarkerRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids", "marker"}); err != nil { + return err + } + return nil +} + +func (d *DeleteMarkerRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMarkerRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMarkerRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMarkerRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMarkerRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMarkerRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMarkerRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMarkerRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMarkerRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMarkerRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMarkerRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteMarkerRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +func (d *DeleteMarkerRequest) GetMarker() string { + if d == nil { + return "" + } + return d.Marker +} + +type DeleteMarkerResponse 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 (d *DeleteMarkerResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteMarkerResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteMarkerResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletemediaitem.go b/models/operations/deletemediaitem.go new file mode 100644 index 0000000..02e9fa0 --- /dev/null +++ b/models/operations/deletemediaitem.go @@ -0,0 +1,290 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteMediaItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteMediaItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMediaItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteMediaItemGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMediaItemGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMediaItemGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMediaItemGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMediaItemGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMediaItemGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMediaItemGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMediaItemGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMediaItemGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMediaItemGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMediaItemGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteMediaItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + MediaItem string `pathParam:"style=simple,explode=false,name=mediaItem"` + // Whether proxy items, such as media optimized versions, should also be deleted. Defaults to false. + Proxy *components.BoolInt `queryParam:"style=form,explode=true,name=proxy"` +} + +func (d DeleteMediaItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMediaItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids", "mediaItem"}); err != nil { + return err + } + return nil +} + +func (d *DeleteMediaItemRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMediaItemRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMediaItemRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMediaItemRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMediaItemRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMediaItemRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMediaItemRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMediaItemRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMediaItemRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMediaItemRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMediaItemRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteMediaItemRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +func (d *DeleteMediaItemRequest) GetMediaItem() string { + if d == nil { + return "" + } + return d.MediaItem +} + +func (d *DeleteMediaItemRequest) GetProxy() *components.BoolInt { + if d == nil { + return nil + } + return d.Proxy +} + +type DeleteMediaItemResponse 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 (d *DeleteMediaItemResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteMediaItemResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteMediaItemResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletemediaprovider.go b/models/operations/deletemediaprovider.go new file mode 100644 index 0000000..7f550ea --- /dev/null +++ b/models/operations/deletemediaprovider.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteMediaProviderGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteMediaProviderGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMediaProviderGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteMediaProviderGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMediaProviderGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMediaProviderGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMediaProviderGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMediaProviderGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMediaProviderGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMediaProviderGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMediaProviderGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMediaProviderGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMediaProviderGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMediaProviderGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteMediaProviderRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the media provider to delete + Provider string `pathParam:"style=simple,explode=false,name=provider"` +} + +func (d DeleteMediaProviderRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMediaProviderRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"provider"}); err != nil { + return err + } + return nil +} + +func (d *DeleteMediaProviderRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMediaProviderRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMediaProviderRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMediaProviderRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMediaProviderRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMediaProviderRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMediaProviderRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMediaProviderRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMediaProviderRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMediaProviderRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMediaProviderRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteMediaProviderRequest) GetProvider() string { + if d == nil { + return "" + } + return d.Provider +} + +type DeleteMediaProviderResponse 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 (d *DeleteMediaProviderResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteMediaProviderResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteMediaProviderResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletemetadataitem.go b/models/operations/deletemetadataitem.go new file mode 100644 index 0000000..d72eed8 --- /dev/null +++ b/models/operations/deletemetadataitem.go @@ -0,0 +1,282 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteMetadataItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteMetadataItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMetadataItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteMetadataItemGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMetadataItemGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMetadataItemGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMetadataItemGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMetadataItemGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMetadataItemGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMetadataItemGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMetadataItemGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMetadataItemGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMetadataItemGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMetadataItemGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteMetadataItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // Whether proxy items, such as media optimized versions, should also be deleted. Defaults to false. + Proxy *components.BoolInt `queryParam:"style=form,explode=true,name=proxy"` +} + +func (d DeleteMetadataItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteMetadataItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (d *DeleteMetadataItemRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteMetadataItemRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteMetadataItemRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteMetadataItemRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteMetadataItemRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteMetadataItemRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteMetadataItemRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteMetadataItemRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteMetadataItemRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteMetadataItemRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteMetadataItemRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteMetadataItemRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +func (d *DeleteMetadataItemRequest) GetProxy() *components.BoolInt { + if d == nil { + return nil + } + return d.Proxy +} + +type DeleteMetadataItemResponse 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 (d *DeleteMetadataItemResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteMetadataItemResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteMetadataItemResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deleteplaylist.go b/models/operations/deleteplaylist.go index db8efa6..b1b7db6 100644 --- a/models/operations/deleteplaylist.go +++ b/models/operations/deleteplaylist.go @@ -3,17 +3,242 @@ package operations import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -type DeletePlaylistRequest struct { - // the ID of the playlist - PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` +type DeletePlaylistGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (d *DeletePlaylistRequest) GetPlaylistID() float64 { +func (d DeletePlaylistGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeletePlaylistGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeletePlaylistGlobals) GetAccepts() *components.Accepts { if d == nil { - return 0.0 + return nil + } + return d.Accepts +} + +func (d *DeletePlaylistGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeletePlaylistGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeletePlaylistGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeletePlaylistGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeletePlaylistGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeletePlaylistGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeletePlaylistGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeletePlaylistGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeletePlaylistGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeletePlaylistGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeletePlaylistRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` +} + +func (d DeletePlaylistRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeletePlaylistRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (d *DeletePlaylistRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeletePlaylistRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeletePlaylistRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeletePlaylistRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeletePlaylistRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeletePlaylistRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeletePlaylistRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeletePlaylistRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeletePlaylistRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeletePlaylistRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeletePlaylistRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeletePlaylistRequest) GetPlaylistID() int64 { + if d == nil { + return 0 } return d.PlaylistID } diff --git a/models/operations/deleteplaylistitem.go b/models/operations/deleteplaylistitem.go new file mode 100644 index 0000000..a4eb325 --- /dev/null +++ b/models/operations/deleteplaylistitem.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeletePlaylistItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeletePlaylistItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeletePlaylistItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeletePlaylistItemGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeletePlaylistItemGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeletePlaylistItemGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeletePlaylistItemGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeletePlaylistItemGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeletePlaylistItemGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeletePlaylistItemGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeletePlaylistItemGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeletePlaylistItemGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeletePlaylistItemGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeletePlaylistItemGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeletePlaylistItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The generator item ID to delete. + GeneratorID int64 `pathParam:"style=simple,explode=false,name=generatorId"` +} + +func (d DeletePlaylistItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeletePlaylistItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"playlistId", "generatorId"}); err != nil { + return err + } + return nil +} + +func (d *DeletePlaylistItemRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeletePlaylistItemRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeletePlaylistItemRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeletePlaylistItemRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeletePlaylistItemRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeletePlaylistItemRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeletePlaylistItemRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeletePlaylistItemRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeletePlaylistItemRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeletePlaylistItemRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeletePlaylistItemRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeletePlaylistItemRequest) GetPlaylistID() int64 { + if d == nil { + return 0 + } + return d.PlaylistID +} + +func (d *DeletePlaylistItemRequest) GetGeneratorID() int64 { + if d == nil { + return 0 + } + return d.GeneratorID +} + +type DeletePlaylistItemResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (d *DeletePlaylistItemResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeletePlaylistItemResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeletePlaylistItemResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} + +func (d *DeletePlaylistItemResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if d == nil { + return nil + } + return d.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/deleteplayqueueitem.go b/models/operations/deleteplayqueueitem.go new file mode 100644 index 0000000..a1a5696 --- /dev/null +++ b/models/operations/deleteplayqueueitem.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeletePlayQueueItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeletePlayQueueItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeletePlayQueueItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeletePlayQueueItemGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeletePlayQueueItemGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeletePlayQueueItemGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeletePlayQueueItemGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeletePlayQueueItemGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeletePlayQueueItemGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeletePlayQueueItemGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeletePlayQueueItemGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeletePlayQueueItemGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeletePlayQueueItemGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeletePlayQueueItemGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeletePlayQueueItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` + // The play queue item ID to delete. + PlayQueueItemID int64 `pathParam:"style=simple,explode=false,name=playQueueItemId"` +} + +func (d DeletePlayQueueItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeletePlayQueueItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"playQueueId", "playQueueItemId"}); err != nil { + return err + } + return nil +} + +func (d *DeletePlayQueueItemRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeletePlayQueueItemRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeletePlayQueueItemRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeletePlayQueueItemRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeletePlayQueueItemRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeletePlayQueueItemRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeletePlayQueueItemRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeletePlayQueueItemRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeletePlayQueueItemRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeletePlayQueueItemRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeletePlayQueueItemRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeletePlayQueueItemRequest) GetPlayQueueID() int64 { + if d == nil { + return 0 + } + return d.PlayQueueID +} + +func (d *DeletePlayQueueItemRequest) GetPlayQueueItemID() int64 { + if d == nil { + return 0 + } + return d.PlayQueueItemID +} + +type DeletePlayQueueItemResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (d *DeletePlayQueueItemResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeletePlayQueueItemResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeletePlayQueueItemResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} + +func (d *DeletePlayQueueItemResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if d == nil { + return nil + } + return d.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/deletestream.go b/models/operations/deletestream.go new file mode 100644 index 0000000..ba51331 --- /dev/null +++ b/models/operations/deletestream.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteStreamGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteStreamGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteStreamGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteStreamGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteStreamGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteStreamGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteStreamGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteStreamGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteStreamGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteStreamGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteStreamGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteStreamGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteStreamGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteStreamGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteStreamRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the stream + StreamID int64 `pathParam:"style=simple,explode=false,name=streamId"` + // This is not a part of this endpoint but documented here to satisfy OpenAPI + Ext string `pathParam:"style=simple,explode=false,name=ext"` +} + +func (d DeleteStreamRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteStreamRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"streamId", "ext"}); err != nil { + return err + } + return nil +} + +func (d *DeleteStreamRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteStreamRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteStreamRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteStreamRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteStreamRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteStreamRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteStreamRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteStreamRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteStreamRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteStreamRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteStreamRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteStreamRequest) GetStreamID() int64 { + if d == nil { + return 0 + } + return d.StreamID +} + +func (d *DeleteStreamRequest) GetExt() string { + if d == nil { + return "" + } + return d.Ext +} + +type DeleteStreamResponse 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 (d *DeleteStreamResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteStreamResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteStreamResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/deletesubscription.go b/models/operations/deletesubscription.go new file mode 100644 index 0000000..899fdf2 --- /dev/null +++ b/models/operations/deletesubscription.go @@ -0,0 +1,273 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DeleteSubscriptionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DeleteSubscriptionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteSubscriptionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteSubscriptionGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteSubscriptionGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteSubscriptionGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteSubscriptionGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteSubscriptionGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteSubscriptionGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteSubscriptionGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteSubscriptionGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteSubscriptionGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteSubscriptionGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteSubscriptionGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DeleteSubscriptionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + SubscriptionID int64 `pathParam:"style=simple,explode=false,name=subscriptionId"` +} + +func (d DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteSubscriptionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"subscriptionId"}); err != nil { + return err + } + return nil +} + +func (d *DeleteSubscriptionRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DeleteSubscriptionRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DeleteSubscriptionRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DeleteSubscriptionRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DeleteSubscriptionRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DeleteSubscriptionRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DeleteSubscriptionRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DeleteSubscriptionRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DeleteSubscriptionRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DeleteSubscriptionRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DeleteSubscriptionRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DeleteSubscriptionRequest) GetSubscriptionID() int64 { + if d == nil { + return 0 + } + return d.SubscriptionID +} + +type DeleteSubscriptionResponse 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 (d *DeleteSubscriptionResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DeleteSubscriptionResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DeleteSubscriptionResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/detectads.go b/models/operations/detectads.go new file mode 100644 index 0000000..25b6f7f --- /dev/null +++ b/models/operations/detectads.go @@ -0,0 +1,273 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DetectAdsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DetectAdsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectAdsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DetectAdsGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectAdsGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectAdsGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectAdsGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectAdsGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectAdsGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectAdsGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectAdsGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectAdsGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectAdsGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectAdsGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DetectAdsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (d DetectAdsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectAdsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (d *DetectAdsRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectAdsRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectAdsRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectAdsRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectAdsRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectAdsRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectAdsRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectAdsRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectAdsRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectAdsRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectAdsRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DetectAdsRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +type DetectAdsResponse 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 (d *DetectAdsResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DetectAdsResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DetectAdsResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/detectcredits.go b/models/operations/detectcredits.go new file mode 100644 index 0000000..c26e02b --- /dev/null +++ b/models/operations/detectcredits.go @@ -0,0 +1,289 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DetectCreditsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DetectCreditsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectCreditsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DetectCreditsGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectCreditsGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectCreditsGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectCreditsGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectCreditsGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectCreditsGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectCreditsGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectCreditsGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectCreditsGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectCreditsGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectCreditsGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DetectCreditsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Force *components.BoolInt `queryParam:"style=form,explode=true,name=force"` + Manual *components.BoolInt `queryParam:"style=form,explode=true,name=manual"` +} + +func (d DetectCreditsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectCreditsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (d *DetectCreditsRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectCreditsRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectCreditsRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectCreditsRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectCreditsRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectCreditsRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectCreditsRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectCreditsRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectCreditsRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectCreditsRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectCreditsRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DetectCreditsRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +func (d *DetectCreditsRequest) GetForce() *components.BoolInt { + if d == nil { + return nil + } + return d.Force +} + +func (d *DetectCreditsRequest) GetManual() *components.BoolInt { + if d == nil { + return nil + } + return d.Manual +} + +type DetectCreditsResponse 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 (d *DetectCreditsResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DetectCreditsResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DetectCreditsResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/detectintros.go b/models/operations/detectintros.go new file mode 100644 index 0000000..07e7586 --- /dev/null +++ b/models/operations/detectintros.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DetectIntrosGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DetectIntrosGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectIntrosGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DetectIntrosGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectIntrosGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectIntrosGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectIntrosGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectIntrosGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectIntrosGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectIntrosGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectIntrosGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectIntrosGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectIntrosGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectIntrosGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DetectIntrosRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // Indicate whether detection should be re-run + Force *components.BoolInt `queryParam:"style=form,explode=true,name=force"` + // The threshold for determining if content is an intro or not + Threshold *float64 `queryParam:"style=form,explode=true,name=threshold"` +} + +func (d DetectIntrosRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectIntrosRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (d *DetectIntrosRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectIntrosRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectIntrosRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectIntrosRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectIntrosRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectIntrosRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectIntrosRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectIntrosRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectIntrosRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectIntrosRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectIntrosRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DetectIntrosRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +func (d *DetectIntrosRequest) GetForce() *components.BoolInt { + if d == nil { + return nil + } + return d.Force +} + +func (d *DetectIntrosRequest) GetThreshold() *float64 { + if d == nil { + return nil + } + return d.Threshold +} + +type DetectIntrosResponse 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 (d *DetectIntrosResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DetectIntrosResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DetectIntrosResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/detectvoiceactivity.go b/models/operations/detectvoiceactivity.go new file mode 100644 index 0000000..5a11103 --- /dev/null +++ b/models/operations/detectvoiceactivity.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DetectVoiceActivityGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (d DetectVoiceActivityGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectVoiceActivityGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DetectVoiceActivityGlobals) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectVoiceActivityGlobals) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectVoiceActivityGlobals) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectVoiceActivityGlobals) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectVoiceActivityGlobals) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectVoiceActivityGlobals) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectVoiceActivityGlobals) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectVoiceActivityGlobals) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectVoiceActivityGlobals) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectVoiceActivityGlobals) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectVoiceActivityGlobals) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +type DetectVoiceActivityRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // Indicate whether detection should be re-run + Force *components.BoolInt `queryParam:"style=form,explode=true,name=force"` + // Indicate whether detection is manually run + Manual *components.BoolInt `queryParam:"style=form,explode=true,name=manual"` +} + +func (d DetectVoiceActivityRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DetectVoiceActivityRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (d *DetectVoiceActivityRequest) GetAccepts() *components.Accepts { + if d == nil { + return nil + } + return d.Accepts +} + +func (d *DetectVoiceActivityRequest) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *DetectVoiceActivityRequest) GetProduct() *string { + if d == nil { + return nil + } + return d.Product +} + +func (d *DetectVoiceActivityRequest) GetVersion() *string { + if d == nil { + return nil + } + return d.Version +} + +func (d *DetectVoiceActivityRequest) GetPlatform() *string { + if d == nil { + return nil + } + return d.Platform +} + +func (d *DetectVoiceActivityRequest) GetPlatformVersion() *string { + if d == nil { + return nil + } + return d.PlatformVersion +} + +func (d *DetectVoiceActivityRequest) GetDevice() *string { + if d == nil { + return nil + } + return d.Device +} + +func (d *DetectVoiceActivityRequest) GetModel() *string { + if d == nil { + return nil + } + return d.Model +} + +func (d *DetectVoiceActivityRequest) GetDeviceVendor() *string { + if d == nil { + return nil + } + return d.DeviceVendor +} + +func (d *DetectVoiceActivityRequest) GetDeviceName() *string { + if d == nil { + return nil + } + return d.DeviceName +} + +func (d *DetectVoiceActivityRequest) GetMarketplace() *string { + if d == nil { + return nil + } + return d.Marketplace +} + +func (d *DetectVoiceActivityRequest) GetIds() string { + if d == nil { + return "" + } + return d.Ids +} + +func (d *DetectVoiceActivityRequest) GetForce() *components.BoolInt { + if d == nil { + return nil + } + return d.Force +} + +func (d *DetectVoiceActivityRequest) GetManual() *components.BoolInt { + if d == nil { + return nil + } + return d.Manual +} + +type DetectVoiceActivityResponse 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 (d *DetectVoiceActivityResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DetectVoiceActivityResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DetectVoiceActivityResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} diff --git a/models/operations/discoverdevices.go b/models/operations/discoverdevices.go new file mode 100644 index 0000000..1c0d7a2 --- /dev/null +++ b/models/operations/discoverdevices.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type DiscoverDevicesResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice +} + +func (d *DiscoverDevicesResponse) GetContentType() string { + if d == nil { + return "" + } + return d.ContentType +} + +func (d *DiscoverDevicesResponse) GetStatusCode() int { + if d == nil { + return 0 + } + return d.StatusCode +} + +func (d *DiscoverDevicesResponse) GetRawResponse() *http.Response { + if d == nil { + return nil + } + return d.RawResponse +} + +func (d *DiscoverDevicesResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if d == nil { + return nil + } + return d.MediaContainerWithDevice +} diff --git a/models/operations/editmarker.go b/models/operations/editmarker.go new file mode 100644 index 0000000..3b6b8ce --- /dev/null +++ b/models/operations/editmarker.go @@ -0,0 +1,331 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type EditMarkerGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (e EditMarkerGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditMarkerGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditMarkerGlobals) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditMarkerGlobals) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditMarkerGlobals) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditMarkerGlobals) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditMarkerGlobals) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditMarkerGlobals) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditMarkerGlobals) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditMarkerGlobals) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditMarkerGlobals) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditMarkerGlobals) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditMarkerGlobals) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +// QueryParamAttributes - The attributes to assign to this marker +type QueryParamAttributes struct { +} + +type EditMarkerRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // The id of the marker to edit + Marker string `pathParam:"style=simple,explode=false,name=marker"` + // The type of marker to edit/create + Type int64 `queryParam:"style=form,explode=true,name=type"` + // The start time of the marker + StartTimeOffset int64 `queryParam:"style=form,explode=true,name=startTimeOffset"` + // The end time of the marker + EndTimeOffset *int64 `queryParam:"style=form,explode=true,name=endTimeOffset"` + // The attributes to assign to this marker + Attributes *QueryParamAttributes `queryParam:"style=deepObject,explode=true,name=attributes"` +} + +func (e EditMarkerRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditMarkerRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, []string{"ids", "marker", "type", "startTimeOffset"}); err != nil { + return err + } + return nil +} + +func (e *EditMarkerRequest) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditMarkerRequest) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditMarkerRequest) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditMarkerRequest) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditMarkerRequest) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditMarkerRequest) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditMarkerRequest) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditMarkerRequest) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditMarkerRequest) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditMarkerRequest) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditMarkerRequest) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +func (e *EditMarkerRequest) GetIds() string { + if e == nil { + return "" + } + return e.Ids +} + +func (e *EditMarkerRequest) GetMarker() string { + if e == nil { + return "" + } + return e.Marker +} + +func (e *EditMarkerRequest) GetType() int64 { + if e == nil { + return 0 + } + return e.Type +} + +func (e *EditMarkerRequest) GetStartTimeOffset() int64 { + if e == nil { + return 0 + } + return e.StartTimeOffset +} + +func (e *EditMarkerRequest) GetEndTimeOffset() *int64 { + if e == nil { + return nil + } + return e.EndTimeOffset +} + +func (e *EditMarkerRequest) GetAttributes() *QueryParamAttributes { + if e == nil { + return nil + } + return e.Attributes +} + +type EditMarkerResponse 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 + // OK + PostResponses200 *components.PostResponses200 +} + +func (e *EditMarkerResponse) GetContentType() string { + if e == nil { + return "" + } + return e.ContentType +} + +func (e *EditMarkerResponse) GetStatusCode() int { + if e == nil { + return 0 + } + return e.StatusCode +} + +func (e *EditMarkerResponse) GetRawResponse() *http.Response { + if e == nil { + return nil + } + return e.RawResponse +} + +func (e *EditMarkerResponse) GetPostResponses200() *components.PostResponses200 { + if e == nil { + return nil + } + return e.PostResponses200 +} diff --git a/models/operations/editmetadataitem.go b/models/operations/editmetadataitem.go new file mode 100644 index 0000000..7549210 --- /dev/null +++ b/models/operations/editmetadataitem.go @@ -0,0 +1,286 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type EditMetadataItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (e EditMetadataItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditMetadataItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditMetadataItemGlobals) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditMetadataItemGlobals) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditMetadataItemGlobals) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditMetadataItemGlobals) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditMetadataItemGlobals) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditMetadataItemGlobals) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditMetadataItemGlobals) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditMetadataItemGlobals) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditMetadataItemGlobals) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditMetadataItemGlobals) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditMetadataItemGlobals) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +// Args - The new values for the metadata item +type Args struct { +} + +type EditMetadataItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids []string `pathParam:"style=simple,explode=false,name=ids"` + // The new values for the metadata item + Args *Args `queryParam:"style=form,explode=true,name=args"` +} + +func (e EditMetadataItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditMetadataItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (e *EditMetadataItemRequest) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditMetadataItemRequest) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditMetadataItemRequest) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditMetadataItemRequest) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditMetadataItemRequest) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditMetadataItemRequest) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditMetadataItemRequest) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditMetadataItemRequest) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditMetadataItemRequest) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditMetadataItemRequest) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditMetadataItemRequest) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +func (e *EditMetadataItemRequest) GetIds() []string { + if e == nil { + return []string{} + } + return e.Ids +} + +func (e *EditMetadataItemRequest) GetArgs() *Args { + if e == nil { + return nil + } + return e.Args +} + +type EditMetadataItemResponse 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 (e *EditMetadataItemResponse) GetContentType() string { + if e == nil { + return "" + } + return e.ContentType +} + +func (e *EditMetadataItemResponse) GetStatusCode() int { + if e == nil { + return 0 + } + return e.StatusCode +} + +func (e *EditMetadataItemResponse) GetRawResponse() *http.Response { + if e == nil { + return nil + } + return e.RawResponse +} diff --git a/models/operations/editsection.go b/models/operations/editsection.go new file mode 100644 index 0000000..393a4ef --- /dev/null +++ b/models/operations/editsection.go @@ -0,0 +1,341 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type EditSectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (e EditSectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditSectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditSectionGlobals) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditSectionGlobals) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditSectionGlobals) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditSectionGlobals) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditSectionGlobals) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditSectionGlobals) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditSectionGlobals) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditSectionGlobals) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditSectionGlobals) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditSectionGlobals) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditSectionGlobals) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +// EditSectionQueryParamPrefs - The preferences for this section +type EditSectionQueryParamPrefs struct { +} + +type EditSectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section identifier + SectionID string `pathParam:"style=simple,explode=false,name=sectionId"` + // The name of the new section + Name *string `queryParam:"style=form,explode=true,name=name"` + // The scanner this section should use + Scanner *string `queryParam:"style=form,explode=true,name=scanner"` + // The agent this section should use for metadata + Agent string `queryParam:"style=form,explode=true,name=agent"` + // The agent group id for this section + MetadataAgentProviderGroupID *string `queryParam:"style=form,explode=true,name=metadataAgentProviderGroupId"` + // The language of this section + Language *string `queryParam:"style=form,explode=true,name=language"` + // The locations on disk to add to this section + Locations []string `queryParam:"style=form,explode=true,name=locations"` + // The preferences for this section + Prefs *EditSectionQueryParamPrefs `queryParam:"style=deepObject,explode=true,name=prefs"` +} + +func (e EditSectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditSectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, []string{"sectionId", "agent"}); err != nil { + return err + } + return nil +} + +func (e *EditSectionRequest) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditSectionRequest) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditSectionRequest) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditSectionRequest) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditSectionRequest) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditSectionRequest) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditSectionRequest) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditSectionRequest) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditSectionRequest) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditSectionRequest) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditSectionRequest) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +func (e *EditSectionRequest) GetSectionID() string { + if e == nil { + return "" + } + return e.SectionID +} + +func (e *EditSectionRequest) GetName() *string { + if e == nil { + return nil + } + return e.Name +} + +func (e *EditSectionRequest) GetScanner() *string { + if e == nil { + return nil + } + return e.Scanner +} + +func (e *EditSectionRequest) GetAgent() string { + if e == nil { + return "" + } + return e.Agent +} + +func (e *EditSectionRequest) GetMetadataAgentProviderGroupID() *string { + if e == nil { + return nil + } + return e.MetadataAgentProviderGroupID +} + +func (e *EditSectionRequest) GetLanguage() *string { + if e == nil { + return nil + } + return e.Language +} + +func (e *EditSectionRequest) GetLocations() []string { + if e == nil { + return nil + } + return e.Locations +} + +func (e *EditSectionRequest) GetPrefs() *EditSectionQueryParamPrefs { + if e == nil { + return nil + } + return e.Prefs +} + +type EditSectionResponse 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 (e *EditSectionResponse) GetContentType() string { + if e == nil { + return "" + } + return e.ContentType +} + +func (e *EditSectionResponse) GetStatusCode() int { + if e == nil { + return 0 + } + return e.StatusCode +} + +func (e *EditSectionResponse) GetRawResponse() *http.Response { + if e == nil { + return nil + } + return e.RawResponse +} diff --git a/models/operations/editsubscriptionpreferences.go b/models/operations/editsubscriptionpreferences.go new file mode 100644 index 0000000..4280086 --- /dev/null +++ b/models/operations/editsubscriptionpreferences.go @@ -0,0 +1,293 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type EditSubscriptionPreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (e EditSubscriptionPreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditSubscriptionPreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditSubscriptionPreferencesGlobals) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditSubscriptionPreferencesGlobals) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditSubscriptionPreferencesGlobals) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditSubscriptionPreferencesGlobals) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditSubscriptionPreferencesGlobals) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditSubscriptionPreferencesGlobals) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditSubscriptionPreferencesGlobals) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditSubscriptionPreferencesGlobals) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditSubscriptionPreferencesGlobals) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditSubscriptionPreferencesGlobals) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditSubscriptionPreferencesGlobals) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +type EditSubscriptionPreferencesQueryParamPrefs struct { +} + +type EditSubscriptionPreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + SubscriptionID int64 `pathParam:"style=simple,explode=false,name=subscriptionId"` + Prefs *EditSubscriptionPreferencesQueryParamPrefs `queryParam:"style=deepObject,explode=true,name=prefs"` +} + +func (e EditSubscriptionPreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditSubscriptionPreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, []string{"subscriptionId"}); err != nil { + return err + } + return nil +} + +func (e *EditSubscriptionPreferencesRequest) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EditSubscriptionPreferencesRequest) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EditSubscriptionPreferencesRequest) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EditSubscriptionPreferencesRequest) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EditSubscriptionPreferencesRequest) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EditSubscriptionPreferencesRequest) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EditSubscriptionPreferencesRequest) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EditSubscriptionPreferencesRequest) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EditSubscriptionPreferencesRequest) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EditSubscriptionPreferencesRequest) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EditSubscriptionPreferencesRequest) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +func (e *EditSubscriptionPreferencesRequest) GetSubscriptionID() int64 { + if e == nil { + return 0 + } + return e.SubscriptionID +} + +func (e *EditSubscriptionPreferencesRequest) GetPrefs() *EditSubscriptionPreferencesQueryParamPrefs { + if e == nil { + return nil + } + return e.Prefs +} + +type EditSubscriptionPreferencesResponse 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 + // OK + MediaContainerWithSubscription *components.MediaContainerWithSubscription +} + +func (e *EditSubscriptionPreferencesResponse) GetContentType() string { + if e == nil { + return "" + } + return e.ContentType +} + +func (e *EditSubscriptionPreferencesResponse) GetStatusCode() int { + if e == nil { + return 0 + } + return e.StatusCode +} + +func (e *EditSubscriptionPreferencesResponse) GetRawResponse() *http.Response { + if e == nil { + return nil + } + return e.RawResponse +} + +func (e *EditSubscriptionPreferencesResponse) GetMediaContainerWithSubscription() *components.MediaContainerWithSubscription { + if e == nil { + return nil + } + return e.MediaContainerWithSubscription +} diff --git a/models/operations/emptytrash.go b/models/operations/emptytrash.go new file mode 100644 index 0000000..eb4f098 --- /dev/null +++ b/models/operations/emptytrash.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type EmptyTrashGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (e EmptyTrashGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EmptyTrashGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EmptyTrashGlobals) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EmptyTrashGlobals) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EmptyTrashGlobals) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EmptyTrashGlobals) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EmptyTrashGlobals) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EmptyTrashGlobals) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EmptyTrashGlobals) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EmptyTrashGlobals) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EmptyTrashGlobals) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EmptyTrashGlobals) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EmptyTrashGlobals) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +type EmptyTrashRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (e EmptyTrashRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EmptyTrashRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (e *EmptyTrashRequest) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EmptyTrashRequest) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EmptyTrashRequest) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EmptyTrashRequest) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EmptyTrashRequest) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EmptyTrashRequest) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EmptyTrashRequest) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EmptyTrashRequest) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EmptyTrashRequest) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EmptyTrashRequest) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EmptyTrashRequest) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +func (e *EmptyTrashRequest) GetSectionID() int64 { + if e == nil { + return 0 + } + return e.SectionID +} + +type EmptyTrashResponse 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 (e *EmptyTrashResponse) GetContentType() string { + if e == nil { + return "" + } + return e.ContentType +} + +func (e *EmptyTrashResponse) GetStatusCode() int { + if e == nil { + return 0 + } + return e.StatusCode +} + +func (e *EmptyTrashResponse) GetRawResponse() *http.Response { + if e == nil { + return nil + } + return e.RawResponse +} diff --git a/models/operations/enablepapertrail.go b/models/operations/enablepapertrail.go index d74dc3b..ac5bc84 100644 --- a/models/operations/enablepapertrail.go +++ b/models/operations/enablepapertrail.go @@ -3,10 +3,247 @@ package operations import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -type EnablePaperTrailResponse struct { +type EnablePapertrailGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (e EnablePapertrailGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EnablePapertrailGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EnablePapertrailGlobals) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EnablePapertrailGlobals) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EnablePapertrailGlobals) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EnablePapertrailGlobals) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EnablePapertrailGlobals) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EnablePapertrailGlobals) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EnablePapertrailGlobals) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EnablePapertrailGlobals) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EnablePapertrailGlobals) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EnablePapertrailGlobals) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EnablePapertrailGlobals) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +type EnablePapertrailRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The number of minutes logging should be sent to Papertrail + Minutes *int64 `queryParam:"style=form,explode=true,name=minutes"` +} + +func (e EnablePapertrailRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EnablePapertrailRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EnablePapertrailRequest) GetAccepts() *components.Accepts { + if e == nil { + return nil + } + return e.Accepts +} + +func (e *EnablePapertrailRequest) GetClientIdentifier() *string { + if e == nil { + return nil + } + return e.ClientIdentifier +} + +func (e *EnablePapertrailRequest) GetProduct() *string { + if e == nil { + return nil + } + return e.Product +} + +func (e *EnablePapertrailRequest) GetVersion() *string { + if e == nil { + return nil + } + return e.Version +} + +func (e *EnablePapertrailRequest) GetPlatform() *string { + if e == nil { + return nil + } + return e.Platform +} + +func (e *EnablePapertrailRequest) GetPlatformVersion() *string { + if e == nil { + return nil + } + return e.PlatformVersion +} + +func (e *EnablePapertrailRequest) GetDevice() *string { + if e == nil { + return nil + } + return e.Device +} + +func (e *EnablePapertrailRequest) GetModel() *string { + if e == nil { + return nil + } + return e.Model +} + +func (e *EnablePapertrailRequest) GetDeviceVendor() *string { + if e == nil { + return nil + } + return e.DeviceVendor +} + +func (e *EnablePapertrailRequest) GetDeviceName() *string { + if e == nil { + return nil + } + return e.DeviceName +} + +func (e *EnablePapertrailRequest) GetMarketplace() *string { + if e == nil { + return nil + } + return e.Marketplace +} + +func (e *EnablePapertrailRequest) GetMinutes() *int64 { + if e == nil { + return nil + } + return e.Minutes +} + +type EnablePapertrailResponse struct { // HTTP response content type for this operation ContentType string // HTTP response status code for this operation @@ -15,21 +252,21 @@ type EnablePaperTrailResponse struct { RawResponse *http.Response } -func (e *EnablePaperTrailResponse) GetContentType() string { +func (e *EnablePapertrailResponse) GetContentType() string { if e == nil { return "" } return e.ContentType } -func (e *EnablePaperTrailResponse) GetStatusCode() int { +func (e *EnablePapertrailResponse) GetStatusCode() int { if e == nil { return 0 } return e.StatusCode } -func (e *EnablePaperTrailResponse) GetRawResponse() *http.Response { +func (e *EnablePapertrailResponse) GetRawResponse() *http.Response { if e == nil { return nil } diff --git a/models/operations/generatethumbs.go b/models/operations/generatethumbs.go new file mode 100644 index 0000000..3cad8b8 --- /dev/null +++ b/models/operations/generatethumbs.go @@ -0,0 +1,281 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GenerateThumbsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GenerateThumbsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GenerateThumbsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GenerateThumbsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GenerateThumbsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GenerateThumbsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GenerateThumbsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GenerateThumbsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GenerateThumbsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GenerateThumbsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GenerateThumbsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GenerateThumbsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GenerateThumbsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GenerateThumbsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GenerateThumbsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Force *components.BoolInt `queryParam:"style=form,explode=true,name=force"` +} + +func (g GenerateThumbsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GenerateThumbsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GenerateThumbsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GenerateThumbsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GenerateThumbsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GenerateThumbsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GenerateThumbsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GenerateThumbsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GenerateThumbsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GenerateThumbsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GenerateThumbsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GenerateThumbsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GenerateThumbsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GenerateThumbsRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +func (g *GenerateThumbsRequest) GetForce() *components.BoolInt { + if g == nil { + return nil + } + return g.Force +} + +type GenerateThumbsResponse 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 (g *GenerateThumbsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GenerateThumbsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GenerateThumbsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getactorslibrary.go b/models/operations/getactorslibrary.go deleted file mode 100644 index c326704..0000000 --- a/models/operations/getactorslibrary.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -// GetActorsLibraryQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetActorsLibraryQueryParamType int64 - -const ( - GetActorsLibraryQueryParamTypeMovie GetActorsLibraryQueryParamType = 1 - GetActorsLibraryQueryParamTypeTvShow GetActorsLibraryQueryParamType = 2 - GetActorsLibraryQueryParamTypeSeason GetActorsLibraryQueryParamType = 3 - GetActorsLibraryQueryParamTypeEpisode GetActorsLibraryQueryParamType = 4 - GetActorsLibraryQueryParamTypeArtist GetActorsLibraryQueryParamType = 5 - GetActorsLibraryQueryParamTypeAlbum GetActorsLibraryQueryParamType = 6 - GetActorsLibraryQueryParamTypeTrack GetActorsLibraryQueryParamType = 7 - GetActorsLibraryQueryParamTypePhotoAlbum GetActorsLibraryQueryParamType = 8 - GetActorsLibraryQueryParamTypePhoto GetActorsLibraryQueryParamType = 9 -) - -func (e GetActorsLibraryQueryParamType) ToPointer() *GetActorsLibraryQueryParamType { - return &e -} - -type GetActorsLibraryRequest struct { - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetActorsLibraryQueryParamType `queryParam:"style=form,explode=true,name=type"` -} - -func (g *GetActorsLibraryRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -func (g *GetActorsLibraryRequest) GetType() GetActorsLibraryQueryParamType { - if g == nil { - return GetActorsLibraryQueryParamType(0) - } - return g.Type -} - -type GetActorsLibraryDirectory struct { - // A fast lookup key for the actor relative url. - FastKey string `json:"fastKey"` - // URL for the thumbnail image of the actor. - Thumb string `json:"thumb"` - // A unique key representing the actor. - Key string `json:"key"` - // The name of the actor. - Title string `json:"title"` -} - -func (g *GetActorsLibraryDirectory) GetFastKey() string { - if g == nil { - return "" - } - return g.FastKey -} - -func (g *GetActorsLibraryDirectory) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetActorsLibraryDirectory) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetActorsLibraryDirectory) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetActorsLibraryMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // URL for the background artwork of the media container. - Art string `json:"art"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // Specifies whether caching is disabled. - Nocache bool `json:"nocache"` - // URL for the thumbnail image of the media container. - Thumb string `json:"thumb"` - // The primary title of the media container. - Title1 string `json:"title1"` - // The secondary title of the media container. - Title2 string `json:"title2"` - // Identifier for the view group layout. - ViewGroup string `json:"viewGroup"` - // Identifier for the view mode. - ViewMode *string `json:"viewMode,omitempty"` - // An array of actor entries for media items. - Directory []GetActorsLibraryDirectory `json:"Directory,omitempty"` -} - -func (g *GetActorsLibraryMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetActorsLibraryMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetActorsLibraryMediaContainer) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetActorsLibraryMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetActorsLibraryMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetActorsLibraryMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetActorsLibraryMediaContainer) GetNocache() bool { - if g == nil { - return false - } - return g.Nocache -} - -func (g *GetActorsLibraryMediaContainer) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetActorsLibraryMediaContainer) GetTitle1() string { - if g == nil { - return "" - } - return g.Title1 -} - -func (g *GetActorsLibraryMediaContainer) GetTitle2() string { - if g == nil { - return "" - } - return g.Title2 -} - -func (g *GetActorsLibraryMediaContainer) GetViewGroup() string { - if g == nil { - return "" - } - return g.ViewGroup -} - -func (g *GetActorsLibraryMediaContainer) GetViewMode() *string { - if g == nil { - return nil - } - return g.ViewMode -} - -func (g *GetActorsLibraryMediaContainer) GetDirectory() []GetActorsLibraryDirectory { - if g == nil { - return nil - } - return g.Directory -} - -// GetActorsLibraryResponseBody - Successful response containing media container data. -type GetActorsLibraryResponseBody struct { - MediaContainer *GetActorsLibraryMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetActorsLibraryResponseBody) GetMediaContainer() *GetActorsLibraryMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetActorsLibraryResponse 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 - // Successful response containing media container data. - Object *GetActorsLibraryResponseBody -} - -func (g *GetActorsLibraryResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetActorsLibraryResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetActorsLibraryResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetActorsLibraryResponse) GetObject() *GetActorsLibraryResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getalbums.go b/models/operations/getalbums.go new file mode 100644 index 0000000..3984680 --- /dev/null +++ b/models/operations/getalbums.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAlbumsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAlbumsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAlbumsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAlbumsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAlbumsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAlbumsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAlbumsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAlbumsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAlbumsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAlbumsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAlbumsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAlbumsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAlbumsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAlbumsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAlbumsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetAlbumsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAlbumsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetAlbumsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAlbumsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAlbumsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAlbumsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAlbumsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAlbumsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAlbumsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAlbumsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAlbumsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAlbumsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAlbumsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAlbumsRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +type GetAlbumsResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (g *GetAlbumsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAlbumsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAlbumsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAlbumsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} diff --git a/models/operations/getallhubs.go b/models/operations/getallhubs.go new file mode 100644 index 0000000..222d2c9 --- /dev/null +++ b/models/operations/getallhubs.go @@ -0,0 +1,371 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAllHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAllHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAllHubsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllHubsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllHubsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllHubsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllHubsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllHubsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllHubsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllHubsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllHubsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllHubsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllHubsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAllHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Limit results to count items + Count *int64 `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 *components.BoolInt `queryParam:"style=form,explode=true,name=onlyTransient"` + // If provided, limit to only specified hubs + Identifier []string `queryParam:"style=form,explode=true,name=identifier"` +} + +func (g GetAllHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAllHubsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllHubsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllHubsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllHubsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllHubsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllHubsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllHubsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllHubsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllHubsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllHubsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllHubsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAllHubsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetAllHubsRequest) GetOnlyTransient() *components.BoolInt { + if g == nil { + return nil + } + return g.OnlyTransient +} + +func (g *GetAllHubsRequest) GetIdentifier() []string { + if g == nil { + return nil + } + return g.Identifier +} + +// GetAllHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetAllHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (g *GetAllHubsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetAllHubsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetAllHubsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetAllHubsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetAllHubsMediaContainer) GetHub() []components.Hub { + if g == nil { + return nil + } + return g.Hub +} + +// GetAllHubsResponseBody - OK +type GetAllHubsResponseBody struct { + MediaContainer *GetAllHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetAllHubsResponseBody) GetMediaContainer() *GetAllHubsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetAllHubsResponse 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 + // OK + Object *GetAllHubsResponseBody + Headers map[string][]string +} + +func (g *GetAllHubsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAllHubsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAllHubsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAllHubsResponse) GetObject() *GetAllHubsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetAllHubsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getallitemleaves.go b/models/operations/getallitemleaves.go new file mode 100644 index 0000000..342aa1f --- /dev/null +++ b/models/operations/getallitemleaves.go @@ -0,0 +1,290 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAllItemLeavesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAllItemLeavesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllItemLeavesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAllItemLeavesGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllItemLeavesGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllItemLeavesGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllItemLeavesGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllItemLeavesGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllItemLeavesGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllItemLeavesGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllItemLeavesGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllItemLeavesGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllItemLeavesGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllItemLeavesGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAllItemLeavesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (g GetAllItemLeavesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllItemLeavesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GetAllItemLeavesRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllItemLeavesRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllItemLeavesRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllItemLeavesRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllItemLeavesRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllItemLeavesRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllItemLeavesRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllItemLeavesRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllItemLeavesRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllItemLeavesRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllItemLeavesRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAllItemLeavesRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +type GetAllItemLeavesResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetAllItemLeavesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAllItemLeavesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAllItemLeavesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAllItemLeavesResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetAllItemLeavesResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getalllanguages.go b/models/operations/getalllanguages.go new file mode 100644 index 0000000..c3162e6 --- /dev/null +++ b/models/operations/getalllanguages.go @@ -0,0 +1,136 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type Language struct { + // 3 letter language code + Code *string `json:"code,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (l *Language) GetCode() *string { + if l == nil { + return nil + } + return l.Code +} + +func (l *Language) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +// GetAllLanguagesMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetAllLanguagesMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Language []Language `json:"Language,omitempty"` +} + +func (g *GetAllLanguagesMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetAllLanguagesMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetAllLanguagesMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetAllLanguagesMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetAllLanguagesMediaContainer) GetLanguage() []Language { + if g == nil { + return nil + } + return g.Language +} + +// GetAllLanguagesResponseBody - OK +type GetAllLanguagesResponseBody struct { + MediaContainer *GetAllLanguagesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetAllLanguagesResponseBody) GetMediaContainer() *GetAllLanguagesMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetAllLanguagesResponse 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 + // OK + Object *GetAllLanguagesResponseBody + Headers map[string][]string +} + +func (g *GetAllLanguagesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAllLanguagesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAllLanguagesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAllLanguagesResponse) GetObject() *GetAllLanguagesResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetAllLanguagesResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getallleaves.go b/models/operations/getallleaves.go new file mode 100644 index 0000000..460d818 --- /dev/null +++ b/models/operations/getallleaves.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAllLeavesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAllLeavesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllLeavesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAllLeavesGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllLeavesGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllLeavesGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllLeavesGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllLeavesGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllLeavesGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllLeavesGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllLeavesGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllLeavesGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllLeavesGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllLeavesGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAllLeavesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetAllLeavesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllLeavesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetAllLeavesRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllLeavesRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllLeavesRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllLeavesRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllLeavesRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllLeavesRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllLeavesRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllLeavesRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllLeavesRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllLeavesRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllLeavesRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAllLeavesRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +type GetAllLeavesResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (g *GetAllLeavesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAllLeavesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAllLeavesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAllLeavesResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} diff --git a/models/operations/getalllibraries.go b/models/operations/getalllibraries.go deleted file mode 100644 index 717ac4a..0000000 --- a/models/operations/getalllibraries.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" -) - -// GetAllLibrariesType - The library type -type GetAllLibrariesType string - -const ( - GetAllLibrariesTypeMovie GetAllLibrariesType = "movie" - GetAllLibrariesTypeTvShow GetAllLibrariesType = "show" - GetAllLibrariesTypeSeason GetAllLibrariesType = "season" - GetAllLibrariesTypeEpisode GetAllLibrariesType = "episode" - GetAllLibrariesTypeArtist GetAllLibrariesType = "artist" - GetAllLibrariesTypeAlbum GetAllLibrariesType = "album" - GetAllLibrariesTypeTrack GetAllLibrariesType = "track" - GetAllLibrariesTypePhotoAlbum GetAllLibrariesType = "photoalbum" - GetAllLibrariesTypePhoto GetAllLibrariesType = "photo" - GetAllLibrariesTypeCollection GetAllLibrariesType = "collection" -) - -func (e GetAllLibrariesType) ToPointer() *GetAllLibrariesType { - return &e -} - -// Hidden - The Plex library visibility setting -type Hidden int - -const ( - HiddenVisible Hidden = 0 - HiddenExcludeHomeScreen Hidden = 1 - HiddenExcludeHomeScreenAndGlobalSearch Hidden = 2 -) - -func (e Hidden) ToPointer() *Hidden { - return &e -} -func (e *Hidden) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - fallthrough - case 2: - *e = Hidden(v) - return nil - default: - return fmt.Errorf("invalid value for Hidden: %v", v) - } -} - -type GetAllLibrariesLocation struct { - // The ID of the location. - ID int `json:"id"` - // The path to the media item. - Path string `json:"path"` -} - -func (g *GetAllLibrariesLocation) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetAllLibrariesLocation) GetPath() string { - if g == nil { - return "" - } - return g.Path -} - -type GetAllLibrariesDirectory struct { - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // URL for the background artwork of the media container. - Art string `json:"art"` - // The relative path to the composite media item. - Composite string `json:"composite"` - // UNKNOWN - Filters bool `json:"filters"` - // Indicates whether the library is currently being refreshed or updated - Refreshing bool `json:"refreshing"` - // URL for the thumbnail image of the media container. - Thumb string `json:"thumb"` - // The library key representing the unique identifier - Key string `json:"key"` - Type GetAllLibrariesType `json:"type"` - // The title of the library - Title string `json:"title"` - // The Plex agent used to match and retrieve media metadata. - Agent string `json:"agent"` - // UNKNOWN - Scanner string `json:"scanner"` - // The Plex library language that has been set - Language string `json:"language"` - // The universally unique identifier for the library. - UUID string `json:"uuid"` - // Unix epoch datetime in seconds - UpdatedAt int64 `json:"updatedAt"` - CreatedAt *int64 `json:"createdAt,omitempty"` - // Unix epoch datetime in seconds - ScannedAt int64 `json:"scannedAt"` - // UNKNOWN - Content bool `json:"content"` - // UNKNOWN - Directory bool `json:"directory"` - // Timestamp (in seconds) representing the last time the content was modified. - // NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64 - // - ContentChangedAt int64 `json:"contentChangedAt"` - // The Plex library visibility setting - Hidden *Hidden `default:"0" json:"hidden"` - Location []GetAllLibrariesLocation `json:"Location"` -} - -func (g GetAllLibrariesDirectory) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetAllLibrariesDirectory) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"allowSync", "art", "composite", "filters", "refreshing", "thumb", "key", "type", "title", "agent", "scanner", "language", "uuid", "updatedAt", "scannedAt", "content", "directory", "contentChangedAt", "Location"}); err != nil { - return err - } - return nil -} - -func (g *GetAllLibrariesDirectory) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetAllLibrariesDirectory) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetAllLibrariesDirectory) GetComposite() string { - if g == nil { - return "" - } - return g.Composite -} - -func (g *GetAllLibrariesDirectory) GetFilters() bool { - if g == nil { - return false - } - return g.Filters -} - -func (g *GetAllLibrariesDirectory) GetRefreshing() bool { - if g == nil { - return false - } - return g.Refreshing -} - -func (g *GetAllLibrariesDirectory) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetAllLibrariesDirectory) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetAllLibrariesDirectory) GetType() GetAllLibrariesType { - if g == nil { - return GetAllLibrariesType("") - } - return g.Type -} - -func (g *GetAllLibrariesDirectory) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetAllLibrariesDirectory) GetAgent() string { - if g == nil { - return "" - } - return g.Agent -} - -func (g *GetAllLibrariesDirectory) GetScanner() string { - if g == nil { - return "" - } - return g.Scanner -} - -func (g *GetAllLibrariesDirectory) GetLanguage() string { - if g == nil { - return "" - } - return g.Language -} - -func (g *GetAllLibrariesDirectory) GetUUID() string { - if g == nil { - return "" - } - return g.UUID -} - -func (g *GetAllLibrariesDirectory) GetUpdatedAt() int64 { - if g == nil { - return 0 - } - return g.UpdatedAt -} - -func (g *GetAllLibrariesDirectory) GetCreatedAt() *int64 { - if g == nil { - return nil - } - return g.CreatedAt -} - -func (g *GetAllLibrariesDirectory) GetScannedAt() int64 { - if g == nil { - return 0 - } - return g.ScannedAt -} - -func (g *GetAllLibrariesDirectory) GetContent() bool { - if g == nil { - return false - } - return g.Content -} - -func (g *GetAllLibrariesDirectory) GetDirectory() bool { - if g == nil { - return false - } - return g.Directory -} - -func (g *GetAllLibrariesDirectory) GetContentChangedAt() int64 { - if g == nil { - return 0 - } - return g.ContentChangedAt -} - -func (g *GetAllLibrariesDirectory) GetHidden() *Hidden { - if g == nil { - return nil - } - return g.Hidden -} - -func (g *GetAllLibrariesDirectory) GetLocation() []GetAllLibrariesLocation { - if g == nil { - return []GetAllLibrariesLocation{} - } - return g.Location -} - -type GetAllLibrariesMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // The primary title of the media container. - Title1 string `json:"title1"` - Directory []GetAllLibrariesDirectory `json:"Directory,omitempty"` -} - -func (g *GetAllLibrariesMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetAllLibrariesMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetAllLibrariesMediaContainer) GetTitle1() string { - if g == nil { - return "" - } - return g.Title1 -} - -func (g *GetAllLibrariesMediaContainer) GetDirectory() []GetAllLibrariesDirectory { - if g == nil { - return nil - } - return g.Directory -} - -// GetAllLibrariesResponseBody - The libraries available on the Server -type GetAllLibrariesResponseBody struct { - MediaContainer *GetAllLibrariesMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetAllLibrariesResponseBody) GetMediaContainer() *GetAllLibrariesMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetAllLibrariesResponse 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 libraries available on the Server - Object *GetAllLibrariesResponseBody -} - -func (g *GetAllLibrariesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetAllLibrariesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetAllLibrariesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetAllLibrariesResponse) GetObject() *GetAllLibrariesResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getallpreferences.go b/models/operations/getallpreferences.go new file mode 100644 index 0000000..04d1cf6 --- /dev/null +++ b/models/operations/getallpreferences.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAllPreferencesResponse 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 + // OK + MediaContainerWithSettings *components.MediaContainerWithSettings +} + +func (g *GetAllPreferencesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAllPreferencesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAllPreferencesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAllPreferencesResponse) GetMediaContainerWithSettings() *components.MediaContainerWithSettings { + if g == nil { + return nil + } + return g.MediaContainerWithSettings +} diff --git a/models/operations/getallsubscriptions.go b/models/operations/getallsubscriptions.go new file mode 100644 index 0000000..9b23ebc --- /dev/null +++ b/models/operations/getallsubscriptions.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAllSubscriptionsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAllSubscriptionsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllSubscriptionsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAllSubscriptionsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllSubscriptionsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllSubscriptionsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllSubscriptionsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllSubscriptionsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllSubscriptionsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllSubscriptionsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllSubscriptionsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllSubscriptionsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllSubscriptionsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllSubscriptionsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAllSubscriptionsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Indicates whether the active grabs should be included as well + IncludeGrabs *components.BoolInt `queryParam:"style=form,explode=true,name=includeGrabs"` + // Compute the storage of recorded items desired by this subscription + IncludeStorage *components.BoolInt `queryParam:"style=form,explode=true,name=includeStorage"` +} + +func (g GetAllSubscriptionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAllSubscriptionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAllSubscriptionsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAllSubscriptionsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAllSubscriptionsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAllSubscriptionsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAllSubscriptionsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAllSubscriptionsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAllSubscriptionsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAllSubscriptionsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAllSubscriptionsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAllSubscriptionsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAllSubscriptionsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAllSubscriptionsRequest) GetIncludeGrabs() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeGrabs +} + +func (g *GetAllSubscriptionsRequest) GetIncludeStorage() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeStorage +} + +type GetAllSubscriptionsResponse 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 + // OK + MediaContainerWithSubscription *components.MediaContainerWithSubscription + Headers map[string][]string +} + +func (g *GetAllSubscriptionsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAllSubscriptionsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAllSubscriptionsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAllSubscriptionsResponse) GetMediaContainerWithSubscription() *components.MediaContainerWithSubscription { + if g == nil { + return nil + } + return g.MediaContainerWithSubscription +} + +func (g *GetAllSubscriptionsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getarts.go b/models/operations/getarts.go new file mode 100644 index 0000000..42b0729 --- /dev/null +++ b/models/operations/getarts.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetArtsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetArtsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetArtsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetArtsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetArtsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetArtsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetArtsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetArtsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetArtsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetArtsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetArtsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetArtsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetArtsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetArtsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetArtsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetArtsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetArtsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetArtsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetArtsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetArtsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetArtsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetArtsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetArtsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetArtsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetArtsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetArtsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetArtsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetArtsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetArtsRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +type GetArtsResponse 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 + // OK + MediaContainerWithArtwork *components.MediaContainerWithArtwork +} + +func (g *GetArtsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetArtsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetArtsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetArtsResponse) GetMediaContainerWithArtwork() *components.MediaContainerWithArtwork { + if g == nil { + return nil + } + return g.MediaContainerWithArtwork +} diff --git a/models/operations/getaugmentationstatus.go b/models/operations/getaugmentationstatus.go new file mode 100644 index 0000000..a109c49 --- /dev/null +++ b/models/operations/getaugmentationstatus.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAugmentationStatusGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAugmentationStatusGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAugmentationStatusGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAugmentationStatusGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAugmentationStatusGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAugmentationStatusGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAugmentationStatusGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAugmentationStatusGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAugmentationStatusGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAugmentationStatusGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAugmentationStatusGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAugmentationStatusGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAugmentationStatusGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAugmentationStatusGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAugmentationStatusRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the augmentation + AugmentationID string `pathParam:"style=simple,explode=false,name=augmentationId"` + // Wait for augmentation completion before returning + Wait *components.BoolInt `queryParam:"style=form,explode=true,name=wait"` +} + +func (g GetAugmentationStatusRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAugmentationStatusRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"augmentationId"}); err != nil { + return err + } + return nil +} + +func (g *GetAugmentationStatusRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAugmentationStatusRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAugmentationStatusRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAugmentationStatusRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAugmentationStatusRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAugmentationStatusRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAugmentationStatusRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAugmentationStatusRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAugmentationStatusRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAugmentationStatusRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAugmentationStatusRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAugmentationStatusRequest) GetAugmentationID() string { + if g == nil { + return "" + } + return g.AugmentationID +} + +func (g *GetAugmentationStatusRequest) GetWait() *components.BoolInt { + if g == nil { + return nil + } + return g.Wait +} + +type GetAugmentationStatusResponse 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 (g *GetAugmentationStatusResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAugmentationStatusResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAugmentationStatusResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getavailableclients.go b/models/operations/getavailableclients.go deleted file mode 100644 index b1f0fbb..0000000 --- a/models/operations/getavailableclients.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (s *Server) GetName() *string { - if s == nil { - return nil - } - return s.Name -} - -func (s *Server) GetHost() *string { - if s == nil { - return nil - } - return s.Host -} - -func (s *Server) GetAddress() *string { - if s == nil { - return nil - } - return s.Address -} - -func (s *Server) GetPort() *float64 { - if s == nil { - return nil - } - return s.Port -} - -func (s *Server) GetMachineIdentifier() *string { - if s == nil { - return nil - } - return s.MachineIdentifier -} - -func (s *Server) GetVersion() *string { - if s == nil { - return nil - } - return s.Version -} - -func (s *Server) GetProtocol() *string { - if s == nil { - return nil - } - return s.Protocol -} - -func (s *Server) GetProduct() *string { - if s == nil { - return nil - } - return s.Product -} - -func (s *Server) GetDeviceClass() *string { - if s == nil { - return nil - } - return s.DeviceClass -} - -func (s *Server) GetProtocolVersion() *float64 { - if s == nil { - return nil - } - return s.ProtocolVersion -} - -func (s *Server) GetProtocolCapabilities() *string { - if s == nil { - return nil - } - return s.ProtocolCapabilities -} - -type GetAvailableClientsMediaContainer struct { - Size *float64 `json:"size,omitempty"` - Server []Server `json:"Server,omitempty"` -} - -func (g *GetAvailableClientsMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetAvailableClientsMediaContainer) GetServer() []Server { - if g == nil { - return nil - } - return g.Server -} - -// GetAvailableClientsResponseBody - Available Clients -type GetAvailableClientsResponseBody struct { - MediaContainer *GetAvailableClientsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetAvailableClientsResponseBody) GetMediaContainer() *GetAvailableClientsMediaContainer { - if g == nil { - return nil - } - return g.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 - Object *GetAvailableClientsResponseBody -} - -func (g *GetAvailableClientsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetAvailableClientsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetAvailableClientsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetAvailableClientsResponse) GetObject() *GetAvailableClientsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getavailablegrabbers.go b/models/operations/getavailablegrabbers.go new file mode 100644 index 0000000..bfeb2c8 --- /dev/null +++ b/models/operations/getavailablegrabbers.go @@ -0,0 +1,380 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAvailableGrabbersGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAvailableGrabbersGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAvailableGrabbersGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAvailableGrabbersGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAvailableGrabbersGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAvailableGrabbersGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAvailableGrabbersGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAvailableGrabbersGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAvailableGrabbersGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAvailableGrabbersGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAvailableGrabbersGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAvailableGrabbersGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAvailableGrabbersGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAvailableGrabbersGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAvailableGrabbersRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Only return grabbers providing this protocol. + Protocol *string `queryParam:"style=form,explode=true,name=protocol"` +} + +func (g GetAvailableGrabbersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAvailableGrabbersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAvailableGrabbersRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAvailableGrabbersRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAvailableGrabbersRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAvailableGrabbersRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAvailableGrabbersRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAvailableGrabbersRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAvailableGrabbersRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAvailableGrabbersRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAvailableGrabbersRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAvailableGrabbersRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAvailableGrabbersRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAvailableGrabbersRequest) GetProtocol() *string { + if g == nil { + return nil + } + return g.Protocol +} + +type MediaGrabber struct { + Identifier *string `json:"identifier,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (m *MediaGrabber) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaGrabber) GetProtocol() *string { + if m == nil { + return nil + } + return m.Protocol +} + +func (m *MediaGrabber) GetTitle() *string { + if m == nil { + return nil + } + return m.Title +} + +// GetAvailableGrabbersMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetAvailableGrabbersMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + MediaGrabber []MediaGrabber `json:"MediaGrabber,omitempty"` +} + +func (g *GetAvailableGrabbersMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetAvailableGrabbersMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetAvailableGrabbersMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetAvailableGrabbersMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetAvailableGrabbersMediaContainer) GetMediaGrabber() []MediaGrabber { + if g == nil { + return nil + } + return g.MediaGrabber +} + +// GetAvailableGrabbersResponseBody - OK +type GetAvailableGrabbersResponseBody struct { + MediaContainer *GetAvailableGrabbersMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetAvailableGrabbersResponseBody) GetMediaContainer() *GetAvailableGrabbersMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetAvailableGrabbersResponse 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 + // OK + Object *GetAvailableGrabbersResponseBody + Headers map[string][]string +} + +func (g *GetAvailableGrabbersResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAvailableGrabbersResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAvailableGrabbersResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAvailableGrabbersResponse) GetObject() *GetAvailableGrabbersResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetAvailableGrabbersResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getavailablesorts.go b/models/operations/getavailablesorts.go new file mode 100644 index 0000000..be9eede --- /dev/null +++ b/models/operations/getavailablesorts.go @@ -0,0 +1,345 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetAvailableSortsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetAvailableSortsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAvailableSortsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAvailableSortsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAvailableSortsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAvailableSortsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAvailableSortsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAvailableSortsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAvailableSortsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAvailableSortsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAvailableSortsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAvailableSortsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAvailableSortsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAvailableSortsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetAvailableSortsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetAvailableSortsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAvailableSortsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetAvailableSortsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetAvailableSortsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetAvailableSortsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetAvailableSortsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetAvailableSortsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetAvailableSortsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetAvailableSortsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetAvailableSortsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetAvailableSortsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetAvailableSortsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetAvailableSortsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetAvailableSortsRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +// GetAvailableSortsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetAvailableSortsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []components.Sort `json:"Directory,omitempty"` +} + +func (g *GetAvailableSortsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetAvailableSortsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetAvailableSortsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetAvailableSortsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetAvailableSortsMediaContainer) GetDirectory() []components.Sort { + if g == nil { + return nil + } + return g.Directory +} + +// GetAvailableSortsResponseBody - OK +type GetAvailableSortsResponseBody struct { + MediaContainer *GetAvailableSortsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetAvailableSortsResponseBody) GetMediaContainer() *GetAvailableSortsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetAvailableSortsResponse 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 + // OK + Object *GetAvailableSortsResponseBody +} + +func (g *GetAvailableSortsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetAvailableSortsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetAvailableSortsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetAvailableSortsResponse) GetObject() *GetAvailableSortsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getbackgroundtasks.go b/models/operations/getbackgroundtasks.go new file mode 100644 index 0000000..4008104 --- /dev/null +++ b/models/operations/getbackgroundtasks.go @@ -0,0 +1,228 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +type GetBackgroundTasksType string + +const ( + GetBackgroundTasksTypeTranscode GetBackgroundTasksType = "transcode" +) + +func (e GetBackgroundTasksType) ToPointer() *GetBackgroundTasksType { + return &e +} +func (e *GetBackgroundTasksType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "transcode": + *e = GetBackgroundTasksType(v) + return nil + default: + return fmt.Errorf("invalid value for GetBackgroundTasksType: %v", v) + } +} + +type TranscodeJob struct { + GeneratorID *int64 `json:"generatorID,omitempty"` + Key *string `json:"key,omitempty"` + Progress *float64 `json:"progress,omitempty"` + RatingKey *string `json:"ratingKey,omitempty"` + // The number of seconds remaining in this job + Remaining *int64 `json:"remaining,omitempty"` + // The size of the result so far + Size *int64 `json:"size,omitempty"` + // The speed of the transcode; 1.0 means real-time + Speed *float64 `json:"speed,omitempty"` + // The tag associated with the job. This could be the tag containing the optimizer settings. + TargetTagID *int64 `json:"targetTagID,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Title *string `json:"title,omitempty"` + Type *GetBackgroundTasksType `json:"type,omitempty"` +} + +func (t *TranscodeJob) GetGeneratorID() *int64 { + if t == nil { + return nil + } + return t.GeneratorID +} + +func (t *TranscodeJob) GetKey() *string { + if t == nil { + return nil + } + return t.Key +} + +func (t *TranscodeJob) GetProgress() *float64 { + if t == nil { + return nil + } + return t.Progress +} + +func (t *TranscodeJob) GetRatingKey() *string { + if t == nil { + return nil + } + return t.RatingKey +} + +func (t *TranscodeJob) GetRemaining() *int64 { + if t == nil { + return nil + } + return t.Remaining +} + +func (t *TranscodeJob) GetSize() *int64 { + if t == nil { + return nil + } + return t.Size +} + +func (t *TranscodeJob) GetSpeed() *float64 { + if t == nil { + return nil + } + return t.Speed +} + +func (t *TranscodeJob) GetTargetTagID() *int64 { + if t == nil { + return nil + } + return t.TargetTagID +} + +func (t *TranscodeJob) GetThumb() *string { + if t == nil { + return nil + } + return t.Thumb +} + +func (t *TranscodeJob) GetTitle() *string { + if t == nil { + return nil + } + return t.Title +} + +func (t *TranscodeJob) GetType() *GetBackgroundTasksType { + if t == nil { + return nil + } + return t.Type +} + +// GetBackgroundTasksMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetBackgroundTasksMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + TranscodeJob []TranscodeJob `json:"TranscodeJob,omitempty"` +} + +func (g *GetBackgroundTasksMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetBackgroundTasksMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetBackgroundTasksMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetBackgroundTasksMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetBackgroundTasksMediaContainer) GetTranscodeJob() []TranscodeJob { + if g == nil { + return nil + } + return g.TranscodeJob +} + +// GetBackgroundTasksResponseBody - OK +type GetBackgroundTasksResponseBody struct { + MediaContainer *GetBackgroundTasksMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetBackgroundTasksResponseBody) GetMediaContainer() *GetBackgroundTasksMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetBackgroundTasksResponse 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 + // OK + Object *GetBackgroundTasksResponseBody +} + +func (g *GetBackgroundTasksResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetBackgroundTasksResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetBackgroundTasksResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetBackgroundTasksResponse) GetObject() *GetBackgroundTasksResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getbandwidthstatistics.go b/models/operations/getbandwidthstatistics.go deleted file mode 100644 index 8a37256..0000000 --- a/models/operations/getbandwidthstatistics.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type GetBandwidthStatisticsRequest struct { - // The timespan to retrieve statistics for - // the exact meaning of this parameter is not known - // - Timespan *int64 `queryParam:"style=form,explode=true,name=timespan"` -} - -func (g *GetBandwidthStatisticsRequest) GetTimespan() *int64 { - if g == nil { - return nil - } - return g.Timespan -} - -type GetBandwidthStatisticsDevice struct { - ID *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Platform *string `json:"platform,omitempty"` - ClientIdentifier *string `json:"clientIdentifier,omitempty"` - CreatedAt *int `json:"createdAt,omitempty"` -} - -func (g *GetBandwidthStatisticsDevice) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetBandwidthStatisticsDevice) GetName() *string { - if g == nil { - return nil - } - return g.Name -} - -func (g *GetBandwidthStatisticsDevice) GetPlatform() *string { - if g == nil { - return nil - } - return g.Platform -} - -func (g *GetBandwidthStatisticsDevice) GetClientIdentifier() *string { - if g == nil { - return nil - } - return g.ClientIdentifier -} - -func (g *GetBandwidthStatisticsDevice) GetCreatedAt() *int { - if g == nil { - return nil - } - return g.CreatedAt -} - -type GetBandwidthStatisticsAccount struct { - ID *int `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` - DefaultAudioLanguage *string `json:"defaultAudioLanguage,omitempty"` - AutoSelectAudio *bool `json:"autoSelectAudio,omitempty"` - DefaultSubtitleLanguage *string `json:"defaultSubtitleLanguage,omitempty"` - SubtitleMode *int `json:"subtitleMode,omitempty"` - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetBandwidthStatisticsAccount) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetBandwidthStatisticsAccount) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetBandwidthStatisticsAccount) GetName() *string { - if g == nil { - return nil - } - return g.Name -} - -func (g *GetBandwidthStatisticsAccount) GetDefaultAudioLanguage() *string { - if g == nil { - return nil - } - return g.DefaultAudioLanguage -} - -func (g *GetBandwidthStatisticsAccount) GetAutoSelectAudio() *bool { - if g == nil { - return nil - } - return g.AutoSelectAudio -} - -func (g *GetBandwidthStatisticsAccount) GetDefaultSubtitleLanguage() *string { - if g == nil { - return nil - } - return g.DefaultSubtitleLanguage -} - -func (g *GetBandwidthStatisticsAccount) GetSubtitleMode() *int { - if g == nil { - return nil - } - return g.SubtitleMode -} - -func (g *GetBandwidthStatisticsAccount) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type StatisticsBandwidth struct { - AccountID *int `json:"accountID,omitempty"` - DeviceID *int `json:"deviceID,omitempty"` - Timespan *int64 `json:"timespan,omitempty"` - At *int `json:"at,omitempty"` - Lan *bool `json:"lan,omitempty"` - Bytes *int64 `json:"bytes,omitempty"` -} - -func (s *StatisticsBandwidth) GetAccountID() *int { - if s == nil { - return nil - } - return s.AccountID -} - -func (s *StatisticsBandwidth) GetDeviceID() *int { - if s == nil { - return nil - } - return s.DeviceID -} - -func (s *StatisticsBandwidth) GetTimespan() *int64 { - if s == nil { - return nil - } - return s.Timespan -} - -func (s *StatisticsBandwidth) GetAt() *int { - if s == nil { - return nil - } - return s.At -} - -func (s *StatisticsBandwidth) GetLan() *bool { - if s == nil { - return nil - } - return s.Lan -} - -func (s *StatisticsBandwidth) GetBytes() *int64 { - if s == nil { - return nil - } - return s.Bytes -} - -type GetBandwidthStatisticsMediaContainer struct { - Size *int `json:"size,omitempty"` - Device []GetBandwidthStatisticsDevice `json:"Device,omitempty"` - Account []GetBandwidthStatisticsAccount `json:"Account,omitempty"` - StatisticsBandwidth []StatisticsBandwidth `json:"StatisticsBandwidth,omitempty"` -} - -func (g *GetBandwidthStatisticsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetBandwidthStatisticsMediaContainer) GetDevice() []GetBandwidthStatisticsDevice { - if g == nil { - return nil - } - return g.Device -} - -func (g *GetBandwidthStatisticsMediaContainer) GetAccount() []GetBandwidthStatisticsAccount { - if g == nil { - return nil - } - return g.Account -} - -func (g *GetBandwidthStatisticsMediaContainer) GetStatisticsBandwidth() []StatisticsBandwidth { - if g == nil { - return nil - } - return g.StatisticsBandwidth -} - -// GetBandwidthStatisticsResponseBody - Bandwidth Statistics -type GetBandwidthStatisticsResponseBody struct { - MediaContainer *GetBandwidthStatisticsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetBandwidthStatisticsResponseBody) GetMediaContainer() *GetBandwidthStatisticsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetBandwidthStatisticsResponse 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 - // Bandwidth Statistics - Object *GetBandwidthStatisticsResponseBody -} - -func (g *GetBandwidthStatisticsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetBandwidthStatisticsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetBandwidthStatisticsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetBandwidthStatisticsResponse) GetObject() *GetBandwidthStatisticsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getbannerimage.go b/models/operations/getbannerimage.go deleted file mode 100644 index 5fec742..0000000 --- a/models/operations/getbannerimage.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "net/http" -) - -type GetBannerImageRequest struct { - // the id of the library item to return the children of. - RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"` - Width int64 `queryParam:"style=form,explode=true,name=width"` - Height int64 `queryParam:"style=form,explode=true,name=height"` - MinSize int64 `queryParam:"style=form,explode=true,name=minSize"` - Upscale int64 `queryParam:"style=form,explode=true,name=upscale"` - // An authentication token, obtained from plex.tv - XPlexToken string `header:"style=simple,explode=false,name=X-Plex-Token"` -} - -func (g *GetBannerImageRequest) GetRatingKey() int64 { - if g == nil { - return 0 - } - return g.RatingKey -} - -func (g *GetBannerImageRequest) GetWidth() int64 { - if g == nil { - return 0 - } - return g.Width -} - -func (g *GetBannerImageRequest) GetHeight() int64 { - if g == nil { - return 0 - } - return g.Height -} - -func (g *GetBannerImageRequest) GetMinSize() int64 { - if g == nil { - return 0 - } - return g.MinSize -} - -func (g *GetBannerImageRequest) GetUpscale() int64 { - if g == nil { - return 0 - } - return g.Upscale -} - -func (g *GetBannerImageRequest) GetXPlexToken() string { - if g == nil { - return "" - } - return g.XPlexToken -} - -type GetBannerImageResponse 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 - // Successful response returning an image - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - ResponseStream io.ReadCloser - Headers map[string][]string -} - -func (g *GetBannerImageResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetBannerImageResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetBannerImageResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetBannerImageResponse) GetResponseStream() io.ReadCloser { - if g == nil { - return nil - } - return g.ResponseStream -} - -func (g *GetBannerImageResponse) GetHeaders() map[string][]string { - if g == nil { - return map[string][]string{} - } - return g.Headers -} diff --git a/models/operations/getbutlertasks.go b/models/operations/getbutlertasks.go deleted file mode 100644 index 3ea1a30..0000000 --- a/models/operations/getbutlertasks.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (b *ButlerTask) GetName() *string { - if b == nil { - return nil - } - return b.Name -} - -func (b *ButlerTask) GetInterval() *float64 { - if b == nil { - return nil - } - return b.Interval -} - -func (b *ButlerTask) GetScheduleRandomized() *bool { - if b == nil { - return nil - } - return b.ScheduleRandomized -} - -func (b *ButlerTask) GetEnabled() *bool { - if b == nil { - return nil - } - return b.Enabled -} - -func (b *ButlerTask) GetTitle() *string { - if b == nil { - return nil - } - return b.Title -} - -func (b *ButlerTask) GetDescription() *string { - if b == nil { - return nil - } - return b.Description -} - -type ButlerTasks struct { - ButlerTask []ButlerTask `json:"ButlerTask,omitempty"` -} - -func (b *ButlerTasks) GetButlerTask() []ButlerTask { - if b == nil { - return nil - } - return b.ButlerTask -} - -// GetButlerTasksResponseBody - All butler tasks -type GetButlerTasksResponseBody struct { - ButlerTasks *ButlerTasks `json:"ButlerTasks,omitempty"` -} - -func (g *GetButlerTasksResponseBody) GetButlerTasks() *ButlerTasks { - if g == nil { - return nil - } - return g.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 (g *GetButlerTasksResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetButlerTasksResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetButlerTasksResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetButlerTasksResponse) GetObject() *GetButlerTasksResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getcategories.go b/models/operations/getcategories.go new file mode 100644 index 0000000..12ed443 --- /dev/null +++ b/models/operations/getcategories.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetCategoriesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCategoriesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCategoriesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCategoriesGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCategoriesGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCategoriesGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCategoriesGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCategoriesGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCategoriesGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCategoriesGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCategoriesGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCategoriesGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCategoriesGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCategoriesGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCategoriesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetCategoriesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCategoriesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetCategoriesRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCategoriesRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCategoriesRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCategoriesRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCategoriesRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCategoriesRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCategoriesRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCategoriesRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCategoriesRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCategoriesRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCategoriesRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCategoriesRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +type GetCategoriesResponse 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 + // OK + MediaContainerWithArtwork *components.MediaContainerWithArtwork +} + +func (g *GetCategoriesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCategoriesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCategoriesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCategoriesResponse) GetMediaContainerWithArtwork() *components.MediaContainerWithArtwork { + if g == nil { + return nil + } + return g.MediaContainerWithArtwork +} diff --git a/models/operations/getchannels.go b/models/operations/getchannels.go new file mode 100644 index 0000000..59fc496 --- /dev/null +++ b/models/operations/getchannels.go @@ -0,0 +1,353 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetChannelsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetChannelsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetChannelsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetChannelsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetChannelsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetChannelsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetChannelsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetChannelsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetChannelsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetChannelsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetChannelsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetChannelsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetChannelsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetChannelsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetChannelsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The URI describing the lineup + Lineup string `queryParam:"style=form,explode=true,name=lineup"` +} + +func (g GetChannelsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetChannelsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"lineup"}); err != nil { + return err + } + return nil +} + +func (g *GetChannelsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetChannelsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetChannelsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetChannelsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetChannelsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetChannelsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetChannelsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetChannelsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetChannelsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetChannelsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetChannelsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetChannelsRequest) GetLineup() string { + if g == nil { + return "" + } + return g.Lineup +} + +// GetChannelsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetChannelsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Channel []components.Channel `json:"Channel,omitempty"` +} + +func (g *GetChannelsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetChannelsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetChannelsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetChannelsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetChannelsMediaContainer) GetChannel() []components.Channel { + if g == nil { + return nil + } + return g.Channel +} + +// GetChannelsResponseBody - OK +type GetChannelsResponseBody struct { + MediaContainer *GetChannelsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetChannelsResponseBody) GetMediaContainer() *GetChannelsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetChannelsResponse 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 + // OK + Object *GetChannelsResponseBody + Headers map[string][]string +} + +func (g *GetChannelsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetChannelsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetChannelsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetChannelsResponse) GetObject() *GetChannelsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetChannelsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getchapterimage.go b/models/operations/getchapterimage.go new file mode 100644 index 0000000..b8a08aa --- /dev/null +++ b/models/operations/getchapterimage.go @@ -0,0 +1,294 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetChapterImageGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetChapterImageGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetChapterImageGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetChapterImageGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetChapterImageGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetChapterImageGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetChapterImageGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetChapterImageGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetChapterImageGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetChapterImageGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetChapterImageGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetChapterImageGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetChapterImageGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetChapterImageGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetChapterImageRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the media item + MediaID int64 `pathParam:"style=simple,explode=false,name=mediaId"` + // The index of the chapter + Chapter int64 `pathParam:"style=simple,explode=false,name=chapter"` +} + +func (g GetChapterImageRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetChapterImageRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"mediaId", "chapter"}); err != nil { + return err + } + return nil +} + +func (g *GetChapterImageRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetChapterImageRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetChapterImageRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetChapterImageRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetChapterImageRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetChapterImageRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetChapterImageRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetChapterImageRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetChapterImageRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetChapterImageRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetChapterImageRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetChapterImageRequest) GetMediaID() int64 { + if g == nil { + return 0 + } + return g.MediaID +} + +func (g *GetChapterImageRequest) GetChapter() int64 { + if g == nil { + return 0 + } + return g.Chapter +} + +type GetChapterImageResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (g *GetChapterImageResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetChapterImageResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetChapterImageResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetChapterImageResponse) GetResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.ResponseStream +} diff --git a/models/operations/getcluster.go b/models/operations/getcluster.go new file mode 100644 index 0000000..a8bed5e --- /dev/null +++ b/models/operations/getcluster.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetClusterGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetClusterGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetClusterGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetClusterGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetClusterGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetClusterGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetClusterGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetClusterGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetClusterGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetClusterGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetClusterGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetClusterGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetClusterGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetClusterGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetClusterRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetClusterRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetClusterRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetClusterRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetClusterRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetClusterRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetClusterRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetClusterRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetClusterRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetClusterRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetClusterRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetClusterRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetClusterRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetClusterRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetClusterRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +type GetClusterResponse 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 + // OK + MediaContainerWithArtwork *components.MediaContainerWithArtwork +} + +func (g *GetClusterResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetClusterResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetClusterResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetClusterResponse) GetMediaContainerWithArtwork() *components.MediaContainerWithArtwork { + if g == nil { + return nil + } + return g.MediaContainerWithArtwork +} diff --git a/models/operations/getcollectionimage.go b/models/operations/getcollectionimage.go new file mode 100644 index 0000000..a584dfd --- /dev/null +++ b/models/operations/getcollectionimage.go @@ -0,0 +1,302 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetCollectionImageGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCollectionImageGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCollectionImageGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCollectionImageGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCollectionImageGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCollectionImageGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCollectionImageGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCollectionImageGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCollectionImageGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCollectionImageGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCollectionImageGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCollectionImageGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCollectionImageGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCollectionImageGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCollectionImageRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The collection id + CollectionID int64 `pathParam:"style=simple,explode=false,name=collectionId"` + // The update time of the image. Used for busting cache. + UpdatedAt int64 `pathParam:"style=simple,explode=false,name=updatedAt"` + Composite *components.Composite `queryParam:"style=form,explode=true,name=composite"` +} + +func (g GetCollectionImageRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCollectionImageRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"collectionId", "updatedAt"}); err != nil { + return err + } + return nil +} + +func (g *GetCollectionImageRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCollectionImageRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCollectionImageRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCollectionImageRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCollectionImageRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCollectionImageRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCollectionImageRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCollectionImageRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCollectionImageRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCollectionImageRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCollectionImageRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCollectionImageRequest) GetCollectionID() int64 { + if g == nil { + return 0 + } + return g.CollectionID +} + +func (g *GetCollectionImageRequest) GetUpdatedAt() int64 { + if g == nil { + return 0 + } + return g.UpdatedAt +} + +func (g *GetCollectionImageRequest) GetComposite() *components.Composite { + if g == nil { + return nil + } + return g.Composite +} + +type GetCollectionImageResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (g *GetCollectionImageResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCollectionImageResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCollectionImageResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCollectionImageResponse) GetResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.ResponseStream +} diff --git a/models/operations/getcollectionitems.go b/models/operations/getcollectionitems.go new file mode 100644 index 0000000..9c09824 --- /dev/null +++ b/models/operations/getcollectionitems.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetCollectionItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCollectionItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCollectionItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCollectionItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCollectionItemsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCollectionItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCollectionItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCollectionItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCollectionItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCollectionItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCollectionItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCollectionItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCollectionItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCollectionItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCollectionItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The collection id + CollectionID int64 `pathParam:"style=simple,explode=false,name=collectionId"` +} + +func (g GetCollectionItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCollectionItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"collectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetCollectionItemsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCollectionItemsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCollectionItemsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCollectionItemsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCollectionItemsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCollectionItemsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCollectionItemsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCollectionItemsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCollectionItemsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCollectionItemsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCollectionItemsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCollectionItemsRequest) GetCollectionID() int64 { + if g == nil { + return 0 + } + return g.CollectionID +} + +type GetCollectionItemsResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (g *GetCollectionItemsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCollectionItemsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCollectionItemsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCollectionItemsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} diff --git a/models/operations/getcollections.go b/models/operations/getcollections.go new file mode 100644 index 0000000..da580e1 --- /dev/null +++ b/models/operations/getcollections.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetCollectionsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCollectionsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCollectionsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCollectionsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCollectionsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCollectionsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCollectionsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCollectionsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCollectionsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCollectionsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCollectionsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCollectionsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCollectionsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCollectionsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCollectionsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` +} + +func (g GetCollectionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCollectionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetCollectionsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCollectionsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCollectionsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCollectionsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCollectionsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCollectionsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCollectionsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCollectionsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCollectionsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCollectionsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCollectionsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCollectionsRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetCollectionsRequest) GetMediaQuery() *components.MediaQuery { + if g == nil { + return nil + } + return g.MediaQuery +} + +type GetCollectionsResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetCollectionsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCollectionsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCollectionsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCollectionsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetCollectionsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getcolors.go b/models/operations/getcolors.go new file mode 100644 index 0000000..0b03035 --- /dev/null +++ b/models/operations/getcolors.go @@ -0,0 +1,384 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetColorsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetColorsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetColorsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetColorsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetColorsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetColorsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetColorsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetColorsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetColorsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetColorsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetColorsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetColorsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetColorsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetColorsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetColorsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Url for image which requires color extraction. Can be relative PMS library path or absolute url. + URL *string `queryParam:"style=form,explode=true,name=url"` +} + +func (g GetColorsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetColorsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetColorsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetColorsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetColorsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetColorsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetColorsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetColorsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetColorsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetColorsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetColorsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetColorsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetColorsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetColorsRequest) GetURL() *string { + if g == nil { + return nil + } + return g.URL +} + +type UltraBlurColors struct { + // The color (hex) for the bottom left quadrant. + BottomLeft *string `json:"bottomLeft,omitempty"` + // The color (hex) for the bottom right quadrant. + BottomRight *string `json:"bottomRight,omitempty"` + // The color (hex) for the top left quadrant. + TopLeft *string `json:"topLeft,omitempty"` + // The color (hex) for the top right quadrant. + TopRight *string `json:"topRight,omitempty"` +} + +func (u *UltraBlurColors) GetBottomLeft() *string { + if u == nil { + return nil + } + return u.BottomLeft +} + +func (u *UltraBlurColors) GetBottomRight() *string { + if u == nil { + return nil + } + return u.BottomRight +} + +func (u *UltraBlurColors) GetTopLeft() *string { + if u == nil { + return nil + } + return u.TopLeft +} + +func (u *UltraBlurColors) GetTopRight() *string { + if u == nil { + return nil + } + return u.TopRight +} + +// GetColorsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetColorsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + UltraBlurColors []UltraBlurColors `json:"UltraBlurColors,omitempty"` +} + +func (g *GetColorsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetColorsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetColorsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetColorsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetColorsMediaContainer) GetUltraBlurColors() []UltraBlurColors { + if g == nil { + return nil + } + return g.UltraBlurColors +} + +// GetColorsResponseBody - OK +type GetColorsResponseBody struct { + MediaContainer *GetColorsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetColorsResponseBody) GetMediaContainer() *GetColorsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetColorsResponse 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 + // OK + Object *GetColorsResponseBody +} + +func (g *GetColorsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetColorsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetColorsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetColorsResponse) GetObject() *GetColorsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getcommon.go b/models/operations/getcommon.go new file mode 100644 index 0000000..f1619e2 --- /dev/null +++ b/models/operations/getcommon.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetCommonGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCommonGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCommonGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCommonGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCommonGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCommonGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCommonGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCommonGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCommonGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCommonGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCommonGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCommonGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCommonGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCommonGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCommonRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Item type + Type *int64 `queryParam:"style=form,explode=true,name=type"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` +} + +func (g GetCommonRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCommonRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetCommonRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCommonRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCommonRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCommonRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCommonRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCommonRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCommonRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCommonRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCommonRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCommonRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCommonRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCommonRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetCommonRequest) GetType() *int64 { + if g == nil { + return nil + } + return g.Type +} + +func (g *GetCommonRequest) GetMediaQuery() *components.MediaQuery { + if g == nil { + return nil + } + return g.MediaQuery +} + +type GetCommonResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetCommonResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCommonResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCommonResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCommonResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetCommonResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getcompanionsdata.go b/models/operations/getcompanionsdata.go deleted file mode 100644 index 190f601..0000000 --- a/models/operations/getcompanionsdata.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -var GetCompanionsDataServerList = []string{ - "https://plex.tv/api/v2", -} - -type ResponseBody struct { - Identifier string `json:"identifier"` - BaseURL string `json:"baseURL"` - Title string `json:"title"` - LinkURL string `json:"linkURL"` - Provides string `json:"provides"` - // The plex authtoken used to identify with - Token string `json:"token"` -} - -func (r *ResponseBody) GetIdentifier() string { - if r == nil { - return "" - } - return r.Identifier -} - -func (r *ResponseBody) GetBaseURL() string { - if r == nil { - return "" - } - return r.BaseURL -} - -func (r *ResponseBody) GetTitle() string { - if r == nil { - return "" - } - return r.Title -} - -func (r *ResponseBody) GetLinkURL() string { - if r == nil { - return "" - } - return r.LinkURL -} - -func (r *ResponseBody) GetProvides() string { - if r == nil { - return "" - } - return r.Provides -} - -func (r *ResponseBody) GetToken() string { - if r == nil { - return "" - } - return r.Token -} - -type GetCompanionsDataResponse 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 - // Companions Data - ResponseBodies []ResponseBody -} - -func (g *GetCompanionsDataResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetCompanionsDataResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetCompanionsDataResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetCompanionsDataResponse) GetResponseBodies() []ResponseBody { - if g == nil { - return nil - } - return g.ResponseBodies -} diff --git a/models/operations/getcontinuewatching.go b/models/operations/getcontinuewatching.go new file mode 100644 index 0000000..ee4e955 --- /dev/null +++ b/models/operations/getcontinuewatching.go @@ -0,0 +1,353 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetContinueWatchingGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetContinueWatchingGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetContinueWatchingGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetContinueWatchingGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetContinueWatchingGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetContinueWatchingGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetContinueWatchingGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetContinueWatchingGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetContinueWatchingGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetContinueWatchingGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetContinueWatchingGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetContinueWatchingGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetContinueWatchingGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetContinueWatchingGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetContinueWatchingRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Limit results to count items + Count *int64 `queryParam:"style=form,explode=true,name=count"` +} + +func (g GetContinueWatchingRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetContinueWatchingRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetContinueWatchingRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetContinueWatchingRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetContinueWatchingRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetContinueWatchingRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetContinueWatchingRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetContinueWatchingRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetContinueWatchingRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetContinueWatchingRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetContinueWatchingRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetContinueWatchingRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetContinueWatchingRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetContinueWatchingRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +// GetContinueWatchingMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetContinueWatchingMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (g *GetContinueWatchingMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetContinueWatchingMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetContinueWatchingMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetContinueWatchingMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetContinueWatchingMediaContainer) GetHub() []components.Hub { + if g == nil { + return nil + } + return g.Hub +} + +// GetContinueWatchingResponseBody - OK +type GetContinueWatchingResponseBody struct { + MediaContainer *GetContinueWatchingMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetContinueWatchingResponseBody) GetMediaContainer() *GetContinueWatchingMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetContinueWatchingResponse 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 + // OK + Object *GetContinueWatchingResponseBody + Headers map[string][]string +} + +func (g *GetContinueWatchingResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetContinueWatchingResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetContinueWatchingResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetContinueWatchingResponse) GetObject() *GetContinueWatchingResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetContinueWatchingResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getcountries.go b/models/operations/getcountries.go new file mode 100644 index 0000000..f26f533 --- /dev/null +++ b/models/operations/getcountries.go @@ -0,0 +1,224 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Flavor - - `0`: The country is divided into regions, and following the key will lead to a list of regions. +// - `1`: The county is divided by postal codes, and an example code is returned in `example`. +// - `2`: The country has a single postal code, returned in `example`. +type Flavor int64 + +const ( + FlavorZero Flavor = 0 + FlavorOne Flavor = 1 + FlavorTwo Flavor = 2 +) + +func (e Flavor) ToPointer() *Flavor { + return &e +} +func (e *Flavor) 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: + *e = Flavor(v) + return nil + default: + return fmt.Errorf("invalid value for Flavor: %v", v) + } +} + +type Country struct { + // Three letter code + Code *string `json:"code,omitempty"` + Example *string `json:"example,omitempty"` + // - `0`: The country is divided into regions, and following the key will lead to a list of regions. + // - `1`: The county is divided by postal codes, and an example code is returned in `example`. + // - `2`: The country has a single postal code, returned in `example`. + // + Flavor *Flavor `json:"flavor,omitempty"` + Key *string `json:"key,omitempty"` + // Three letter language code + Language *string `json:"language,omitempty"` + // The title of the language + LanguageTitle *string `json:"languageTitle,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (c *Country) GetCode() *string { + if c == nil { + return nil + } + return c.Code +} + +func (c *Country) GetExample() *string { + if c == nil { + return nil + } + return c.Example +} + +func (c *Country) GetFlavor() *Flavor { + if c == nil { + return nil + } + return c.Flavor +} + +func (c *Country) GetKey() *string { + if c == nil { + return nil + } + return c.Key +} + +func (c *Country) GetLanguage() *string { + if c == nil { + return nil + } + return c.Language +} + +func (c *Country) GetLanguageTitle() *string { + if c == nil { + return nil + } + return c.LanguageTitle +} + +func (c *Country) GetTitle() *string { + if c == nil { + return nil + } + return c.Title +} + +func (c *Country) GetType() *string { + if c == nil { + return nil + } + return c.Type +} + +// GetCountriesMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetCountriesMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Country []Country `json:"Country,omitempty"` +} + +func (g *GetCountriesMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetCountriesMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetCountriesMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetCountriesMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetCountriesMediaContainer) GetCountry() []Country { + if g == nil { + return nil + } + return g.Country +} + +// GetCountriesResponseBody - OK +type GetCountriesResponseBody struct { + MediaContainer *GetCountriesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetCountriesResponseBody) GetMediaContainer() *GetCountriesMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetCountriesResponse 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 + // OK + Object *GetCountriesResponseBody + Headers map[string][]string +} + +func (g *GetCountriesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCountriesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCountriesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCountriesResponse) GetObject() *GetCountriesResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetCountriesResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getcountrieslibrary.go b/models/operations/getcountrieslibrary.go deleted file mode 100644 index ceade70..0000000 --- a/models/operations/getcountrieslibrary.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -// GetCountriesLibraryQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetCountriesLibraryQueryParamType int64 - -const ( - GetCountriesLibraryQueryParamTypeMovie GetCountriesLibraryQueryParamType = 1 - GetCountriesLibraryQueryParamTypeTvShow GetCountriesLibraryQueryParamType = 2 - GetCountriesLibraryQueryParamTypeSeason GetCountriesLibraryQueryParamType = 3 - GetCountriesLibraryQueryParamTypeEpisode GetCountriesLibraryQueryParamType = 4 - GetCountriesLibraryQueryParamTypeArtist GetCountriesLibraryQueryParamType = 5 - GetCountriesLibraryQueryParamTypeAlbum GetCountriesLibraryQueryParamType = 6 - GetCountriesLibraryQueryParamTypeTrack GetCountriesLibraryQueryParamType = 7 - GetCountriesLibraryQueryParamTypePhotoAlbum GetCountriesLibraryQueryParamType = 8 - GetCountriesLibraryQueryParamTypePhoto GetCountriesLibraryQueryParamType = 9 -) - -func (e GetCountriesLibraryQueryParamType) ToPointer() *GetCountriesLibraryQueryParamType { - return &e -} - -type GetCountriesLibraryRequest struct { - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetCountriesLibraryQueryParamType `queryParam:"style=form,explode=true,name=type"` -} - -func (g *GetCountriesLibraryRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -func (g *GetCountriesLibraryRequest) GetType() GetCountriesLibraryQueryParamType { - if g == nil { - return GetCountriesLibraryQueryParamType(0) - } - return g.Type -} - -type GetCountriesLibraryDirectory struct { - FastKey string `json:"fastKey"` - Key string `json:"key"` - Title string `json:"title"` -} - -func (g *GetCountriesLibraryDirectory) GetFastKey() string { - if g == nil { - return "" - } - return g.FastKey -} - -func (g *GetCountriesLibraryDirectory) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetCountriesLibraryDirectory) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetCountriesLibraryMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // URL for the background artwork of the media container. - Art string `json:"art"` - // The content type or mode. - Content string `json:"content"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // Specifies whether caching is disabled. - Nocache bool `json:"nocache"` - // URL for the thumbnail image of the media container. - Thumb string `json:"thumb"` - // The primary title of the media container. - Title1 string `json:"title1"` - // The secondary title of the media container. - Title2 string `json:"title2"` - // Identifier for the view group layout. - ViewGroup string `json:"viewGroup"` - Directory []GetCountriesLibraryDirectory `json:"Directory,omitempty"` -} - -func (g *GetCountriesLibraryMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetCountriesLibraryMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetCountriesLibraryMediaContainer) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetCountriesLibraryMediaContainer) GetContent() string { - if g == nil { - return "" - } - return g.Content -} - -func (g *GetCountriesLibraryMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetCountriesLibraryMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetCountriesLibraryMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetCountriesLibraryMediaContainer) GetNocache() bool { - if g == nil { - return false - } - return g.Nocache -} - -func (g *GetCountriesLibraryMediaContainer) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetCountriesLibraryMediaContainer) GetTitle1() string { - if g == nil { - return "" - } - return g.Title1 -} - -func (g *GetCountriesLibraryMediaContainer) GetTitle2() string { - if g == nil { - return "" - } - return g.Title2 -} - -func (g *GetCountriesLibraryMediaContainer) GetViewGroup() string { - if g == nil { - return "" - } - return g.ViewGroup -} - -func (g *GetCountriesLibraryMediaContainer) GetDirectory() []GetCountriesLibraryDirectory { - if g == nil { - return nil - } - return g.Directory -} - -// GetCountriesLibraryResponseBody - Successful response containing media container data. -type GetCountriesLibraryResponseBody struct { - MediaContainer *GetCountriesLibraryMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetCountriesLibraryResponseBody) GetMediaContainer() *GetCountriesLibraryMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetCountriesLibraryResponse 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 - // Successful response containing media container data. - Object *GetCountriesLibraryResponseBody -} - -func (g *GetCountriesLibraryResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetCountriesLibraryResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetCountriesLibraryResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetCountriesLibraryResponse) GetObject() *GetCountriesLibraryResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getcountrieslineups.go b/models/operations/getcountrieslineups.go new file mode 100644 index 0000000..37b675a --- /dev/null +++ b/models/operations/getcountrieslineups.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetCountriesLineupsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCountriesLineupsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCountriesLineupsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCountriesLineupsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCountriesLineupsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCountriesLineupsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCountriesLineupsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCountriesLineupsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCountriesLineupsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCountriesLineupsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCountriesLineupsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCountriesLineupsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCountriesLineupsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCountriesLineupsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCountriesLineupsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 3 letter country code + Country string `pathParam:"style=simple,explode=false,name=country"` + // The `providerIdentifier` of the provider + EpgID string `pathParam:"style=simple,explode=false,name=epgId"` + // The postal code for the lineups to fetch + PostalCode *string `queryParam:"style=form,explode=true,name=postalCode"` +} + +func (g GetCountriesLineupsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCountriesLineupsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"country", "epgId"}); err != nil { + return err + } + return nil +} + +func (g *GetCountriesLineupsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCountriesLineupsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCountriesLineupsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCountriesLineupsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCountriesLineupsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCountriesLineupsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCountriesLineupsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCountriesLineupsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCountriesLineupsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCountriesLineupsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCountriesLineupsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCountriesLineupsRequest) GetCountry() string { + if g == nil { + return "" + } + return g.Country +} + +func (g *GetCountriesLineupsRequest) GetEpgID() string { + if g == nil { + return "" + } + return g.EpgID +} + +func (g *GetCountriesLineupsRequest) GetPostalCode() *string { + if g == nil { + return nil + } + return g.PostalCode +} + +type GetCountriesLineupsResponse 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 + // OK + MediaContainerWithLineup *components.MediaContainerWithLineup +} + +func (g *GetCountriesLineupsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCountriesLineupsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCountriesLineupsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCountriesLineupsResponse) GetMediaContainerWithLineup() *components.MediaContainerWithLineup { + if g == nil { + return nil + } + return g.MediaContainerWithLineup +} diff --git a/models/operations/getcountryregions.go b/models/operations/getcountryregions.go new file mode 100644 index 0000000..dd0fef3 --- /dev/null +++ b/models/operations/getcountryregions.go @@ -0,0 +1,397 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetCountryRegionsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetCountryRegionsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCountryRegionsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetCountryRegionsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCountryRegionsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCountryRegionsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCountryRegionsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCountryRegionsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCountryRegionsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCountryRegionsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCountryRegionsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCountryRegionsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCountryRegionsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCountryRegionsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetCountryRegionsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 3 letter country code + Country string `pathParam:"style=simple,explode=false,name=country"` + // The `providerIdentifier` of the provider + EpgID string `pathParam:"style=simple,explode=false,name=epgId"` +} + +func (g GetCountryRegionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCountryRegionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"country", "epgId"}); err != nil { + return err + } + return nil +} + +func (g *GetCountryRegionsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetCountryRegionsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetCountryRegionsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetCountryRegionsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetCountryRegionsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetCountryRegionsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetCountryRegionsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetCountryRegionsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetCountryRegionsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetCountryRegionsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetCountryRegionsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetCountryRegionsRequest) GetCountry() string { + if g == nil { + return "" + } + return g.Country +} + +func (g *GetCountryRegionsRequest) GetEpgID() string { + if g == nil { + return "" + } + return g.EpgID +} + +type GetCountryRegionsCountry struct { + Key *string `json:"key,omitempty"` + National *bool `json:"national,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (g *GetCountryRegionsCountry) GetKey() *string { + if g == nil { + return nil + } + return g.Key +} + +func (g *GetCountryRegionsCountry) GetNational() *bool { + if g == nil { + return nil + } + return g.National +} + +func (g *GetCountryRegionsCountry) GetTitle() *string { + if g == nil { + return nil + } + return g.Title +} + +func (g *GetCountryRegionsCountry) GetType() *string { + if g == nil { + return nil + } + return g.Type +} + +// GetCountryRegionsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetCountryRegionsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Country []GetCountryRegionsCountry `json:"Country,omitempty"` +} + +func (g *GetCountryRegionsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetCountryRegionsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetCountryRegionsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetCountryRegionsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetCountryRegionsMediaContainer) GetCountry() []GetCountryRegionsCountry { + if g == nil { + return nil + } + return g.Country +} + +// GetCountryRegionsResponseBody - OK +type GetCountryRegionsResponseBody struct { + MediaContainer *GetCountryRegionsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetCountryRegionsResponseBody) GetMediaContainer() *GetCountryRegionsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetCountryRegionsResponse 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 + // OK + Object *GetCountryRegionsResponseBody + Headers map[string][]string +} + +func (g *GetCountryRegionsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetCountryRegionsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetCountryRegionsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetCountryRegionsResponse) GetObject() *GetCountryRegionsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetCountryRegionsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getdevicedetails.go b/models/operations/getdevicedetails.go new file mode 100644 index 0000000..933945b --- /dev/null +++ b/models/operations/getdevicedetails.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetDeviceDetailsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetDeviceDetailsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDeviceDetailsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetDeviceDetailsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDeviceDetailsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDeviceDetailsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDeviceDetailsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDeviceDetailsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDeviceDetailsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDeviceDetailsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDeviceDetailsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDeviceDetailsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDeviceDetailsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDeviceDetailsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetDeviceDetailsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` +} + +func (g GetDeviceDetailsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDeviceDetailsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (g *GetDeviceDetailsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDeviceDetailsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDeviceDetailsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDeviceDetailsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDeviceDetailsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDeviceDetailsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDeviceDetailsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDeviceDetailsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDeviceDetailsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDeviceDetailsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDeviceDetailsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetDeviceDetailsRequest) GetDeviceID() int64 { + if g == nil { + return 0 + } + return g.DeviceID +} + +type GetDeviceDetailsResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice +} + +func (g *GetDeviceDetailsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetDeviceDetailsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetDeviceDetailsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetDeviceDetailsResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if g == nil { + return nil + } + return g.MediaContainerWithDevice +} diff --git a/models/operations/getdevices.go b/models/operations/getdevices.go deleted file mode 100644 index 668240a..0000000 --- a/models/operations/getdevices.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (d *Device) GetID() *float64 { - if d == nil { - return nil - } - return d.ID -} - -func (d *Device) GetName() *string { - if d == nil { - return nil - } - return d.Name -} - -func (d *Device) GetPlatform() *string { - if d == nil { - return nil - } - return d.Platform -} - -func (d *Device) GetClientIdentifier() *string { - if d == nil { - return nil - } - return d.ClientIdentifier -} - -func (d *Device) GetCreatedAt() *float64 { - if d == nil { - return nil - } - return d.CreatedAt -} - -type GetDevicesMediaContainer struct { - Size *float64 `json:"size,omitempty"` - Identifier *string `json:"identifier,omitempty"` - Device []Device `json:"Device,omitempty"` -} - -func (g *GetDevicesMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetDevicesMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetDevicesMediaContainer) GetDevice() []Device { - if g == nil { - return nil - } - return g.Device -} - -// GetDevicesResponseBody - Devices -type GetDevicesResponseBody struct { - MediaContainer *GetDevicesMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetDevicesResponseBody) GetMediaContainer() *GetDevicesMediaContainer { - if g == nil { - return nil - } - return g.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 (g *GetDevicesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetDevicesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetDevicesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetDevicesResponse) GetObject() *GetDevicesResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getdeviceschannels.go b/models/operations/getdeviceschannels.go new file mode 100644 index 0000000..5b3d0e9 --- /dev/null +++ b/models/operations/getdeviceschannels.go @@ -0,0 +1,421 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetDevicesChannelsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetDevicesChannelsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDevicesChannelsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetDevicesChannelsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDevicesChannelsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDevicesChannelsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDevicesChannelsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDevicesChannelsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDevicesChannelsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDevicesChannelsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDevicesChannelsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDevicesChannelsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDevicesChannelsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDevicesChannelsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetDevicesChannelsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` +} + +func (g GetDevicesChannelsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDevicesChannelsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (g *GetDevicesChannelsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDevicesChannelsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDevicesChannelsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDevicesChannelsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDevicesChannelsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDevicesChannelsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDevicesChannelsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDevicesChannelsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDevicesChannelsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDevicesChannelsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDevicesChannelsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetDevicesChannelsRequest) GetDeviceID() int64 { + if g == nil { + return 0 + } + return g.DeviceID +} + +type DeviceChannel struct { + // Indicates the channel is DRMed and thus may not be playable + Drm *bool `json:"drm,omitempty"` + Favorite *bool `json:"favorite,omitempty"` + Hd *bool `json:"hd,omitempty"` + Identifier *string `json:"identifier,omitempty"` + Key *string `json:"key,omitempty"` + Name *string `json:"name,omitempty"` + SignalQuality *int64 `json:"signalQuality,omitempty"` + SignalStrength *int64 `json:"signalStrength,omitempty"` +} + +func (d *DeviceChannel) GetDrm() *bool { + if d == nil { + return nil + } + return d.Drm +} + +func (d *DeviceChannel) GetFavorite() *bool { + if d == nil { + return nil + } + return d.Favorite +} + +func (d *DeviceChannel) GetHd() *bool { + if d == nil { + return nil + } + return d.Hd +} + +func (d *DeviceChannel) GetIdentifier() *string { + if d == nil { + return nil + } + return d.Identifier +} + +func (d *DeviceChannel) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *DeviceChannel) GetName() *string { + if d == nil { + return nil + } + return d.Name +} + +func (d *DeviceChannel) GetSignalQuality() *int64 { + if d == nil { + return nil + } + return d.SignalQuality +} + +func (d *DeviceChannel) GetSignalStrength() *int64 { + if d == nil { + return nil + } + return d.SignalStrength +} + +// GetDevicesChannelsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetDevicesChannelsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + DeviceChannel []DeviceChannel `json:"DeviceChannel,omitempty"` +} + +func (g *GetDevicesChannelsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetDevicesChannelsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetDevicesChannelsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetDevicesChannelsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetDevicesChannelsMediaContainer) GetDeviceChannel() []DeviceChannel { + if g == nil { + return nil + } + return g.DeviceChannel +} + +// GetDevicesChannelsResponseBody - OK +type GetDevicesChannelsResponseBody struct { + MediaContainer *GetDevicesChannelsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetDevicesChannelsResponseBody) GetMediaContainer() *GetDevicesChannelsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetDevicesChannelsResponse 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 + // OK + Object *GetDevicesChannelsResponseBody + Headers map[string][]string +} + +func (g *GetDevicesChannelsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetDevicesChannelsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetDevicesChannelsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetDevicesChannelsResponse) GetObject() *GetDevicesChannelsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetDevicesChannelsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getdownloadqueue.go b/models/operations/getdownloadqueue.go new file mode 100644 index 0000000..162f495 --- /dev/null +++ b/models/operations/getdownloadqueue.go @@ -0,0 +1,422 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetDownloadQueueGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetDownloadQueueGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDownloadQueueGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetDownloadQueueGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDownloadQueueGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDownloadQueueGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDownloadQueueGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDownloadQueueGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDownloadQueueGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDownloadQueueGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDownloadQueueGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDownloadQueueGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDownloadQueueGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDownloadQueueGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetDownloadQueueRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` +} + +func (g GetDownloadQueueRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDownloadQueueRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"queueId"}); err != nil { + return err + } + return nil +} + +func (g *GetDownloadQueueRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDownloadQueueRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDownloadQueueRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDownloadQueueRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDownloadQueueRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDownloadQueueRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDownloadQueueRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDownloadQueueRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDownloadQueueRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDownloadQueueRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDownloadQueueRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetDownloadQueueRequest) GetQueueID() int64 { + if g == nil { + return 0 + } + return g.QueueID +} + +// GetDownloadQueueStatus - The state of this queue +// - deciding: At least one item is still being decided +// - waiting: At least one item is waiting for transcode and none are currently transcoding +// - processing: At least one item is being transcoded +// - done: All items are available (or potentially expired) +// - error: At least one item has encountered an error +type GetDownloadQueueStatus string + +const ( + GetDownloadQueueStatusDeciding GetDownloadQueueStatus = "deciding" + GetDownloadQueueStatusWaiting GetDownloadQueueStatus = "waiting" + GetDownloadQueueStatusProcessing GetDownloadQueueStatus = "processing" + GetDownloadQueueStatusDone GetDownloadQueueStatus = "done" + GetDownloadQueueStatusError GetDownloadQueueStatus = "error" +) + +func (e GetDownloadQueueStatus) ToPointer() *GetDownloadQueueStatus { + return &e +} +func (e *GetDownloadQueueStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "deciding": + fallthrough + case "waiting": + fallthrough + case "processing": + fallthrough + case "done": + fallthrough + case "error": + *e = GetDownloadQueueStatus(v) + return nil + default: + return fmt.Errorf("invalid value for GetDownloadQueueStatus: %v", v) + } +} + +type GetDownloadQueueDownloadQueue struct { + ID *int64 `json:"id,omitempty"` + ItemCount *int64 `json:"itemCount,omitempty"` + // The state of this queue + // - deciding: At least one item is still being decided + // - waiting: At least one item is waiting for transcode and none are currently transcoding + // - processing: At least one item is being transcoded + // - done: All items are available (or potentially expired) + // - error: At least one item has encountered an error + // + Status *GetDownloadQueueStatus `json:"status,omitempty"` +} + +func (g *GetDownloadQueueDownloadQueue) GetID() *int64 { + if g == nil { + return nil + } + return g.ID +} + +func (g *GetDownloadQueueDownloadQueue) GetItemCount() *int64 { + if g == nil { + return nil + } + return g.ItemCount +} + +func (g *GetDownloadQueueDownloadQueue) GetStatus() *GetDownloadQueueStatus { + if g == nil { + return nil + } + return g.Status +} + +// GetDownloadQueueMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetDownloadQueueMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + DownloadQueue []GetDownloadQueueDownloadQueue `json:"DownloadQueue,omitempty"` +} + +func (g *GetDownloadQueueMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetDownloadQueueMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetDownloadQueueMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetDownloadQueueMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetDownloadQueueMediaContainer) GetDownloadQueue() []GetDownloadQueueDownloadQueue { + if g == nil { + return nil + } + return g.DownloadQueue +} + +// GetDownloadQueueResponseBody - OK +type GetDownloadQueueResponseBody struct { + MediaContainer *GetDownloadQueueMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetDownloadQueueResponseBody) GetMediaContainer() *GetDownloadQueueMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetDownloadQueueResponse 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 + // OK + Object *GetDownloadQueueResponseBody +} + +func (g *GetDownloadQueueResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetDownloadQueueResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetDownloadQueueResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetDownloadQueueResponse) GetObject() *GetDownloadQueueResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getdownloadqueueitems.go b/models/operations/getdownloadqueueitems.go new file mode 100644 index 0000000..0b85190 --- /dev/null +++ b/models/operations/getdownloadqueueitems.go @@ -0,0 +1,561 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetDownloadQueueItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetDownloadQueueItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDownloadQueueItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetDownloadQueueItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDownloadQueueItemsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDownloadQueueItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDownloadQueueItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDownloadQueueItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDownloadQueueItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDownloadQueueItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDownloadQueueItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDownloadQueueItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDownloadQueueItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDownloadQueueItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetDownloadQueueItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` + // The item ids + ItemID []int64 `pathParam:"style=simple,explode=false,name=itemId"` +} + +func (g GetDownloadQueueItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDownloadQueueItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"queueId", "itemId"}); err != nil { + return err + } + return nil +} + +func (g *GetDownloadQueueItemsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDownloadQueueItemsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDownloadQueueItemsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDownloadQueueItemsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDownloadQueueItemsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDownloadQueueItemsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDownloadQueueItemsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDownloadQueueItemsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDownloadQueueItemsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDownloadQueueItemsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDownloadQueueItemsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetDownloadQueueItemsRequest) GetQueueID() int64 { + if g == nil { + return 0 + } + return g.QueueID +} + +func (g *GetDownloadQueueItemsRequest) GetItemID() []int64 { + if g == nil { + return []int64{} + } + return g.ItemID +} + +type GetDownloadQueueItemsDecisionResult struct { + // The maximum bitrate set when item was added + AvailableBandwidth *int64 `json:"availableBandwidth,omitempty"` + DirectPlayDecisionCode *int64 `json:"directPlayDecisionCode,omitempty"` + DirectPlayDecisionText *string `json:"directPlayDecisionText,omitempty"` + GeneralDecisionCode *int64 `json:"generalDecisionCode,omitempty"` + GeneralDecisionText *string `json:"generalDecisionText,omitempty"` + // The code indicating the status of evaluation of playback when client indicates `hasMDE=1` + MdeDecisionCode *int64 `json:"mdeDecisionCode,omitempty"` + // Descriptive text for the above code + MdeDecisionText *string `json:"mdeDecisionText,omitempty"` + TranscodeDecisionCode *int64 `json:"transcodeDecisionCode,omitempty"` + TranscodeDecisionText *string `json:"transcodeDecisionText,omitempty"` +} + +func (g *GetDownloadQueueItemsDecisionResult) GetAvailableBandwidth() *int64 { + if g == nil { + return nil + } + return g.AvailableBandwidth +} + +func (g *GetDownloadQueueItemsDecisionResult) GetDirectPlayDecisionCode() *int64 { + if g == nil { + return nil + } + return g.DirectPlayDecisionCode +} + +func (g *GetDownloadQueueItemsDecisionResult) GetDirectPlayDecisionText() *string { + if g == nil { + return nil + } + return g.DirectPlayDecisionText +} + +func (g *GetDownloadQueueItemsDecisionResult) GetGeneralDecisionCode() *int64 { + if g == nil { + return nil + } + return g.GeneralDecisionCode +} + +func (g *GetDownloadQueueItemsDecisionResult) GetGeneralDecisionText() *string { + if g == nil { + return nil + } + return g.GeneralDecisionText +} + +func (g *GetDownloadQueueItemsDecisionResult) GetMdeDecisionCode() *int64 { + if g == nil { + return nil + } + return g.MdeDecisionCode +} + +func (g *GetDownloadQueueItemsDecisionResult) GetMdeDecisionText() *string { + if g == nil { + return nil + } + return g.MdeDecisionText +} + +func (g *GetDownloadQueueItemsDecisionResult) GetTranscodeDecisionCode() *int64 { + if g == nil { + return nil + } + return g.TranscodeDecisionCode +} + +func (g *GetDownloadQueueItemsDecisionResult) GetTranscodeDecisionText() *string { + if g == nil { + return nil + } + return g.TranscodeDecisionText +} + +// GetDownloadQueueItemsStatus - The state of the item: +// - deciding: The item decision is pending +// - waiting: The item is waiting for transcode +// - processing: The item is being transcoded +// - available: The item is available for download +// - error: The item encountered an error in the decision or transcode +// - expired: The transcoded item has timed out and is no longer available +type GetDownloadQueueItemsStatus string + +const ( + GetDownloadQueueItemsStatusDeciding GetDownloadQueueItemsStatus = "deciding" + GetDownloadQueueItemsStatusWaiting GetDownloadQueueItemsStatus = "waiting" + GetDownloadQueueItemsStatusProcessing GetDownloadQueueItemsStatus = "processing" + GetDownloadQueueItemsStatusAvailable GetDownloadQueueItemsStatus = "available" + GetDownloadQueueItemsStatusError GetDownloadQueueItemsStatus = "error" + GetDownloadQueueItemsStatusExpired GetDownloadQueueItemsStatus = "expired" +) + +func (e GetDownloadQueueItemsStatus) ToPointer() *GetDownloadQueueItemsStatus { + return &e +} +func (e *GetDownloadQueueItemsStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "deciding": + fallthrough + case "waiting": + fallthrough + case "processing": + fallthrough + case "available": + fallthrough + case "error": + fallthrough + case "expired": + *e = GetDownloadQueueItemsStatus(v) + return nil + default: + return fmt.Errorf("invalid value for GetDownloadQueueItemsStatus: %v", v) + } +} + +// GetDownloadQueueItemsTranscode - The transcode session object which is not yet documented otherwise it'd be a $ref here. +type GetDownloadQueueItemsTranscode struct { +} + +type GetDownloadQueueItemsDownloadQueueItem struct { + DecisionResult *GetDownloadQueueItemsDecisionResult `json:"DecisionResult,omitempty"` + // The error encountered in transcoding or decision + Error *string `json:"error,omitempty"` + ID *int64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + QueueID *int64 `json:"queueId,omitempty"` + // The state of the item: + // - deciding: The item decision is pending + // - waiting: The item is waiting for transcode + // - processing: The item is being transcoded + // - available: The item is available for download + // - error: The item encountered an error in the decision or transcode + // - expired: The transcoded item has timed out and is no longer available + // + Status *GetDownloadQueueItemsStatus `json:"status,omitempty"` + // The transcode session object which is not yet documented otherwise it'd be a $ref here. + Transcode *GetDownloadQueueItemsTranscode `json:"transcode,omitempty"` + // The transcode session if item is currently being transcoded + TranscodeSession *components.TranscodeSession `json:"TranscodeSession,omitempty"` +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetDecisionResult() *GetDownloadQueueItemsDecisionResult { + if g == nil { + return nil + } + return g.DecisionResult +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetError() *string { + if g == nil { + return nil + } + return g.Error +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetID() *int64 { + if g == nil { + return nil + } + return g.ID +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetKey() *string { + if g == nil { + return nil + } + return g.Key +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetQueueID() *int64 { + if g == nil { + return nil + } + return g.QueueID +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetStatus() *GetDownloadQueueItemsStatus { + if g == nil { + return nil + } + return g.Status +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetTranscode() *GetDownloadQueueItemsTranscode { + if g == nil { + return nil + } + return g.Transcode +} + +func (g *GetDownloadQueueItemsDownloadQueueItem) GetTranscodeSession() *components.TranscodeSession { + if g == nil { + return nil + } + return g.TranscodeSession +} + +// GetDownloadQueueItemsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetDownloadQueueItemsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + DownloadQueueItem []GetDownloadQueueItemsDownloadQueueItem `json:"DownloadQueueItem,omitempty"` +} + +func (g *GetDownloadQueueItemsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetDownloadQueueItemsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetDownloadQueueItemsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetDownloadQueueItemsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetDownloadQueueItemsMediaContainer) GetDownloadQueueItem() []GetDownloadQueueItemsDownloadQueueItem { + if g == nil { + return nil + } + return g.DownloadQueueItem +} + +// GetDownloadQueueItemsResponseBody - OK +type GetDownloadQueueItemsResponseBody struct { + MediaContainer *GetDownloadQueueItemsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetDownloadQueueItemsResponseBody) GetMediaContainer() *GetDownloadQueueItemsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetDownloadQueueItemsResponse 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 + // OK + Object *GetDownloadQueueItemsResponseBody +} + +func (g *GetDownloadQueueItemsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetDownloadQueueItemsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetDownloadQueueItemsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetDownloadQueueItemsResponse) GetObject() *GetDownloadQueueItemsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getdownloadqueuemedia.go b/models/operations/getdownloadqueuemedia.go new file mode 100644 index 0000000..d433818 --- /dev/null +++ b/models/operations/getdownloadqueuemedia.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetDownloadQueueMediaGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetDownloadQueueMediaGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDownloadQueueMediaGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetDownloadQueueMediaGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDownloadQueueMediaGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDownloadQueueMediaGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDownloadQueueMediaGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDownloadQueueMediaGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDownloadQueueMediaGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDownloadQueueMediaGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDownloadQueueMediaGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDownloadQueueMediaGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDownloadQueueMediaGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDownloadQueueMediaGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetDownloadQueueMediaRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` + // The item ids + ItemID int64 `pathParam:"style=simple,explode=false,name=itemId"` +} + +func (g GetDownloadQueueMediaRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDownloadQueueMediaRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"queueId", "itemId"}); err != nil { + return err + } + return nil +} + +func (g *GetDownloadQueueMediaRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDownloadQueueMediaRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDownloadQueueMediaRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDownloadQueueMediaRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDownloadQueueMediaRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDownloadQueueMediaRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDownloadQueueMediaRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDownloadQueueMediaRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDownloadQueueMediaRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDownloadQueueMediaRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDownloadQueueMediaRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetDownloadQueueMediaRequest) GetQueueID() int64 { + if g == nil { + return 0 + } + return g.QueueID +} + +func (g *GetDownloadQueueMediaRequest) GetItemID() int64 { + if g == nil { + return 0 + } + return g.ItemID +} + +type GetDownloadQueueMediaResponse 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 + Headers map[string][]string +} + +func (g *GetDownloadQueueMediaResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetDownloadQueueMediaResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetDownloadQueueMediaResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetDownloadQueueMediaResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getdvr.go b/models/operations/getdvr.go new file mode 100644 index 0000000..acd5cc9 --- /dev/null +++ b/models/operations/getdvr.go @@ -0,0 +1,416 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetDVRGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetDVRGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDVRGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetDVRGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDVRGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDVRGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDVRGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDVRGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDVRGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDVRGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDVRGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDVRGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDVRGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDVRGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetDVRRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` +} + +func (g GetDVRRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetDVRRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"dvrId"}); err != nil { + return err + } + return nil +} + +func (g *GetDVRRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetDVRRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetDVRRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetDVRRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetDVRRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetDVRRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetDVRRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDVRRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetDVRRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetDVRRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetDVRRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetDVRRequest) GetDvrID() int64 { + if g == nil { + return 0 + } + return g.DvrID +} + +// GetDVRDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetDVRDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (g *GetDVRDVRsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetDVRDVRsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetDVRDVRsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetDVRDVRsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetDVRDVRsMediaContainer) GetStatus() *int64 { + if g == nil { + return nil + } + return g.Status +} + +type GetDVRDVR struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (g *GetDVRDVR) GetDevice() []components.Device { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetDVRDVR) GetKey() *string { + if g == nil { + return nil + } + return g.Key +} + +func (g *GetDVRDVR) GetLanguage() *string { + if g == nil { + return nil + } + return g.Language +} + +func (g *GetDVRDVR) GetLineup() *string { + if g == nil { + return nil + } + return g.Lineup +} + +func (g *GetDVRDVR) GetUUID() *string { + if g == nil { + return nil + } + return g.UUID +} + +type GetDVRMediaContainer struct { + MediaContainer *GetDVRDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []GetDVRDVR `json:"DVR,omitempty"` +} + +func (g *GetDVRMediaContainer) GetMediaContainer() *GetDVRDVRsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +func (g *GetDVRMediaContainer) GetDvr() []GetDVRDVR { + if g == nil { + return nil + } + return g.Dvr +} + +// GetDVRResponseBody - OK +type GetDVRResponseBody struct { + MediaContainer *GetDVRMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetDVRResponseBody) GetMediaContainer() *GetDVRMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetDVRResponse 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 + // OK + Object *GetDVRResponseBody + Headers map[string][]string +} + +func (g *GetDVRResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetDVRResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetDVRResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetDVRResponse) GetObject() *GetDVRResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetDVRResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getextras.go b/models/operations/getextras.go new file mode 100644 index 0000000..60bcbf4 --- /dev/null +++ b/models/operations/getextras.go @@ -0,0 +1,290 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetExtrasGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetExtrasGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetExtrasGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetExtrasGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetExtrasGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetExtrasGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetExtrasGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetExtrasGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetExtrasGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetExtrasGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetExtrasGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetExtrasGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetExtrasGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetExtrasGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetExtrasRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (g GetExtrasRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetExtrasRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GetExtrasRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetExtrasRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetExtrasRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetExtrasRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetExtrasRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetExtrasRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetExtrasRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetExtrasRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetExtrasRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetExtrasRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetExtrasRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetExtrasRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +type GetExtrasResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetExtrasResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetExtrasResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetExtrasResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetExtrasResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetExtrasResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getfile.go b/models/operations/getfile.go new file mode 100644 index 0000000..43a3e78 --- /dev/null +++ b/models/operations/getfile.go @@ -0,0 +1,303 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetFileGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetFileGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetFileGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetFileGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetFileGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetFileGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetFileGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetFileGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetFileGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetFileGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetFileGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetFileGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetFileGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetFileGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetFileRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // The bundle url, typically starting with `metadata://` or `media://` + URL *string `queryParam:"style=form,explode=true,name=url"` +} + +func (g GetFileRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetFileRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GetFileRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetFileRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetFileRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetFileRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetFileRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetFileRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetFileRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetFileRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetFileRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetFileRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetFileRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetFileRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +func (g *GetFileRequest) GetURL() *string { + if g == nil { + return nil + } + return g.URL +} + +type GetFileResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredAudioMpeg3ResponseStream io.ReadCloser + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredImageJpegResponseStream io.ReadCloser +} + +func (g *GetFileResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetFileResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetFileResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetFileResponse) GetTwoHundredAudioMpeg3ResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.TwoHundredAudioMpeg3ResponseStream +} + +func (g *GetFileResponse) GetTwoHundredImageJpegResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.TwoHundredImageJpegResponseStream +} diff --git a/models/operations/getfilehash.go b/models/operations/getfilehash.go deleted file mode 100644 index 8900701..0000000 --- a/models/operations/getfilehash.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (g *GetFileHashRequest) GetURL() string { - if g == nil { - return "" - } - return g.URL -} - -func (g *GetFileHashRequest) GetType() *float64 { - if g == nil { - return nil - } - return g.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 (g *GetFileHashResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetFileHashResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetFileHashResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} diff --git a/models/operations/getfirstcharacters.go b/models/operations/getfirstcharacters.go new file mode 100644 index 0000000..3fbfead --- /dev/null +++ b/models/operations/getfirstcharacters.go @@ -0,0 +1,400 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetFirstCharactersGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetFirstCharactersGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetFirstCharactersGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetFirstCharactersGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetFirstCharactersGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetFirstCharactersGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetFirstCharactersGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetFirstCharactersGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetFirstCharactersGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetFirstCharactersGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetFirstCharactersGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetFirstCharactersGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetFirstCharactersGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetFirstCharactersGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetFirstCharactersRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The metadata type to filter on + Type *int64 `queryParam:"style=form,explode=true,name=type"` + // The metadata type to filter on + Sort *int64 `queryParam:"style=form,explode=true,name=sort"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` +} + +func (g GetFirstCharactersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetFirstCharactersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetFirstCharactersRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetFirstCharactersRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetFirstCharactersRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetFirstCharactersRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetFirstCharactersRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetFirstCharactersRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetFirstCharactersRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetFirstCharactersRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetFirstCharactersRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetFirstCharactersRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetFirstCharactersRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetFirstCharactersRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetFirstCharactersRequest) GetType() *int64 { + if g == nil { + return nil + } + return g.Type +} + +func (g *GetFirstCharactersRequest) GetSort() *int64 { + if g == nil { + return nil + } + return g.Sort +} + +func (g *GetFirstCharactersRequest) GetMediaQuery() *components.MediaQuery { + if g == nil { + return nil + } + return g.MediaQuery +} + +type GetFirstCharactersDirectory struct { + Key *string `json:"key,omitempty"` + // The number of items starting with this character + Size *int64 `json:"size,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (g *GetFirstCharactersDirectory) GetKey() *string { + if g == nil { + return nil + } + return g.Key +} + +func (g *GetFirstCharactersDirectory) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetFirstCharactersDirectory) GetTitle() *string { + if g == nil { + return nil + } + return g.Title +} + +// GetFirstCharactersMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetFirstCharactersMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []GetFirstCharactersDirectory `json:"Directory,omitempty"` +} + +func (g *GetFirstCharactersMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetFirstCharactersMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetFirstCharactersMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetFirstCharactersMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetFirstCharactersMediaContainer) GetDirectory() []GetFirstCharactersDirectory { + if g == nil { + return nil + } + return g.Directory +} + +// GetFirstCharactersResponseBody - OK +type GetFirstCharactersResponseBody struct { + MediaContainer *GetFirstCharactersMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetFirstCharactersResponseBody) GetMediaContainer() *GetFirstCharactersMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetFirstCharactersResponse 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 + // OK + Object *GetFirstCharactersResponseBody +} + +func (g *GetFirstCharactersResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetFirstCharactersResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetFirstCharactersResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetFirstCharactersResponse) GetObject() *GetFirstCharactersResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getfolders.go b/models/operations/getfolders.go new file mode 100644 index 0000000..de553dc --- /dev/null +++ b/models/operations/getfolders.go @@ -0,0 +1,372 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetFoldersGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetFoldersGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetFoldersGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetFoldersGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetFoldersGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetFoldersGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetFoldersGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetFoldersGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetFoldersGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetFoldersGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetFoldersGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetFoldersGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetFoldersGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetFoldersGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetFoldersRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetFoldersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetFoldersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetFoldersRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetFoldersRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetFoldersRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetFoldersRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetFoldersRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetFoldersRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetFoldersRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetFoldersRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetFoldersRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetFoldersRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetFoldersRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetFoldersRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +type GetFoldersDirectory struct { + FastKey *string `json:"fastKey,omitempty"` + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (g *GetFoldersDirectory) GetFastKey() *string { + if g == nil { + return nil + } + return g.FastKey +} + +func (g *GetFoldersDirectory) GetKey() *string { + if g == nil { + return nil + } + return g.Key +} + +func (g *GetFoldersDirectory) GetTitle() *string { + if g == nil { + return nil + } + return g.Title +} + +// GetFoldersMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetFoldersMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []GetFoldersDirectory `json:"Directory,omitempty"` +} + +func (g *GetFoldersMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetFoldersMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetFoldersMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetFoldersMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetFoldersMediaContainer) GetDirectory() []GetFoldersDirectory { + if g == nil { + return nil + } + return g.Directory +} + +// GetFoldersResponseBody - OK +type GetFoldersResponseBody struct { + MediaContainer *GetFoldersMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetFoldersResponseBody) GetMediaContainer() *GetFoldersMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetFoldersResponse 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 + // OK + Object *GetFoldersResponseBody +} + +func (g *GetFoldersResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetFoldersResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetFoldersResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetFoldersResponse) GetObject() *GetFoldersResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getgenreslibrary.go b/models/operations/getgenreslibrary.go deleted file mode 100644 index 11085be..0000000 --- a/models/operations/getgenreslibrary.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -// GetGenresLibraryQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetGenresLibraryQueryParamType int64 - -const ( - GetGenresLibraryQueryParamTypeMovie GetGenresLibraryQueryParamType = 1 - GetGenresLibraryQueryParamTypeTvShow GetGenresLibraryQueryParamType = 2 - GetGenresLibraryQueryParamTypeSeason GetGenresLibraryQueryParamType = 3 - GetGenresLibraryQueryParamTypeEpisode GetGenresLibraryQueryParamType = 4 - GetGenresLibraryQueryParamTypeArtist GetGenresLibraryQueryParamType = 5 - GetGenresLibraryQueryParamTypeAlbum GetGenresLibraryQueryParamType = 6 - GetGenresLibraryQueryParamTypeTrack GetGenresLibraryQueryParamType = 7 - GetGenresLibraryQueryParamTypePhotoAlbum GetGenresLibraryQueryParamType = 8 - GetGenresLibraryQueryParamTypePhoto GetGenresLibraryQueryParamType = 9 -) - -func (e GetGenresLibraryQueryParamType) ToPointer() *GetGenresLibraryQueryParamType { - return &e -} - -type GetGenresLibraryRequest struct { - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetGenresLibraryQueryParamType `queryParam:"style=form,explode=true,name=type"` -} - -func (g *GetGenresLibraryRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -func (g *GetGenresLibraryRequest) GetType() GetGenresLibraryQueryParamType { - if g == nil { - return GetGenresLibraryQueryParamType(0) - } - return g.Type -} - -type GetGenresLibraryDirectory struct { - FastKey string `json:"fastKey"` - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` -} - -func (g *GetGenresLibraryDirectory) GetFastKey() string { - if g == nil { - return "" - } - return g.FastKey -} - -func (g *GetGenresLibraryDirectory) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetGenresLibraryDirectory) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetGenresLibraryDirectory) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -type GetGenresLibraryMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // URL for the background artwork of the media container. - Art string `json:"art"` - // The content type or mode. - Content string `json:"content"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // Specifies whether caching is disabled. - Nocache bool `json:"nocache"` - // URL for the thumbnail image of the media container. - Thumb string `json:"thumb"` - // The primary title of the media container. - Title1 string `json:"title1"` - // The secondary title of the media container. - Title2 string `json:"title2"` - // Identifier for the view group layout. - ViewGroup string `json:"viewGroup"` - Directory []GetGenresLibraryDirectory `json:"Directory,omitempty"` -} - -func (g *GetGenresLibraryMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetGenresLibraryMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetGenresLibraryMediaContainer) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetGenresLibraryMediaContainer) GetContent() string { - if g == nil { - return "" - } - return g.Content -} - -func (g *GetGenresLibraryMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetGenresLibraryMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetGenresLibraryMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetGenresLibraryMediaContainer) GetNocache() bool { - if g == nil { - return false - } - return g.Nocache -} - -func (g *GetGenresLibraryMediaContainer) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetGenresLibraryMediaContainer) GetTitle1() string { - if g == nil { - return "" - } - return g.Title1 -} - -func (g *GetGenresLibraryMediaContainer) GetTitle2() string { - if g == nil { - return "" - } - return g.Title2 -} - -func (g *GetGenresLibraryMediaContainer) GetViewGroup() string { - if g == nil { - return "" - } - return g.ViewGroup -} - -func (g *GetGenresLibraryMediaContainer) GetDirectory() []GetGenresLibraryDirectory { - if g == nil { - return nil - } - return g.Directory -} - -// GetGenresLibraryResponseBody - Successful response containing media container data. -type GetGenresLibraryResponseBody struct { - MediaContainer *GetGenresLibraryMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetGenresLibraryResponseBody) GetMediaContainer() *GetGenresLibraryMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetGenresLibraryResponse 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 - // Successful response containing media container data. - Object *GetGenresLibraryResponseBody -} - -func (g *GetGenresLibraryResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetGenresLibraryResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetGenresLibraryResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetGenresLibraryResponse) GetObject() *GetGenresLibraryResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getgeodata.go b/models/operations/getgeodata.go deleted file mode 100644 index 1672508..0000000 --- a/models/operations/getgeodata.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" -) - -var GetGeoDataServerList = []string{ - "https://plex.tv/api/v2", -} - -// GetGeoDataGeoData - Geo location data -type GetGeoDataGeoData struct { - // The ISO 3166-1 alpha-2 code of the country. - Code string `json:"code"` - // The continent code where the country is located. - ContinentCode string `json:"continent_code"` - // The official name of the country. - Country string `json:"country"` - // The name of the city. - City string `json:"city"` - // Indicates if the country is a member of the European Union. - EuropeanUnionMember *bool `default:"false" json:"european_union_member"` - // The time zone of the country. - TimeZone string `json:"time_zone"` - // The postal code of the location. - PostalCode string `json:"postal_code"` - // Indicates if the country has privacy restrictions. - InPrivacyRestrictedCountry *bool `default:"false" json:"in_privacy_restricted_country"` - // Indicates if the region has privacy restrictions. - InPrivacyRestrictedRegion *bool `default:"false" json:"in_privacy_restricted_region"` - // The name of the primary administrative subdivision. - Subdivisions string `json:"subdivisions"` - // The geographical coordinates (latitude, longitude) of the location. - Coordinates string `json:"coordinates"` -} - -func (g GetGeoDataGeoData) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetGeoDataGeoData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil { - return err - } - return nil -} - -func (g *GetGeoDataGeoData) GetCode() string { - if g == nil { - return "" - } - return g.Code -} - -func (g *GetGeoDataGeoData) GetContinentCode() string { - if g == nil { - return "" - } - return g.ContinentCode -} - -func (g *GetGeoDataGeoData) GetCountry() string { - if g == nil { - return "" - } - return g.Country -} - -func (g *GetGeoDataGeoData) GetCity() string { - if g == nil { - return "" - } - return g.City -} - -func (g *GetGeoDataGeoData) GetEuropeanUnionMember() *bool { - if g == nil { - return nil - } - return g.EuropeanUnionMember -} - -func (g *GetGeoDataGeoData) GetTimeZone() string { - if g == nil { - return "" - } - return g.TimeZone -} - -func (g *GetGeoDataGeoData) GetPostalCode() string { - if g == nil { - return "" - } - return g.PostalCode -} - -func (g *GetGeoDataGeoData) GetInPrivacyRestrictedCountry() *bool { - if g == nil { - return nil - } - return g.InPrivacyRestrictedCountry -} - -func (g *GetGeoDataGeoData) GetInPrivacyRestrictedRegion() *bool { - if g == nil { - return nil - } - return g.InPrivacyRestrictedRegion -} - -func (g *GetGeoDataGeoData) GetSubdivisions() string { - if g == nil { - return "" - } - return g.Subdivisions -} - -func (g *GetGeoDataGeoData) GetCoordinates() string { - if g == nil { - return "" - } - return g.Coordinates -} - -type GetGeoDataResponse 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 - // Gets the geo location data of the user - GeoData *GetGeoDataGeoData -} - -func (g *GetGeoDataResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetGeoDataResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetGeoDataResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetGeoDataResponse) GetGeoData() *GetGeoDataGeoData { - if g == nil { - return nil - } - return g.GeoData -} diff --git a/models/operations/getglobalhubs.go b/models/operations/getglobalhubs.go deleted file mode 100644 index e0ba9ca..0000000 --- a/models/operations/getglobalhubs.go +++ /dev/null @@ -1,373 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (g *GetGlobalHubsRequest) GetCount() *float64 { - if g == nil { - return nil - } - return g.Count -} - -func (g *GetGlobalHubsRequest) GetOnlyTransient() *OnlyTransient { - if g == nil { - return nil - } - return g.OnlyTransient -} - -type GetGlobalHubsMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - GUID *string `json:"guid,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - TitleSort *string `json:"titleSort,omitempty"` - Summary *string `json:"summary,omitempty"` - Smart *bool `json:"smart,omitempty"` - PlaylistType *string `json:"playlistType,omitempty"` - Composite *string `json:"composite,omitempty"` - Icon *string `json:"icon,omitempty"` - ViewCount *int `json:"viewCount,omitempty"` - LastViewedAt *int `json:"lastViewedAt,omitempty"` - Duration *int `json:"duration,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` -} - -func (g *GetGlobalHubsMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetGlobalHubsMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetGlobalHubsMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetGlobalHubsMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetGlobalHubsMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetGlobalHubsMetadata) GetTitleSort() *string { - if g == nil { - return nil - } - return g.TitleSort -} - -func (g *GetGlobalHubsMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetGlobalHubsMetadata) GetSmart() *bool { - if g == nil { - return nil - } - return g.Smart -} - -func (g *GetGlobalHubsMetadata) GetPlaylistType() *string { - if g == nil { - return nil - } - return g.PlaylistType -} - -func (g *GetGlobalHubsMetadata) GetComposite() *string { - if g == nil { - return nil - } - return g.Composite -} - -func (g *GetGlobalHubsMetadata) GetIcon() *string { - if g == nil { - return nil - } - return g.Icon -} - -func (g *GetGlobalHubsMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetGlobalHubsMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetGlobalHubsMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetGlobalHubsMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetGlobalHubsMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetGlobalHubsMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -type Hub struct { - HubKey *string `json:"hubKey,omitempty"` - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - HubIdentifier *string `json:"hubIdentifier,omitempty"` - Context *string `json:"context,omitempty"` - Size *int `json:"size,omitempty"` - More *bool `json:"more,omitempty"` - Style *string `json:"style,omitempty"` - Promoted *bool `json:"promoted,omitempty"` - Metadata []GetGlobalHubsMetadata `json:"Metadata,omitempty"` -} - -func (h *Hub) GetHubKey() *string { - if h == nil { - return nil - } - return h.HubKey -} - -func (h *Hub) GetKey() *string { - if h == nil { - return nil - } - return h.Key -} - -func (h *Hub) GetTitle() *string { - if h == nil { - return nil - } - return h.Title -} - -func (h *Hub) GetType() *string { - if h == nil { - return nil - } - return h.Type -} - -func (h *Hub) GetHubIdentifier() *string { - if h == nil { - return nil - } - return h.HubIdentifier -} - -func (h *Hub) GetContext() *string { - if h == nil { - return nil - } - return h.Context -} - -func (h *Hub) GetSize() *int { - if h == nil { - return nil - } - return h.Size -} - -func (h *Hub) GetMore() *bool { - if h == nil { - return nil - } - return h.More -} - -func (h *Hub) GetStyle() *string { - if h == nil { - return nil - } - return h.Style -} - -func (h *Hub) GetPromoted() *bool { - if h == nil { - return nil - } - return h.Promoted -} - -func (h *Hub) GetMetadata() []GetGlobalHubsMetadata { - if h == nil { - return nil - } - return h.Metadata -} - -type GetGlobalHubsMediaContainer struct { - Size *int `json:"size,omitempty"` - AllowSync *bool `json:"allowSync,omitempty"` - Identifier *string `json:"identifier,omitempty"` - Hub []Hub `json:"Hub,omitempty"` -} - -func (g *GetGlobalHubsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetGlobalHubsMediaContainer) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetGlobalHubsMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetGlobalHubsMediaContainer) GetHub() []Hub { - if g == nil { - return nil - } - return g.Hub -} - -// GetGlobalHubsResponseBody - returns global hubs -type GetGlobalHubsResponseBody struct { - MediaContainer *GetGlobalHubsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetGlobalHubsResponseBody) GetMediaContainer() *GetGlobalHubsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // returns global hubs - Object *GetGlobalHubsResponseBody -} - -func (g *GetGlobalHubsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetGlobalHubsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetGlobalHubsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetGlobalHubsResponse) GetObject() *GetGlobalHubsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/gethistoryitem.go b/models/operations/gethistoryitem.go new file mode 100644 index 0000000..d074e66 --- /dev/null +++ b/models/operations/gethistoryitem.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetHistoryItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetHistoryItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetHistoryItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetHistoryItemGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetHistoryItemGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetHistoryItemGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetHistoryItemGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetHistoryItemGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetHistoryItemGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetHistoryItemGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetHistoryItemGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetHistoryItemGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetHistoryItemGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetHistoryItemGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetHistoryItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the history item (the `historyKey` from above) + HistoryID int64 `pathParam:"style=simple,explode=false,name=historyId"` +} + +func (g GetHistoryItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetHistoryItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"historyId"}); err != nil { + return err + } + return nil +} + +func (g *GetHistoryItemRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetHistoryItemRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetHistoryItemRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetHistoryItemRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetHistoryItemRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetHistoryItemRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetHistoryItemRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetHistoryItemRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetHistoryItemRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetHistoryItemRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetHistoryItemRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetHistoryItemRequest) GetHistoryID() int64 { + if g == nil { + return 0 + } + return g.HistoryID +} + +type GetHistoryItemResponse 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 + // OK + HistoryAllGetResponses200 *components.HistoryAllGetResponses200 + Headers map[string][]string +} + +func (g *GetHistoryItemResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetHistoryItemResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetHistoryItemResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetHistoryItemResponse) GetHistoryAllGetResponses200() *components.HistoryAllGetResponses200 { + if g == nil { + return nil + } + return g.HistoryAllGetResponses200 +} + +func (g *GetHistoryItemResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/gethomedata.go b/models/operations/gethomedata.go deleted file mode 100644 index fffccb3..0000000 --- a/models/operations/gethomedata.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -// GetHomeDataResponseBody - Home Data -type GetHomeDataResponseBody struct { - ID *float64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - GuestUserID *float64 `json:"guestUserID,omitempty"` - GuestUserUUID *string `json:"guestUserUUID,omitempty"` - GuestEnabled *bool `json:"guestEnabled,omitempty"` - Subscription *bool `json:"subscription,omitempty"` -} - -func (g *GetHomeDataResponseBody) GetID() *float64 { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetHomeDataResponseBody) GetName() *string { - if g == nil { - return nil - } - return g.Name -} - -func (g *GetHomeDataResponseBody) GetGuestUserID() *float64 { - if g == nil { - return nil - } - return g.GuestUserID -} - -func (g *GetHomeDataResponseBody) GetGuestUserUUID() *string { - if g == nil { - return nil - } - return g.GuestUserUUID -} - -func (g *GetHomeDataResponseBody) GetGuestEnabled() *bool { - if g == nil { - return nil - } - return g.GuestEnabled -} - -func (g *GetHomeDataResponseBody) GetSubscription() *bool { - if g == nil { - return nil - } - return g.Subscription -} - -type GetHomeDataResponse 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 - // Home Data - Object *GetHomeDataResponseBody -} - -func (g *GetHomeDataResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetHomeDataResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetHomeDataResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetHomeDataResponse) GetObject() *GetHomeDataResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/gethubitems.go b/models/operations/gethubitems.go new file mode 100644 index 0000000..436b5ae --- /dev/null +++ b/models/operations/gethubitems.go @@ -0,0 +1,316 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetHubItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetHubItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetHubItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetHubItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetHubItemsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetHubItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetHubItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetHubItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetHubItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetHubItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetHubItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetHubItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetHubItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetHubItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetHubItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Limit results to count items + Count *int64 `queryParam:"style=form,explode=true,name=count"` + // If provided, limit to only specified hubs + Identifier []string `queryParam:"style=form,explode=true,name=identifier"` +} + +func (g GetHubItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetHubItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"identifier"}); err != nil { + return err + } + return nil +} + +func (g *GetHubItemsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetHubItemsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetHubItemsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetHubItemsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetHubItemsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetHubItemsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetHubItemsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetHubItemsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetHubItemsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetHubItemsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetHubItemsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetHubItemsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetHubItemsRequest) GetIdentifier() []string { + if g == nil { + return []string{} + } + return g.Identifier +} + +// GetHubItemsResponseBody - OK +type GetHubItemsResponseBody struct { + // `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. + // Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) + // The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. + // + MediaContainer *components.MediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetHubItemsResponseBody) GetMediaContainer() *components.MediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetHubItemsResponse 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 + // OK + Object *GetHubItemsResponseBody + Headers map[string][]string +} + +func (g *GetHubItemsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetHubItemsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetHubItemsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetHubItemsResponse) GetObject() *GetHubItemsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetHubItemsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getidentity.go b/models/operations/getidentity.go new file mode 100644 index 0000000..b3ac8e2 --- /dev/null +++ b/models/operations/getidentity.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetIdentityMediaContainer struct { + // Indicates whether this server has been claimed by a user + Claimed *bool `json:"claimed,omitempty"` + // A unique identifier of the computer + MachineIdentifier *string `json:"machineIdentifier,omitempty"` + Size *int64 `json:"size,omitempty"` + // The full version string of the PMS + Version *string `json:"version,omitempty"` +} + +func (g *GetIdentityMediaContainer) GetClaimed() *bool { + if g == nil { + return nil + } + return g.Claimed +} + +func (g *GetIdentityMediaContainer) GetMachineIdentifier() *string { + if g == nil { + return nil + } + return g.MachineIdentifier +} + +func (g *GetIdentityMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetIdentityMediaContainer) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +// GetIdentityResponseBody - OK +type GetIdentityResponseBody struct { + MediaContainer *GetIdentityMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetIdentityResponseBody) GetMediaContainer() *GetIdentityMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetIdentityResponse 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 + // OK + Object *GetIdentityResponseBody +} + +func (g *GetIdentityResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetIdentityResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetIdentityResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetIdentityResponse) GetObject() *GetIdentityResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getimage.go b/models/operations/getimage.go new file mode 100644 index 0000000..bfb1edc --- /dev/null +++ b/models/operations/getimage.go @@ -0,0 +1,339 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetImageGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetImageGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetImageGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetImageGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetImageGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetImageGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetImageGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetImageGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetImageGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetImageGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetImageGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetImageGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetImageGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetImageGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetImageRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The base color (hex) for the top left quadrant. + TopLeft *string `queryParam:"style=form,explode=true,name=topLeft"` + // The base color (hex) for the top right quadrant. + TopRight *string `queryParam:"style=form,explode=true,name=topRight"` + // The base color (hex) for the bottom right quadrant. + BottomRight *string `queryParam:"style=form,explode=true,name=bottomRight"` + // The base color (hex) for the bottom left quadrant. + BottomLeft *string `queryParam:"style=form,explode=true,name=bottomLeft"` + // Width in pixels for the image. + Width *int64 `queryParam:"style=form,explode=true,name=width"` + // Height in pixels for the image. + Height *int64 `queryParam:"style=form,explode=true,name=height"` + // Whether to add noise to the ouput image. Noise can reduce color banding with the gradients. Image sizes with noise will be larger. + Noise *components.BoolInt `queryParam:"style=form,explode=true,name=noise"` +} + +func (g GetImageRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetImageRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetImageRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetImageRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetImageRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetImageRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetImageRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetImageRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetImageRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetImageRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetImageRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetImageRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetImageRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetImageRequest) GetTopLeft() *string { + if g == nil { + return nil + } + return g.TopLeft +} + +func (g *GetImageRequest) GetTopRight() *string { + if g == nil { + return nil + } + return g.TopRight +} + +func (g *GetImageRequest) GetBottomRight() *string { + if g == nil { + return nil + } + return g.BottomRight +} + +func (g *GetImageRequest) GetBottomLeft() *string { + if g == nil { + return nil + } + return g.BottomLeft +} + +func (g *GetImageRequest) GetWidth() *int64 { + if g == nil { + return nil + } + return g.Width +} + +func (g *GetImageRequest) GetHeight() *int64 { + if g == nil { + return nil + } + return g.Height +} + +func (g *GetImageRequest) GetNoise() *components.BoolInt { + if g == nil { + return nil + } + return g.Noise +} + +type GetImageResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (g *GetImageResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetImageResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetImageResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetImageResponse) GetResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.ResponseStream +} diff --git a/models/operations/getimagefrombif.go b/models/operations/getimagefrombif.go new file mode 100644 index 0000000..dc587f7 --- /dev/null +++ b/models/operations/getimagefrombif.go @@ -0,0 +1,329 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetImageFromBifGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetImageFromBifGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetImageFromBifGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetImageFromBifGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetImageFromBifGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetImageFromBifGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetImageFromBifGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetImageFromBifGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetImageFromBifGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetImageFromBifGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetImageFromBifGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetImageFromBifGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetImageFromBifGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetImageFromBifGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +// PathParamIndex - The type of index to grab. +type PathParamIndex string + +const ( + PathParamIndexSd PathParamIndex = "sd" +) + +func (e PathParamIndex) ToPointer() *PathParamIndex { + return &e +} +func (e *PathParamIndex) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "sd": + *e = PathParamIndex(v) + return nil + default: + return fmt.Errorf("invalid value for PathParamIndex: %v", v) + } +} + +type GetImageFromBifRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The part id who's index is to be fetched + PartID int64 `pathParam:"style=simple,explode=false,name=partId"` + // The type of index to grab. + Index PathParamIndex `pathParam:"style=simple,explode=false,name=index"` + // The offset to seek in ms. + Offset int64 `pathParam:"style=simple,explode=false,name=offset"` +} + +func (g GetImageFromBifRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetImageFromBifRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"partId", "index", "offset"}); err != nil { + return err + } + return nil +} + +func (g *GetImageFromBifRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetImageFromBifRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetImageFromBifRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetImageFromBifRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetImageFromBifRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetImageFromBifRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetImageFromBifRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetImageFromBifRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetImageFromBifRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetImageFromBifRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetImageFromBifRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetImageFromBifRequest) GetPartID() int64 { + if g == nil { + return 0 + } + return g.PartID +} + +func (g *GetImageFromBifRequest) GetIndex() PathParamIndex { + if g == nil { + return PathParamIndex("") + } + return g.Index +} + +func (g *GetImageFromBifRequest) GetOffset() int64 { + if g == nil { + return 0 + } + return g.Offset +} + +type GetImageFromBifResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (g *GetImageFromBifResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetImageFromBifResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetImageFromBifResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetImageFromBifResponse) GetResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.ResponseStream +} diff --git a/models/operations/getitemartwork.go b/models/operations/getitemartwork.go new file mode 100644 index 0000000..352f6ad --- /dev/null +++ b/models/operations/getitemartwork.go @@ -0,0 +1,351 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetItemArtworkGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetItemArtworkGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetItemArtworkGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetItemArtworkGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetItemArtworkGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetItemArtworkGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetItemArtworkGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetItemArtworkGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetItemArtworkGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetItemArtworkGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetItemArtworkGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetItemArtworkGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetItemArtworkGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetItemArtworkGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetItemArtworkPathParamElement string + +const ( + GetItemArtworkPathParamElementThumb GetItemArtworkPathParamElement = "thumb" + GetItemArtworkPathParamElementArt GetItemArtworkPathParamElement = "art" + GetItemArtworkPathParamElementClearLogo GetItemArtworkPathParamElement = "clearLogo" + GetItemArtworkPathParamElementBanner GetItemArtworkPathParamElement = "banner" + GetItemArtworkPathParamElementPoster GetItemArtworkPathParamElement = "poster" + GetItemArtworkPathParamElementTheme GetItemArtworkPathParamElement = "theme" +) + +func (e GetItemArtworkPathParamElement) ToPointer() *GetItemArtworkPathParamElement { + return &e +} +func (e *GetItemArtworkPathParamElement) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "thumb": + fallthrough + case "art": + fallthrough + case "clearLogo": + fallthrough + case "banner": + fallthrough + case "poster": + fallthrough + case "theme": + *e = GetItemArtworkPathParamElement(v) + return nil + default: + return fmt.Errorf("invalid value for GetItemArtworkPathParamElement: %v", v) + } +} + +type GetItemArtworkRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Element GetItemArtworkPathParamElement `pathParam:"style=simple,explode=false,name=element"` + // A timestamp on the element used for cache management in the client + Timestamp int64 `pathParam:"style=simple,explode=false,name=timestamp"` +} + +func (g GetItemArtworkRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetItemArtworkRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids", "element", "timestamp"}); err != nil { + return err + } + return nil +} + +func (g *GetItemArtworkRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetItemArtworkRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetItemArtworkRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetItemArtworkRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetItemArtworkRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetItemArtworkRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetItemArtworkRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetItemArtworkRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetItemArtworkRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetItemArtworkRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetItemArtworkRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetItemArtworkRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +func (g *GetItemArtworkRequest) GetElement() GetItemArtworkPathParamElement { + if g == nil { + return GetItemArtworkPathParamElement("") + } + return g.Element +} + +func (g *GetItemArtworkRequest) GetTimestamp() int64 { + if g == nil { + return 0 + } + return g.Timestamp +} + +type GetItemArtworkResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredAudioMpeg3ResponseStream io.ReadCloser + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredImageJpegResponseStream io.ReadCloser +} + +func (g *GetItemArtworkResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetItemArtworkResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetItemArtworkResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetItemArtworkResponse) GetTwoHundredAudioMpeg3ResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.TwoHundredAudioMpeg3ResponseStream +} + +func (g *GetItemArtworkResponse) GetTwoHundredImageJpegResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.TwoHundredImageJpegResponseStream +} diff --git a/models/operations/getitemdecision.go b/models/operations/getitemdecision.go new file mode 100644 index 0000000..6ed14ce --- /dev/null +++ b/models/operations/getitemdecision.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetItemDecisionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetItemDecisionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetItemDecisionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetItemDecisionGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetItemDecisionGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetItemDecisionGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetItemDecisionGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetItemDecisionGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetItemDecisionGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetItemDecisionGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetItemDecisionGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetItemDecisionGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetItemDecisionGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetItemDecisionGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetItemDecisionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` + // The item ids + ItemID int64 `pathParam:"style=simple,explode=false,name=itemId"` +} + +func (g GetItemDecisionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetItemDecisionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"queueId", "itemId"}); err != nil { + return err + } + return nil +} + +func (g *GetItemDecisionRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetItemDecisionRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetItemDecisionRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetItemDecisionRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetItemDecisionRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetItemDecisionRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetItemDecisionRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetItemDecisionRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetItemDecisionRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetItemDecisionRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetItemDecisionRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetItemDecisionRequest) GetQueueID() int64 { + if g == nil { + return 0 + } + return g.QueueID +} + +func (g *GetItemDecisionRequest) GetItemID() int64 { + if g == nil { + return 0 + } + return g.ItemID +} + +type GetItemDecisionResponse 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 + // OK + MediaContainerWithDecision *components.MediaContainerWithDecision +} + +func (g *GetItemDecisionResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetItemDecisionResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetItemDecisionResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetItemDecisionResponse) GetMediaContainerWithDecision() *components.MediaContainerWithDecision { + if g == nil { + return nil + } + return g.MediaContainerWithDecision +} diff --git a/models/operations/getitemtree.go b/models/operations/getitemtree.go new file mode 100644 index 0000000..aadb870 --- /dev/null +++ b/models/operations/getitemtree.go @@ -0,0 +1,282 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetItemTreeGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetItemTreeGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetItemTreeGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetItemTreeGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetItemTreeGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetItemTreeGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetItemTreeGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetItemTreeGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetItemTreeGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetItemTreeGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetItemTreeGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetItemTreeGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetItemTreeGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetItemTreeGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetItemTreeRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (g GetItemTreeRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetItemTreeRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GetItemTreeRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetItemTreeRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetItemTreeRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetItemTreeRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetItemTreeRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetItemTreeRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetItemTreeRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetItemTreeRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetItemTreeRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetItemTreeRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetItemTreeRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetItemTreeRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +type GetItemTreeResponse 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 + // OK + MediaContainerWithNestedMetadata *components.MediaContainerWithNestedMetadata +} + +func (g *GetItemTreeResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetItemTreeResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetItemTreeResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetItemTreeResponse) GetMediaContainerWithNestedMetadata() *components.MediaContainerWithNestedMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithNestedMetadata +} diff --git a/models/operations/getlibrarydetails.go b/models/operations/getlibrarydetails.go index f83a0c4..d92cc5a 100644 --- a/models/operations/getlibrarydetails.go +++ b/models/operations/getlibrarydetails.go @@ -3,49 +3,151 @@ package operations import ( - "encoding/json" - "fmt" "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "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 +type GetLibraryDetailsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (e *IncludeDetails) UnmarshalJSON(data []byte) error { - var v int64 - if err := json.Unmarshal(data, &v); err != nil { + +func (g GetLibraryDetailsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLibraryDetailsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeDetails(v) + return nil +} + +func (g *GetLibraryDetailsGlobals) GetAccepts() *components.Accepts { + if g == nil { return nil - default: - return fmt.Errorf("invalid value for IncludeDetails: %v", v) } + return g.Accepts +} + +func (g *GetLibraryDetailsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLibraryDetailsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLibraryDetailsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLibraryDetailsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLibraryDetailsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLibraryDetailsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLibraryDetailsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLibraryDetailsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLibraryDetailsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLibraryDetailsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace } type GetLibraryDetailsRequest struct { - // 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"` - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section identifier + SectionID string `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 *components.BoolInt `queryParam:"style=form,explode=true,name=includeDetails"` } func (g GetLibraryDetailsRequest) MarshalJSON() ([]byte, error) { @@ -53,318 +155,129 @@ func (g GetLibraryDetailsRequest) MarshalJSON() ([]byte, error) { } func (g *GetLibraryDetailsRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionKey"}); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { return err } return nil } -func (g *GetLibraryDetailsRequest) GetIncludeDetails() *IncludeDetails { +func (g *GetLibraryDetailsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLibraryDetailsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLibraryDetailsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLibraryDetailsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLibraryDetailsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLibraryDetailsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLibraryDetailsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLibraryDetailsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLibraryDetailsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLibraryDetailsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLibraryDetailsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetLibraryDetailsRequest) GetSectionID() string { + if g == nil { + return "" + } + return g.SectionID +} + +func (g *GetLibraryDetailsRequest) GetIncludeDetails() *components.BoolInt { if g == nil { return nil } return g.IncludeDetails } -func (g *GetLibraryDetailsRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -type GetLibraryDetailsDirectory struct { - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` - Secondary *bool `json:"secondary,omitempty"` - Prompt *string `json:"prompt,omitempty"` - Search *bool `json:"search,omitempty"` -} - -func (g *GetLibraryDetailsDirectory) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryDetailsDirectory) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetLibraryDetailsDirectory) GetSecondary() *bool { - if g == nil { - return nil - } - return g.Secondary -} - -func (g *GetLibraryDetailsDirectory) GetPrompt() *string { - if g == nil { - return nil - } - return g.Prompt -} - -func (g *GetLibraryDetailsDirectory) GetSearch() *bool { - if g == nil { - return nil - } - return g.Search -} - -type GetLibraryDetailsFilter struct { - Filter *string `json:"filter,omitempty"` - FilterType *string `json:"filterType,omitempty"` - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` -} - -func (g *GetLibraryDetailsFilter) GetFilter() *string { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetLibraryDetailsFilter) GetFilterType() *string { - if g == nil { - return nil - } - return g.FilterType -} - -func (g *GetLibraryDetailsFilter) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryDetailsFilter) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetLibraryDetailsFilter) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -type GetLibraryDetailsSort struct { - Default *string `json:"default,omitempty"` - DefaultDirection *string `json:"defaultDirection,omitempty"` - DescKey *string `json:"descKey,omitempty"` - FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (g *GetLibraryDetailsSort) GetDefault() *string { - if g == nil { - return nil - } - return g.Default -} - -func (g *GetLibraryDetailsSort) GetDefaultDirection() *string { - if g == nil { - return nil - } - return g.DefaultDirection -} - -func (g *GetLibraryDetailsSort) GetDescKey() *string { - if g == nil { - return nil - } - return g.DescKey -} - -func (g *GetLibraryDetailsSort) GetFirstCharacterKey() *string { - if g == nil { - return nil - } - return g.FirstCharacterKey -} - -func (g *GetLibraryDetailsSort) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryDetailsSort) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -type GetLibraryDetailsField struct { - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - SubType *string `json:"subType,omitempty"` -} - -func (g *GetLibraryDetailsField) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryDetailsField) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetLibraryDetailsField) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryDetailsField) GetSubType() *string { - if g == nil { - return nil - } - return g.SubType -} - -type GetLibraryDetailsType struct { - Key *string `json:"key,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - Active *bool `json:"active,omitempty"` - Filter []GetLibraryDetailsFilter `json:"Filter,omitempty"` - Sort []GetLibraryDetailsSort `json:"Sort,omitempty"` - Field []GetLibraryDetailsField `json:"Field,omitempty"` -} - -func (g *GetLibraryDetailsType) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryDetailsType) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryDetailsType) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetLibraryDetailsType) GetActive() *bool { - if g == nil { - return nil - } - return g.Active -} - -func (g *GetLibraryDetailsType) GetFilter() []GetLibraryDetailsFilter { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetLibraryDetailsType) GetSort() []GetLibraryDetailsSort { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetLibraryDetailsType) GetField() []GetLibraryDetailsField { - if g == nil { - return nil - } - return g.Field -} - -type GetLibraryDetailsOperator struct { - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (g *GetLibraryDetailsOperator) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryDetailsOperator) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -type GetLibraryDetailsFieldType struct { - Type *string `json:"type,omitempty"` - Operator []GetLibraryDetailsOperator `json:"Operator,omitempty"` -} - -func (g *GetLibraryDetailsFieldType) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryDetailsFieldType) GetOperator() []GetLibraryDetailsOperator { - if g == nil { - return nil - } - return g.Operator -} - type GetLibraryDetailsMediaContainer struct { - Size *int `json:"size,omitempty"` - AllowSync *bool `json:"allowSync,omitempty"` - Art *string `json:"art,omitempty"` - Content *string `json:"content,omitempty"` - Identifier *string `json:"identifier,omitempty"` - LibrarySectionID *int `json:"librarySectionID,omitempty"` - MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` - MediaTagVersion *int `json:"mediaTagVersion,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Title1 *string `json:"title1,omitempty"` - ViewGroup *string `json:"viewGroup,omitempty"` - ViewMode *int `json:"viewMode,omitempty"` - Directory []GetLibraryDetailsDirectory `json:"Directory,omitempty"` - Type []GetLibraryDetailsType `json:"Type,omitempty"` - FieldType []GetLibraryDetailsFieldType `json:"FieldType,omitempty"` + // The 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": true` 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": true` which used to be used to allow clients to build search dialogs on the fly. + Content *string `json:"content,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Art *string `json:"art,omitempty"` + Directory []components.Metadata `json:"Directory,omitempty"` + Identifier *string `json:"identifier,omitempty"` + LibrarySectionID *int64 `json:"librarySectionID,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *int64 `json:"mediaTagVersion,omitempty"` + Size *int64 `json:"size,omitempty"` + SortAsc *bool `json:"sortAsc,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Title1 *string `json:"title1,omitempty"` + ViewGroup *string `json:"viewGroup,omitempty"` + ViewMode *int64 `json:"viewMode,omitempty"` } -func (g *GetLibraryDetailsMediaContainer) GetSize() *int { +func (g *GetLibraryDetailsMediaContainer) GetContent() *string { if g == nil { return nil } - return g.Size + return g.Content } func (g *GetLibraryDetailsMediaContainer) GetAllowSync() *bool { @@ -381,11 +294,11 @@ func (g *GetLibraryDetailsMediaContainer) GetArt() *string { return g.Art } -func (g *GetLibraryDetailsMediaContainer) GetContent() *string { +func (g *GetLibraryDetailsMediaContainer) GetDirectory() []components.Metadata { if g == nil { return nil } - return g.Content + return g.Directory } func (g *GetLibraryDetailsMediaContainer) GetIdentifier() *string { @@ -395,7 +308,7 @@ func (g *GetLibraryDetailsMediaContainer) GetIdentifier() *string { return g.Identifier } -func (g *GetLibraryDetailsMediaContainer) GetLibrarySectionID() *int { +func (g *GetLibraryDetailsMediaContainer) GetLibrarySectionID() *int64 { if g == nil { return nil } @@ -409,13 +322,27 @@ func (g *GetLibraryDetailsMediaContainer) GetMediaTagPrefix() *string { return g.MediaTagPrefix } -func (g *GetLibraryDetailsMediaContainer) GetMediaTagVersion() *int { +func (g *GetLibraryDetailsMediaContainer) GetMediaTagVersion() *int64 { if g == nil { return nil } return g.MediaTagVersion } +func (g *GetLibraryDetailsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetLibraryDetailsMediaContainer) GetSortAsc() *bool { + if g == nil { + return nil + } + return g.SortAsc +} + func (g *GetLibraryDetailsMediaContainer) GetThumb() *string { if g == nil { return nil @@ -437,35 +364,14 @@ func (g *GetLibraryDetailsMediaContainer) GetViewGroup() *string { return g.ViewGroup } -func (g *GetLibraryDetailsMediaContainer) GetViewMode() *int { +func (g *GetLibraryDetailsMediaContainer) GetViewMode() *int64 { if g == nil { return nil } return g.ViewMode } -func (g *GetLibraryDetailsMediaContainer) GetDirectory() []GetLibraryDetailsDirectory { - if g == nil { - return nil - } - return g.Directory -} - -func (g *GetLibraryDetailsMediaContainer) GetType() []GetLibraryDetailsType { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryDetailsMediaContainer) GetFieldType() []GetLibraryDetailsFieldType { - if g == nil { - return nil - } - return g.FieldType -} - -// GetLibraryDetailsResponseBody - The details of the library +// GetLibraryDetailsResponseBody - OK type GetLibraryDetailsResponseBody struct { MediaContainer *GetLibraryDetailsMediaContainer `json:"MediaContainer,omitempty"` } @@ -484,7 +390,7 @@ type GetLibraryDetailsResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response - // The details of the library + // OK Object *GetLibraryDetailsResponseBody } diff --git a/models/operations/getlibraryhubs.go b/models/operations/getlibraryhubs.go deleted file mode 100644 index 7158ab5..0000000 --- a/models/operations/getlibraryhubs.go +++ /dev/null @@ -1,840 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "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 (g *GetLibraryHubsRequest) GetSectionID() float64 { - if g == nil { - return 0.0 - } - return g.SectionID -} - -func (g *GetLibraryHubsRequest) GetCount() *float64 { - if g == nil { - return nil - } - return g.Count -} - -func (g *GetLibraryHubsRequest) GetOnlyTransient() *QueryParamOnlyTransient { - if g == nil { - return nil - } - return g.OnlyTransient -} - -type GetLibraryHubsPart struct { - ID *int `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Duration *int `json:"duration,omitempty"` - File *string `json:"file,omitempty"` - Size *int `json:"size,omitempty"` - AudioProfile *string `json:"audioProfile,omitempty"` - Container *string `json:"container,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` - VideoProfile *string `json:"videoProfile,omitempty"` -} - -func (g *GetLibraryHubsPart) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetLibraryHubsPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryHubsPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibraryHubsPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetLibraryHubsPart) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetLibraryHubsPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetLibraryHubsPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetLibraryHubsPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetLibraryHubsPart) GetOptimizedForStreaming() *bool { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetLibraryHubsPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -type GetLibraryHubsMedia struct { - ID *int `json:"id,omitempty"` - Duration *int `json:"duration,omitempty"` - Bitrate *int `json:"bitrate,omitempty"` - Width *int `json:"width,omitempty"` - Height *int `json:"height,omitempty"` - AspectRatio *float64 `json:"aspectRatio,omitempty"` - AudioChannels *int `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"` - OptimizedForStreaming *int `json:"optimizedForStreaming,omitempty"` - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - VideoProfile *string `json:"videoProfile,omitempty"` - Part []GetLibraryHubsPart `json:"Part,omitempty"` -} - -func (g *GetLibraryHubsMedia) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetLibraryHubsMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibraryHubsMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetLibraryHubsMedia) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetLibraryHubsMedia) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetLibraryHubsMedia) GetAspectRatio() *float64 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetLibraryHubsMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetLibraryHubsMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetLibraryHubsMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetLibraryHubsMedia) GetVideoResolution() *string { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetLibraryHubsMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetLibraryHubsMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetLibraryHubsMedia) GetOptimizedForStreaming() *int { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetLibraryHubsMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetLibraryHubsMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetLibraryHubsMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetLibraryHubsMedia) GetPart() []GetLibraryHubsPart { - if g == nil { - return nil - } - return g.Part -} - -type GetLibraryHubsGenre struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetLibraryHubsGenre) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetLibraryHubsCountry struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetLibraryHubsCountry) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetLibraryHubsDirector struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetLibraryHubsDirector) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetLibraryHubsRole struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetLibraryHubsRole) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetLibraryHubsWriter struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetLibraryHubsWriter) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetLibraryHubsMetadata struct { - RatingKey *string `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"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - LibrarySectionID *int `json:"librarySectionID,omitempty"` - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - ContentRating *string `json:"contentRating,omitempty"` - Summary *string `json:"summary,omitempty"` - Rating *float64 `json:"rating,omitempty"` - AudienceRating *float64 `json:"audienceRating,omitempty"` - ViewCount *int `json:"viewCount,omitempty"` - LastViewedAt *int `json:"lastViewedAt,omitempty"` - Year *int `json:"year,omitempty"` - Tagline *string `json:"tagline,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Art *string `json:"art,omitempty"` - Duration *int `json:"duration,omitempty"` - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` - RatingImage *string `json:"ratingImage,omitempty"` - Media []GetLibraryHubsMedia `json:"Media,omitempty"` - Genre []GetLibraryHubsGenre `json:"Genre,omitempty"` - Country []GetLibraryHubsCountry `json:"Country,omitempty"` - Director []GetLibraryHubsDirector `json:"Director,omitempty"` - Role []GetLibraryHubsRole `json:"Role,omitempty"` - Writer []GetLibraryHubsWriter `json:"Writer,omitempty"` - SkipCount *int `json:"skipCount,omitempty"` - ChapterSource *string `json:"chapterSource,omitempty"` -} - -func (g GetLibraryHubsMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibraryHubsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetLibraryHubsMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetLibraryHubsMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryHubsMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetLibraryHubsMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetLibraryHubsMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryHubsMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetLibraryHubsMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetLibraryHubsMetadata) GetLibrarySectionID() *int { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetLibraryHubsMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetLibraryHubsMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetLibraryHubsMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetLibraryHubsMetadata) GetRating() *float64 { - if g == nil { - return nil - } - return g.Rating -} - -func (g *GetLibraryHubsMetadata) GetAudienceRating() *float64 { - if g == nil { - return nil - } - return g.AudienceRating -} - -func (g *GetLibraryHubsMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetLibraryHubsMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetLibraryHubsMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetLibraryHubsMetadata) GetTagline() *string { - if g == nil { - return nil - } - return g.Tagline -} - -func (g *GetLibraryHubsMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetLibraryHubsMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetLibraryHubsMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibraryHubsMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetLibraryHubsMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetLibraryHubsMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetLibraryHubsMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetLibraryHubsMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetLibraryHubsMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetLibraryHubsMetadata) GetMedia() []GetLibraryHubsMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetLibraryHubsMetadata) GetGenre() []GetLibraryHubsGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetLibraryHubsMetadata) GetCountry() []GetLibraryHubsCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetLibraryHubsMetadata) GetDirector() []GetLibraryHubsDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetLibraryHubsMetadata) GetRole() []GetLibraryHubsRole { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetLibraryHubsMetadata) GetWriter() []GetLibraryHubsWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetLibraryHubsMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetLibraryHubsMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -type GetLibraryHubsHub struct { - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - HubIdentifier *string `json:"hubIdentifier,omitempty"` - Context *string `json:"context,omitempty"` - Size *int `json:"size,omitempty"` - More *bool `json:"more,omitempty"` - Style *string `json:"style,omitempty"` - HubKey *string `json:"hubKey,omitempty"` - Metadata []GetLibraryHubsMetadata `json:"Metadata,omitempty"` - Promoted *bool `json:"promoted,omitempty"` - Random *bool `json:"random,omitempty"` -} - -func (g *GetLibraryHubsHub) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryHubsHub) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetLibraryHubsHub) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryHubsHub) GetHubIdentifier() *string { - if g == nil { - return nil - } - return g.HubIdentifier -} - -func (g *GetLibraryHubsHub) GetContext() *string { - if g == nil { - return nil - } - return g.Context -} - -func (g *GetLibraryHubsHub) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetLibraryHubsHub) GetMore() *bool { - if g == nil { - return nil - } - return g.More -} - -func (g *GetLibraryHubsHub) GetStyle() *string { - if g == nil { - return nil - } - return g.Style -} - -func (g *GetLibraryHubsHub) GetHubKey() *string { - if g == nil { - return nil - } - return g.HubKey -} - -func (g *GetLibraryHubsHub) GetMetadata() []GetLibraryHubsMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -func (g *GetLibraryHubsHub) GetPromoted() *bool { - if g == nil { - return nil - } - return g.Promoted -} - -func (g *GetLibraryHubsHub) GetRandom() *bool { - if g == nil { - return nil - } - return g.Random -} - -type GetLibraryHubsMediaContainer struct { - Size *int `json:"size,omitempty"` - AllowSync *bool `json:"allowSync,omitempty"` - Identifier *string `json:"identifier,omitempty"` - LibrarySectionID *int `json:"librarySectionID,omitempty"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` - Hub []GetLibraryHubsHub `json:"Hub,omitempty"` -} - -func (g *GetLibraryHubsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetLibraryHubsMediaContainer) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetLibraryHubsMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetLibraryHubsMediaContainer) GetLibrarySectionID() *int { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetLibraryHubsMediaContainer) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetLibraryHubsMediaContainer) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetLibraryHubsMediaContainer) GetHub() []GetLibraryHubsHub { - if g == nil { - return nil - } - return g.Hub -} - -// GetLibraryHubsResponseBody - The hubs specific to the library -type GetLibraryHubsResponseBody struct { - MediaContainer *GetLibraryHubsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetLibraryHubsResponseBody) GetMediaContainer() *GetLibraryHubsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // The hubs specific to the library - Object *GetLibraryHubsResponseBody -} - -func (g *GetLibraryHubsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetLibraryHubsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetLibraryHubsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetLibraryHubsResponse) GetObject() *GetLibraryHubsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getlibraryitems.go b/models/operations/getlibraryitems.go index d68dac2..ef0596e 100644 --- a/models/operations/getlibraryitems.go +++ b/models/operations/getlibraryitems.go @@ -3,149 +3,149 @@ package operations import ( - "encoding/json" - "errors" - "fmt" "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -// Tag - A key representing a specific tag within the section. -type Tag string - -const ( - TagUnwatched Tag = "unwatched" - TagNewest Tag = "newest" - TagRecentlyAdded Tag = "recentlyAdded" - TagRecentlyViewed Tag = "recentlyViewed" - TagOnDeck Tag = "onDeck" - TagCollection Tag = "collection" - TagEdition Tag = "edition" - TagYear Tag = "year" - TagDecade Tag = "decade" - TagDirector Tag = "director" - TagContentRating Tag = "contentRating" - TagRating Tag = "rating" - TagResolution Tag = "resolution" - TagFirstCharacter Tag = "firstCharacter" - TagFolder Tag = "folder" - TagAlbums Tag = "albums" -) - -func (e Tag) ToPointer() *Tag { - return &e +type GetLibraryItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -// IncludeGuids - Adds the Guids object to the response -type IncludeGuids int - -const ( - IncludeGuidsDisable IncludeGuids = 0 - IncludeGuidsEnable IncludeGuids = 1 -) - -func (e IncludeGuids) ToPointer() *IncludeGuids { - return &e +func (g GetLibraryItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) } -func (e *IncludeGuids) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { + +func (g *GetLibraryItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeGuids(v) + return nil +} + +func (g *GetLibraryItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { return nil - default: - return fmt.Errorf("invalid value for IncludeGuids: %v", v) } + return g.Accepts } -// GetLibraryItemsQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetLibraryItemsQueryParamType int64 - -const ( - GetLibraryItemsQueryParamTypeMovie GetLibraryItemsQueryParamType = 1 - GetLibraryItemsQueryParamTypeTvShow GetLibraryItemsQueryParamType = 2 - GetLibraryItemsQueryParamTypeSeason GetLibraryItemsQueryParamType = 3 - GetLibraryItemsQueryParamTypeEpisode GetLibraryItemsQueryParamType = 4 - GetLibraryItemsQueryParamTypeArtist GetLibraryItemsQueryParamType = 5 - GetLibraryItemsQueryParamTypeAlbum GetLibraryItemsQueryParamType = 6 - GetLibraryItemsQueryParamTypeTrack GetLibraryItemsQueryParamType = 7 - GetLibraryItemsQueryParamTypePhotoAlbum GetLibraryItemsQueryParamType = 8 - GetLibraryItemsQueryParamTypePhoto GetLibraryItemsQueryParamType = 9 -) - -func (e GetLibraryItemsQueryParamType) ToPointer() *GetLibraryItemsQueryParamType { - return &e -} - -// GetLibraryItemsQueryParamIncludeMeta - Adds the Meta object to the response -type GetLibraryItemsQueryParamIncludeMeta int - -const ( - GetLibraryItemsQueryParamIncludeMetaDisable GetLibraryItemsQueryParamIncludeMeta = 0 - GetLibraryItemsQueryParamIncludeMetaEnable GetLibraryItemsQueryParamIncludeMeta = 1 -) - -func (e GetLibraryItemsQueryParamIncludeMeta) ToPointer() *GetLibraryItemsQueryParamIncludeMeta { - return &e -} -func (e *GetLibraryItemsQueryParamIncludeMeta) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetLibraryItemsQueryParamIncludeMeta(v) +func (g *GetLibraryItemsGlobals) GetClientIdentifier() *string { + if g == nil { return nil - default: - return fmt.Errorf("invalid value for GetLibraryItemsQueryParamIncludeMeta: %v", v) } + return g.ClientIdentifier +} + +func (g *GetLibraryItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLibraryItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLibraryItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLibraryItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLibraryItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLibraryItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLibraryItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLibraryItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLibraryItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace } type GetLibraryItemsRequest struct { - // A key representing a specific tag within the section. - Tag Tag `pathParam:"style=simple,explode=false,name=tag"` - // Adds the Guids object to the response - // - IncludeGuids *IncludeGuids `default:"0" queryParam:"style=form,explode=true,name=includeGuids"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetLibraryItemsQueryParamType `queryParam:"style=form,explode=true,name=type"` - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` - // Adds the Meta object to the response - // - IncludeMeta *GetLibraryItemsQueryParamIncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"` - // The index of the first item to return. If not specified, the first item will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 0 - // - XPlexContainerStart *int `default:"0" queryParam:"style=form,explode=true,name=X-Plex-Container-Start"` - // The number of items to return. If not specified, all items will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 50 - // - XPlexContainerSize *int `default:"50" queryParam:"style=form,explode=true,name=X-Plex-Container-Size"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` } func (g GetLibraryItemsRequest) MarshalJSON() ([]byte, error) { @@ -153,2399 +153,94 @@ func (g GetLibraryItemsRequest) MarshalJSON() ([]byte, error) { } func (g *GetLibraryItemsRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"tag", "type", "sectionKey"}); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil } -func (g *GetLibraryItemsRequest) GetTag() Tag { - if g == nil { - return Tag("") - } - return g.Tag -} - -func (g *GetLibraryItemsRequest) GetIncludeGuids() *IncludeGuids { - if g == nil { - return nil - } - return g.IncludeGuids -} - -func (g *GetLibraryItemsRequest) GetType() GetLibraryItemsQueryParamType { - if g == nil { - return GetLibraryItemsQueryParamType(0) - } - return g.Type -} - -func (g *GetLibraryItemsRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -func (g *GetLibraryItemsRequest) GetIncludeMeta() *GetLibraryItemsQueryParamIncludeMeta { - if g == nil { - return nil - } - return g.IncludeMeta -} - -func (g *GetLibraryItemsRequest) GetXPlexContainerStart() *int { - if g == nil { - return nil - } - return g.XPlexContainerStart -} - -func (g *GetLibraryItemsRequest) GetXPlexContainerSize() *int { - if g == nil { - return nil - } - return g.XPlexContainerSize -} - -// GetLibraryItemsType - The type of media content in the Plex library. This can represent videos, music, or photos. -type GetLibraryItemsType string - -const ( - GetLibraryItemsTypeMovie GetLibraryItemsType = "movie" - GetLibraryItemsTypeTvShow GetLibraryItemsType = "show" - GetLibraryItemsTypeSeason GetLibraryItemsType = "season" - GetLibraryItemsTypeEpisode GetLibraryItemsType = "episode" - GetLibraryItemsTypeArtist GetLibraryItemsType = "artist" - GetLibraryItemsTypeAlbum GetLibraryItemsType = "album" - GetLibraryItemsTypeTrack GetLibraryItemsType = "track" - GetLibraryItemsTypePhotoAlbum GetLibraryItemsType = "photoalbum" - GetLibraryItemsTypePhoto GetLibraryItemsType = "photo" - GetLibraryItemsTypeCollection GetLibraryItemsType = "collection" -) - -func (e GetLibraryItemsType) ToPointer() *GetLibraryItemsType { - return &e -} - -type GetLibraryItemsLibraryResponseType string - -const ( - GetLibraryItemsLibraryResponseTypeCoverPoster GetLibraryItemsLibraryResponseType = "coverPoster" - GetLibraryItemsLibraryResponseTypeBackground GetLibraryItemsLibraryResponseType = "background" - GetLibraryItemsLibraryResponseTypeSnapshot GetLibraryItemsLibraryResponseType = "snapshot" - GetLibraryItemsLibraryResponseTypeClearLogo GetLibraryItemsLibraryResponseType = "clearLogo" -) - -func (e GetLibraryItemsLibraryResponseType) ToPointer() *GetLibraryItemsLibraryResponseType { - return &e -} - -type GetLibraryItemsImage struct { - Alt string `json:"alt"` - Type GetLibraryItemsLibraryResponseType `json:"type"` - URL string `json:"url"` -} - -func (g *GetLibraryItemsImage) GetAlt() string { - if g == nil { - return "" - } - return g.Alt -} - -func (g *GetLibraryItemsImage) GetType() GetLibraryItemsLibraryResponseType { - if g == nil { - return GetLibraryItemsLibraryResponseType("") - } - return g.Type -} - -func (g *GetLibraryItemsImage) GetURL() string { - if g == nil { - return "" - } - return g.URL -} - -type GetLibraryItemsUltraBlurColors struct { - TopLeft string `json:"topLeft"` - TopRight string `json:"topRight"` - BottomRight string `json:"bottomRight"` - BottomLeft string `json:"bottomLeft"` -} - -func (g *GetLibraryItemsUltraBlurColors) GetTopLeft() string { - if g == nil { - return "" - } - return g.TopLeft -} - -func (g *GetLibraryItemsUltraBlurColors) GetTopRight() string { - if g == nil { - return "" - } - return g.TopRight -} - -func (g *GetLibraryItemsUltraBlurColors) GetBottomRight() string { - if g == nil { - return "" - } - return g.BottomRight -} - -func (g *GetLibraryItemsUltraBlurColors) GetBottomLeft() string { - if g == nil { - return "" - } - return g.BottomLeft -} - -type GetLibraryItemsGuids struct { - // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// - // - ID string `json:"id"` -} - -func (g *GetLibraryItemsGuids) GetID() string { - if g == nil { - return "" - } - return g.ID -} - -// ShowOrdering - Setting that indicates the episode ordering for the show. -// Options: -// - None = Library default -// - tmdbAiring = The Movie Database (Aired) -// - aired = TheTVDB (Aired) -// - dvd = TheTVDB (DVD) -// - absolute = TheTVDB (Absolute) -type ShowOrdering string - -const ( - ShowOrderingNone ShowOrdering = "None" - ShowOrderingTmdbAiring ShowOrdering = "tmdbAiring" - ShowOrderingTvdbAired ShowOrdering = "aired" - ShowOrderingTvdbDvd ShowOrdering = "dvd" - ShowOrderingTvdbAbsolute ShowOrdering = "absolute" -) - -func (e ShowOrdering) ToPointer() *ShowOrdering { - return &e -} - -// FlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). -type FlattenSeasons string - -const ( - FlattenSeasonsLibraryDefault FlattenSeasons = "-1" - FlattenSeasonsHide FlattenSeasons = "0" - FlattenSeasonsShow FlattenSeasons = "1" -) - -func (e FlattenSeasons) ToPointer() *FlattenSeasons { - return &e -} - -type OptimizedForStreaming1 int - -const ( - OptimizedForStreaming1Zero OptimizedForStreaming1 = 0 - OptimizedForStreaming1One OptimizedForStreaming1 = 1 -) - -func (e OptimizedForStreaming1) ToPointer() *OptimizedForStreaming1 { - return &e -} -func (e *OptimizedForStreaming1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = OptimizedForStreaming1(v) - return nil - default: - return fmt.Errorf("invalid value for OptimizedForStreaming1: %v", v) - } -} - -type GetLibraryItemsOptimizedForStreamingType string - -const ( - GetLibraryItemsOptimizedForStreamingTypeOptimizedForStreaming1 GetLibraryItemsOptimizedForStreamingType = "optimizedForStreaming_1" - GetLibraryItemsOptimizedForStreamingTypeBoolean GetLibraryItemsOptimizedForStreamingType = "boolean" -) - -// GetLibraryItemsOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetLibraryItemsOptimizedForStreaming struct { - OptimizedForStreaming1 *OptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetLibraryItemsOptimizedForStreamingType -} - -func CreateGetLibraryItemsOptimizedForStreamingOptimizedForStreaming1(optimizedForStreaming1 OptimizedForStreaming1) GetLibraryItemsOptimizedForStreaming { - typ := GetLibraryItemsOptimizedForStreamingTypeOptimizedForStreaming1 - - return GetLibraryItemsOptimizedForStreaming{ - OptimizedForStreaming1: &optimizedForStreaming1, - Type: typ, - } -} - -func CreateGetLibraryItemsOptimizedForStreamingBoolean(boolean bool) GetLibraryItemsOptimizedForStreaming { - typ := GetLibraryItemsOptimizedForStreamingTypeBoolean - - return GetLibraryItemsOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetLibraryItemsOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var optimizedForStreaming1 OptimizedForStreaming1 = OptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &optimizedForStreaming1, "", true, nil); err == nil { - u.OptimizedForStreaming1 = &optimizedForStreaming1 - u.Type = GetLibraryItemsOptimizedForStreamingTypeOptimizedForStreaming1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetLibraryItemsOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetLibraryItemsOptimizedForStreaming", string(data)) -} - -func (u GetLibraryItemsOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.OptimizedForStreaming1 != nil { - return utils.MarshalJSON(u.OptimizedForStreaming1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetLibraryItemsOptimizedForStreaming: all fields are null") -} - -type GetLibraryItemsOptimizedForStreaming1 int - -const ( - GetLibraryItemsOptimizedForStreaming1Zero GetLibraryItemsOptimizedForStreaming1 = 0 - GetLibraryItemsOptimizedForStreaming1One GetLibraryItemsOptimizedForStreaming1 = 1 -) - -func (e GetLibraryItemsOptimizedForStreaming1) ToPointer() *GetLibraryItemsOptimizedForStreaming1 { - return &e -} -func (e *GetLibraryItemsOptimizedForStreaming1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetLibraryItemsOptimizedForStreaming1(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibraryItemsOptimizedForStreaming1: %v", v) - } -} - -type GetLibraryItemsLibraryOptimizedForStreamingType string - -const ( - GetLibraryItemsLibraryOptimizedForStreamingTypeGetLibraryItemsOptimizedForStreaming1 GetLibraryItemsLibraryOptimizedForStreamingType = "get-library-items_optimizedForStreaming_1" - GetLibraryItemsLibraryOptimizedForStreamingTypeBoolean GetLibraryItemsLibraryOptimizedForStreamingType = "boolean" -) - -// GetLibraryItemsLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetLibraryItemsLibraryOptimizedForStreaming struct { - GetLibraryItemsOptimizedForStreaming1 *GetLibraryItemsOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetLibraryItemsLibraryOptimizedForStreamingType -} - -func CreateGetLibraryItemsLibraryOptimizedForStreamingGetLibraryItemsOptimizedForStreaming1(getLibraryItemsOptimizedForStreaming1 GetLibraryItemsOptimizedForStreaming1) GetLibraryItemsLibraryOptimizedForStreaming { - typ := GetLibraryItemsLibraryOptimizedForStreamingTypeGetLibraryItemsOptimizedForStreaming1 - - return GetLibraryItemsLibraryOptimizedForStreaming{ - GetLibraryItemsOptimizedForStreaming1: &getLibraryItemsOptimizedForStreaming1, - Type: typ, - } -} - -func CreateGetLibraryItemsLibraryOptimizedForStreamingBoolean(boolean bool) GetLibraryItemsLibraryOptimizedForStreaming { - typ := GetLibraryItemsLibraryOptimizedForStreamingTypeBoolean - - return GetLibraryItemsLibraryOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetLibraryItemsLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getLibraryItemsOptimizedForStreaming1 GetLibraryItemsOptimizedForStreaming1 = GetLibraryItemsOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getLibraryItemsOptimizedForStreaming1, "", true, nil); err == nil { - u.GetLibraryItemsOptimizedForStreaming1 = &getLibraryItemsOptimizedForStreaming1 - u.Type = GetLibraryItemsLibraryOptimizedForStreamingTypeGetLibraryItemsOptimizedForStreaming1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetLibraryItemsLibraryOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetLibraryItemsLibraryOptimizedForStreaming", string(data)) -} - -func (u GetLibraryItemsLibraryOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetLibraryItemsOptimizedForStreaming1 != nil { - return utils.MarshalJSON(u.GetLibraryItemsOptimizedForStreaming1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetLibraryItemsLibraryOptimizedForStreaming: all fields are null") -} - -// GetLibraryItemsHasThumbnail - Indicates if the part has a thumbnail. -type GetLibraryItemsHasThumbnail string - -const ( - GetLibraryItemsHasThumbnailFalse GetLibraryItemsHasThumbnail = "0" - GetLibraryItemsHasThumbnailTrue GetLibraryItemsHasThumbnail = "1" -) - -func (e GetLibraryItemsHasThumbnail) ToPointer() *GetLibraryItemsHasThumbnail { - return &e -} -func (e *GetLibraryItemsHasThumbnail) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "0": - fallthrough - case "1": - *e = GetLibraryItemsHasThumbnail(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibraryItemsHasThumbnail: %v", v) - } -} - -type GetLibraryItemsPart struct { - // Indicates if the part is accessible. - Accessible *bool `json:"accessible,omitempty"` - // Indicates if the part exists. - Exists *bool `json:"exists,omitempty"` - // Unique part identifier. - ID int64 `json:"id"` - // Key to access this part. - Key *string `json:"key,omitempty"` - Indexes *string `json:"indexes,omitempty"` - // Duration of the part in milliseconds. - Duration *int `json:"duration,omitempty"` - // File path for the part. - File *string `json:"file,omitempty"` - // File size in bytes. - Size *int64 `json:"size,omitempty"` - PacketLength *int `json:"packetLength,omitempty"` - // Container format of the part. - Container *string `json:"container,omitempty"` - // Video profile for the part. - VideoProfile *string `json:"videoProfile,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - // - OptimizedForStreaming *GetLibraryItemsLibraryOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - HasThumbnail *GetLibraryItemsHasThumbnail `default:"0" json:"hasThumbnail"` -} - -func (g GetLibraryItemsPart) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibraryItemsPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id"}); err != nil { - return err - } - return nil -} - -func (g *GetLibraryItemsPart) GetAccessible() *bool { - if g == nil { - return nil - } - return g.Accessible -} - -func (g *GetLibraryItemsPart) GetExists() *bool { - if g == nil { - return nil - } - return g.Exists -} - -func (g *GetLibraryItemsPart) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibraryItemsPart) GetIndexes() *string { - if g == nil { - return nil - } - return g.Indexes -} - -func (g *GetLibraryItemsPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibraryItemsPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetLibraryItemsPart) GetSize() *int64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetLibraryItemsPart) GetPacketLength() *int { - if g == nil { - return nil - } - return g.PacketLength -} - -func (g *GetLibraryItemsPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetLibraryItemsPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetLibraryItemsPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetLibraryItemsPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetLibraryItemsPart) GetOptimizedForStreaming() *GetLibraryItemsLibraryOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetLibraryItemsPart) GetHasThumbnail() *GetLibraryItemsHasThumbnail { - if g == nil { - return nil - } - return g.HasThumbnail -} - -type GetLibraryItemsMedia struct { - // Unique media identifier. - ID int64 `json:"id"` - // Duration of the media in milliseconds. - Duration *int `json:"duration,omitempty"` - // Bitrate in bits per second. - Bitrate *int `json:"bitrate,omitempty"` - // Video width in pixels. - Width *int `json:"width,omitempty"` - // Video height in pixels. - Height *int `json:"height,omitempty"` - // Aspect ratio of the video. - AspectRatio *float32 `json:"aspectRatio,omitempty"` - // Number of audio channels. - AudioChannels *int `json:"audioChannels,omitempty"` - DisplayOffset *int `json:"displayOffset,omitempty"` - // Audio codec used. - AudioCodec *string `json:"audioCodec,omitempty"` - // Video codec used. - VideoCodec *string `json:"videoCodec,omitempty"` - // Video resolution (e.g., 4k). - VideoResolution *string `json:"videoResolution,omitempty"` - // Container format of the media. - Container *string `json:"container,omitempty"` - // Frame rate of the video. Values found include NTSC, PAL, 24p - // - VideoFrameRate *string `json:"videoFrameRate,omitempty"` - // Video profile (e.g., main 10). - VideoProfile *string `json:"videoProfile,omitempty"` - // Indicates whether voice activity is detected. - HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *GetLibraryItemsOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - // Indicates whether the media has 64-bit offsets. - // This is relevant for media files that may require larger offsets than what 32-bit integers can provide. - // - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - Part []GetLibraryItemsPart `json:"Part,omitempty"` -} - -func (g *GetLibraryItemsMedia) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibraryItemsMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetLibraryItemsMedia) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetLibraryItemsMedia) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetLibraryItemsMedia) GetAspectRatio() *float32 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetLibraryItemsMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetLibraryItemsMedia) GetDisplayOffset() *int { - if g == nil { - return nil - } - return g.DisplayOffset -} - -func (g *GetLibraryItemsMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetLibraryItemsMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetLibraryItemsMedia) GetVideoResolution() *string { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetLibraryItemsMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetLibraryItemsMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetLibraryItemsMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetLibraryItemsMedia) GetHasVoiceActivity() *bool { - if g == nil { - return nil - } - return g.HasVoiceActivity -} - -func (g *GetLibraryItemsMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetLibraryItemsMedia) GetOptimizedForStreaming() *GetLibraryItemsOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetLibraryItemsMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetLibraryItemsMedia) GetPart() []GetLibraryItemsPart { - if g == nil { - return nil - } - return g.Part -} - -type GetLibraryItemsGenre struct { - // The unique identifier for the genre. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The genre name of this media-item - // - Tag string `json:"tag"` -} - -func (g *GetLibraryItemsGenre) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsGenre) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibraryItemsCountry struct { - // The unique identifier for the country. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The country of origin of this media item - Tag string `json:"tag"` -} - -func (g *GetLibraryItemsCountry) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsCountry) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibraryItemsDirector struct { - // Unique identifier for the director. - ID int `json:"id"` - // The role of Director - Tag string `json:"tag"` - // The absolute URL of the thumbnail image for the director. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetLibraryItemsDirector) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsDirector) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetLibraryItemsDirector) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetLibraryItemsWriter struct { - // Unique identifier for the writer. - ID int `json:"id"` - // The role of Writer - Tag string `json:"tag"` - // The absolute URL of the thumbnail image for the writer. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetLibraryItemsWriter) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsWriter) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetLibraryItemsWriter) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetLibraryItemsProducer struct { - // The unique role identifier. - ID int64 `json:"id"` - // The filter string for the role. - Filter string `json:"filter"` - // The actor's name. - Tag string `json:"tag"` - // A key associated with the actor tag. - TagKey string `json:"tagKey"` - // The character name or role. - Role *string `json:"role,omitempty"` - // URL for the role thumbnail image. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetLibraryItemsProducer) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsProducer) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetLibraryItemsProducer) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetLibraryItemsProducer) GetTagKey() string { - if g == nil { - return "" - } - return g.TagKey -} - -func (g *GetLibraryItemsProducer) GetRole() *string { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetLibraryItemsProducer) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetLibraryItemsCollection struct { - // The user-made collection this media item belongs to - Tag string `json:"tag"` -} - -func (g *GetLibraryItemsCollection) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibraryItemsRole struct { - // The unique identifier for the role. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The display tag for the actor (typically the actor's name). - Tag string `json:"tag"` - // The role played by the actor in the media item. - Role *string `json:"role,omitempty"` - // The absolute URL of the thumbnail image for the actor. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetLibraryItemsRole) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsRole) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetLibraryItemsRole) GetRole() *string { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetLibraryItemsRole) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type Ratings struct { - // The image or reference for the rating. - Image string `json:"image"` - // The rating value. - Value float32 `json:"value"` - // The type of rating (e.g., audience, critic). - Type string `json:"type"` -} - -func (r *Ratings) GetImage() string { - if r == nil { - return "" - } - return r.Image -} - -func (r *Ratings) GetValue() float32 { - if r == nil { - return 0.0 - } - return r.Value -} - -func (r *Ratings) GetType() string { - if r == nil { - return "" - } - return r.Type -} - -type GetLibraryItemsSimilar struct { - // The unique similar item identifier. - ID int64 `json:"id"` - // The filter string for similar items. - Filter string `json:"filter"` - // The tag or title of the similar content. - Tag string `json:"tag"` -} - -func (g *GetLibraryItemsSimilar) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibraryItemsSimilar) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetLibraryItemsSimilar) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -// GetLibraryItemsLocation - The folder path for the media item. -type GetLibraryItemsLocation struct { - Path string `json:"path"` -} - -func (g *GetLibraryItemsLocation) GetPath() string { - if g == nil { - return "" - } - return g.Path -} - -// Chapter - The thumbnail for the chapter -type Chapter struct { - ID int64 `json:"id"` - Filter string `json:"filter"` - Index int64 `json:"index"` - StartTimeOffset int64 `json:"startTimeOffset"` - EndTimeOffset int64 `json:"endTimeOffset"` - Thumb string `json:"thumb"` -} - -func (c *Chapter) GetID() int64 { - if c == nil { - return 0 - } - return c.ID -} - -func (c *Chapter) GetFilter() string { - if c == nil { - return "" - } - return c.Filter -} - -func (c *Chapter) GetIndex() int64 { - if c == nil { - return 0 - } - return c.Index -} - -func (c *Chapter) GetStartTimeOffset() int64 { - if c == nil { - return 0 - } - return c.StartTimeOffset -} - -func (c *Chapter) GetEndTimeOffset() int64 { - if c == nil { - return 0 - } - return c.EndTimeOffset -} - -func (c *Chapter) GetThumb() string { - if c == nil { - return "" - } - return c.Thumb -} - -// Attributes associated with the marker. -type Attributes struct { - // The identifier for the attributes. - ID int64 `json:"id"` - // The version number of the marker attributes. - Version *int64 `json:"version,omitempty"` -} - -func (a *Attributes) GetID() int64 { - if a == nil { - return 0 - } - return a.ID -} - -func (a *Attributes) GetVersion() *int64 { - if a == nil { - return nil - } - return a.Version -} - -// Marker - The final status of the marker -type Marker struct { - ID int64 `json:"id"` - Type string `json:"type"` - StartTimeOffset int64 `json:"startTimeOffset"` - EndTimeOffset int64 `json:"endTimeOffset"` - Final *bool `json:"final,omitempty"` - // Attributes associated with the marker. - Attributes *Attributes `json:"Attributes,omitempty"` -} - -func (m *Marker) GetID() int64 { - if m == nil { - return 0 - } - return m.ID -} - -func (m *Marker) GetType() string { - if m == nil { - return "" - } - return m.Type -} - -func (m *Marker) GetStartTimeOffset() int64 { - if m == nil { - return 0 - } - return m.StartTimeOffset -} - -func (m *Marker) GetEndTimeOffset() int64 { - if m == nil { - return 0 - } - return m.EndTimeOffset -} - -func (m *Marker) GetFinal() *bool { - if m == nil { - return nil - } - return m.Final -} - -func (m *Marker) GetAttributes() *Attributes { - if m == nil { - return nil - } - return m.Attributes -} - -type Extras struct { - // The size of the extras. - Size *int64 `json:"size,omitempty"` -} - -func (e *Extras) GetSize() *int64 { - if e == nil { - return nil - } - return e.Size -} - -// GetLibraryItemsMetadata - Unknown -type GetLibraryItemsMetadata struct { - // The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. - RatingKey string `json:"ratingKey"` - // The unique key for the media item. - Key string `json:"key"` - // The globally unique identifier for the media item. - GUID string `json:"guid"` - // A URL‐friendly version of the media title. - Slug string `json:"slug"` - // The studio that produced the media item. - Studio *string `json:"studio,omitempty"` - Type GetLibraryItemsType `json:"type"` - // The title of the media item. - Title string `json:"title"` - // The banner image URL for the media item. - Banner string `json:"banner"` - // The sort title used for ordering media items. - TitleSort string `json:"titleSort"` - // The content rating for the media item. - ContentRating *string `json:"contentRating,omitempty"` - // A synopsis of the media item. - Summary string `json:"summary"` - // The critic rating for the media item. - Rating float32 `json:"rating"` - // The audience rating for the media item. - AudienceRating float64 `json:"audienceRating"` - // The release year of the media item. - Year *int `json:"year,omitempty"` - // A brief tagline for the media item. - Tagline string `json:"tagline"` - // The thumbnail image URL for the media item. - Thumb string `json:"thumb"` - // The art image URL for the media item. - Art string `json:"art"` - // The theme URL for the media item. - Theme string `json:"theme"` - // The index position of the media item. - Index int `json:"index"` - // The number of leaf items (end nodes) under this media item. - LeafCount *int `json:"leafCount,omitempty"` - // The number of leaf items that have been viewed. - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - // The number of child items associated with this media item. - ChildCount int `json:"childCount"` - // The total number of seasons (for TV shows). - SeasonCount int `json:"seasonCount"` - // The duration of the media item in milliseconds. - Duration int `json:"duration"` - // The original release date of the media item. - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - AddedAt int64 `json:"addedAt"` - // Unix epoch datetime in seconds - UpdatedAt *int64 `json:"updatedAt,omitempty"` - // The URL for the audience rating image. - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - // The source from which chapter data is derived. - ChapterSource *string `json:"chapterSource,omitempty"` - // The primary extra key associated with this media item. - PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` - // The original title of the media item (if different). - OriginalTitle *string `json:"originalTitle,omitempty"` - // The rating key of the parent media item. - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - // The rating key of the grandparent media item. - GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` - // The GUID of the parent media item. - ParentGUID *string `json:"parentGuid,omitempty"` - // The GUID of the grandparent media item. - GrandparentGUID *string `json:"grandparentGuid,omitempty"` - // The slug for the grandparent media item. - GrandparentSlug *string `json:"grandparentSlug,omitempty"` - // The key of the grandparent media item. - GrandparentKey *string `json:"grandparentKey,omitempty"` - // The key of the parent media item. - ParentKey *string `json:"parentKey,omitempty"` - // The title of the grandparent media item. - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - // The thumbnail URL for the grandparent media item. - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - // The theme URL for the grandparent media item. - GrandparentTheme *string `json:"grandparentTheme,omitempty"` - // The art URL for the grandparent media item. - GrandparentArt *string `json:"grandparentArt,omitempty"` - // The title of the parent media item. - ParentTitle *string `json:"parentTitle,omitempty"` - // The index position of the parent media item. - ParentIndex *int `json:"parentIndex,omitempty"` - // The thumbnail URL for the parent media item. - ParentThumb *string `json:"parentThumb,omitempty"` - // The URL for the rating image. - RatingImage *string `json:"ratingImage,omitempty"` - // The number of times this media item has been viewed. - ViewCount *int `json:"viewCount,omitempty"` - // The current playback offset (in milliseconds). - ViewOffset *int `json:"viewOffset,omitempty"` - // The number of times this media item has been skipped. - SkipCount *int `json:"skipCount,omitempty"` - // A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. - Subtype *string `json:"subtype,omitempty"` - // The Unix timestamp representing the last time the item was rated. - LastRatedAt *int64 `json:"lastRatedAt,omitempty"` - // The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). - CreatedAtAccuracy *string `json:"createdAtAccuracy,omitempty"` - // The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. - CreatedAtTZOffset *string `json:"createdAtTZOffset,omitempty"` - // Unix timestamp for when the media item was last viewed. - LastViewedAt *int `json:"lastViewedAt,omitempty"` - // The rating provided by a user for the item. This value is expressed as a decimal number. - UserRating *float32 `json:"userRating,omitempty"` - Image []GetLibraryItemsImage `json:"Image,omitempty"` - UltraBlurColors *GetLibraryItemsUltraBlurColors `json:"UltraBlurColors,omitempty"` - Guids []GetLibraryItemsGuids `json:"Guid,omitempty"` - // The identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The key corresponding to the library section. - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - // Setting that indicates the episode ordering for the show. - // Options: - // - None = Library default - // - tmdbAiring = The Movie Database (Aired) - // - aired = TheTVDB (Aired) - // - dvd = TheTVDB (DVD) - // - absolute = TheTVDB (Absolute) - // - ShowOrdering *ShowOrdering `json:"showOrdering,omitempty"` - // Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). - // - FlattenSeasons *FlattenSeasons `json:"flattenSeasons,omitempty"` - // Indicates whether child items should be skipped. - SkipChildren *bool `json:"skipChildren,omitempty"` - Media []GetLibraryItemsMedia `json:"Media,omitempty"` - Genre []GetLibraryItemsGenre `json:"Genre,omitempty"` - Country []GetLibraryItemsCountry `json:"Country,omitempty"` - Director []GetLibraryItemsDirector `json:"Director,omitempty"` - Writer []GetLibraryItemsWriter `json:"Writer,omitempty"` - Producer []GetLibraryItemsProducer `json:"Producer,omitempty"` - Collection []GetLibraryItemsCollection `json:"Collection,omitempty"` - Role []GetLibraryItemsRole `json:"Role,omitempty"` - Ratings []Ratings `json:"Rating,omitempty"` - Similar []GetLibraryItemsSimilar `json:"Similar,omitempty"` - Location []GetLibraryItemsLocation `json:"Location,omitempty"` - Chapter []Chapter `json:"Chapter,omitempty"` - Marker []Marker `json:"Marker,omitempty"` - Extras *Extras `json:"Extras,omitempty"` -} - -func (g GetLibraryItemsMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibraryItemsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "banner", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { - return err - } - return nil -} - -func (g *GetLibraryItemsMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetLibraryItemsMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibraryItemsMetadata) GetGUID() string { - if g == nil { - return "" - } - return g.GUID -} - -func (g *GetLibraryItemsMetadata) GetSlug() string { - if g == nil { - return "" - } - return g.Slug -} - -func (g *GetLibraryItemsMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetLibraryItemsMetadata) GetType() GetLibraryItemsType { - if g == nil { - return GetLibraryItemsType("") - } - return g.Type -} - -func (g *GetLibraryItemsMetadata) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibraryItemsMetadata) GetBanner() string { - if g == nil { - return "" - } - return g.Banner -} - -func (g *GetLibraryItemsMetadata) GetTitleSort() string { - if g == nil { - return "" - } - return g.TitleSort -} - -func (g *GetLibraryItemsMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetLibraryItemsMetadata) GetSummary() string { - if g == nil { - return "" - } - return g.Summary -} - -func (g *GetLibraryItemsMetadata) GetRating() float32 { - if g == nil { - return 0.0 - } - return g.Rating -} - -func (g *GetLibraryItemsMetadata) GetAudienceRating() float64 { - if g == nil { - return 0.0 - } - return g.AudienceRating -} - -func (g *GetLibraryItemsMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetLibraryItemsMetadata) GetTagline() string { - if g == nil { - return "" - } - return g.Tagline -} - -func (g *GetLibraryItemsMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetLibraryItemsMetadata) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetLibraryItemsMetadata) GetTheme() string { - if g == nil { - return "" - } - return g.Theme -} - -func (g *GetLibraryItemsMetadata) GetIndex() int { - if g == nil { - return 0 - } - return g.Index -} - -func (g *GetLibraryItemsMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetLibraryItemsMetadata) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetLibraryItemsMetadata) GetChildCount() int { - if g == nil { - return 0 - } - return g.ChildCount -} - -func (g *GetLibraryItemsMetadata) GetSeasonCount() int { - if g == nil { - return 0 - } - return g.SeasonCount -} - -func (g *GetLibraryItemsMetadata) GetDuration() int { - if g == nil { - return 0 - } - return g.Duration -} - -func (g *GetLibraryItemsMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetLibraryItemsMetadata) GetAddedAt() int64 { - if g == nil { - return 0 - } - return g.AddedAt -} - -func (g *GetLibraryItemsMetadata) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetLibraryItemsMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetLibraryItemsMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetLibraryItemsMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetLibraryItemsMetadata) GetOriginalTitle() *string { - if g == nil { - return nil - } - return g.OriginalTitle -} - -func (g *GetLibraryItemsMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetLibraryItemsMetadata) GetGrandparentRatingKey() *string { - if g == nil { - return nil - } - return g.GrandparentRatingKey -} - -func (g *GetLibraryItemsMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetLibraryItemsMetadata) GetGrandparentGUID() *string { - if g == nil { - return nil - } - return g.GrandparentGUID -} - -func (g *GetLibraryItemsMetadata) GetGrandparentSlug() *string { - if g == nil { - return nil - } - return g.GrandparentSlug -} - -func (g *GetLibraryItemsMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetLibraryItemsMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetLibraryItemsMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetLibraryItemsMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetLibraryItemsMetadata) GetGrandparentTheme() *string { - if g == nil { - return nil - } - return g.GrandparentTheme -} - -func (g *GetLibraryItemsMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetLibraryItemsMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetLibraryItemsMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetLibraryItemsMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetLibraryItemsMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetLibraryItemsMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetLibraryItemsMetadata) GetViewOffset() *int { - if g == nil { - return nil - } - return g.ViewOffset -} - -func (g *GetLibraryItemsMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetLibraryItemsMetadata) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetLibraryItemsMetadata) GetLastRatedAt() *int64 { - if g == nil { - return nil - } - return g.LastRatedAt -} - -func (g *GetLibraryItemsMetadata) GetCreatedAtAccuracy() *string { - if g == nil { - return nil - } - return g.CreatedAtAccuracy -} - -func (g *GetLibraryItemsMetadata) GetCreatedAtTZOffset() *string { - if g == nil { - return nil - } - return g.CreatedAtTZOffset -} - -func (g *GetLibraryItemsMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetLibraryItemsMetadata) GetUserRating() *float32 { - if g == nil { - return nil - } - return g.UserRating -} - -func (g *GetLibraryItemsMetadata) GetImage() []GetLibraryItemsImage { - if g == nil { - return nil - } - return g.Image -} - -func (g *GetLibraryItemsMetadata) GetUltraBlurColors() *GetLibraryItemsUltraBlurColors { - if g == nil { - return nil - } - return g.UltraBlurColors -} - -func (g *GetLibraryItemsMetadata) GetGuids() []GetLibraryItemsGuids { - if g == nil { - return nil - } - return g.Guids -} - -func (g *GetLibraryItemsMetadata) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetLibraryItemsMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetLibraryItemsMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetLibraryItemsMetadata) GetShowOrdering() *ShowOrdering { - if g == nil { - return nil - } - return g.ShowOrdering -} - -func (g *GetLibraryItemsMetadata) GetFlattenSeasons() *FlattenSeasons { - if g == nil { - return nil - } - return g.FlattenSeasons -} - -func (g *GetLibraryItemsMetadata) GetSkipChildren() *bool { - if g == nil { - return nil - } - return g.SkipChildren -} - -func (g *GetLibraryItemsMetadata) GetMedia() []GetLibraryItemsMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetLibraryItemsMetadata) GetGenre() []GetLibraryItemsGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetLibraryItemsMetadata) GetCountry() []GetLibraryItemsCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetLibraryItemsMetadata) GetDirector() []GetLibraryItemsDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetLibraryItemsMetadata) GetWriter() []GetLibraryItemsWriter { +func (g *GetLibraryItemsRequest) GetAccepts() *components.Accepts { if g == nil { return nil } - return g.Writer + return g.Accepts } -func (g *GetLibraryItemsMetadata) GetProducer() []GetLibraryItemsProducer { +func (g *GetLibraryItemsRequest) GetClientIdentifier() *string { if g == nil { return nil } - return g.Producer + return g.ClientIdentifier } -func (g *GetLibraryItemsMetadata) GetCollection() []GetLibraryItemsCollection { +func (g *GetLibraryItemsRequest) GetProduct() *string { if g == nil { return nil } - return g.Collection + return g.Product } -func (g *GetLibraryItemsMetadata) GetRole() []GetLibraryItemsRole { +func (g *GetLibraryItemsRequest) GetVersion() *string { if g == nil { return nil } - return g.Role + return g.Version } -func (g *GetLibraryItemsMetadata) GetRatings() []Ratings { +func (g *GetLibraryItemsRequest) GetPlatform() *string { if g == nil { return nil } - return g.Ratings + return g.Platform } -func (g *GetLibraryItemsMetadata) GetSimilar() []GetLibraryItemsSimilar { +func (g *GetLibraryItemsRequest) GetPlatformVersion() *string { if g == nil { return nil } - return g.Similar + return g.PlatformVersion } -func (g *GetLibraryItemsMetadata) GetLocation() []GetLibraryItemsLocation { +func (g *GetLibraryItemsRequest) GetDevice() *string { if g == nil { return nil } - return g.Location + return g.Device } -func (g *GetLibraryItemsMetadata) GetChapter() []Chapter { +func (g *GetLibraryItemsRequest) GetModel() *string { if g == nil { return nil } - return g.Chapter + return g.Model } -func (g *GetLibraryItemsMetadata) GetMarker() []Marker { +func (g *GetLibraryItemsRequest) GetDeviceVendor() *string { if g == nil { return nil } - return g.Marker + return g.DeviceVendor } -func (g *GetLibraryItemsMetadata) GetExtras() *Extras { +func (g *GetLibraryItemsRequest) GetDeviceName() *string { if g == nil { return nil } - return g.Extras + return g.DeviceName } -type GetLibraryItemsFilter struct { - Filter string `json:"filter"` - FilterType string `json:"filterType"` - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` -} - -func (g *GetLibraryItemsFilter) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetLibraryItemsFilter) GetFilterType() string { - if g == nil { - return "" - } - return g.FilterType -} - -func (g *GetLibraryItemsFilter) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibraryItemsFilter) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibraryItemsFilter) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -// GetLibraryItemsActiveDirection - The direction of the sort. Can be either `asc` or `desc`. -type GetLibraryItemsActiveDirection string - -const ( - GetLibraryItemsActiveDirectionAscending GetLibraryItemsActiveDirection = "asc" - GetLibraryItemsActiveDirectionDescending GetLibraryItemsActiveDirection = "desc" -) - -func (e GetLibraryItemsActiveDirection) ToPointer() *GetLibraryItemsActiveDirection { - return &e -} -func (e *GetLibraryItemsActiveDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = GetLibraryItemsActiveDirection(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibraryItemsActiveDirection: %v", v) - } -} - -// GetLibraryItemsDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. -type GetLibraryItemsDefaultDirection string - -const ( - GetLibraryItemsDefaultDirectionAscending GetLibraryItemsDefaultDirection = "asc" - GetLibraryItemsDefaultDirectionDescending GetLibraryItemsDefaultDirection = "desc" -) - -func (e GetLibraryItemsDefaultDirection) ToPointer() *GetLibraryItemsDefaultDirection { - return &e -} -func (e *GetLibraryItemsDefaultDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = GetLibraryItemsDefaultDirection(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibraryItemsDefaultDirection: %v", v) - } -} - -type GetLibraryItemsSort struct { - Default *string `json:"default,omitempty"` - Active *bool `json:"active,omitempty"` - // The direction of the sort. Can be either `asc` or `desc`. - // - ActiveDirection *GetLibraryItemsActiveDirection `default:"asc" json:"activeDirection"` - // The direction of the sort. Can be either `asc` or `desc`. - // - DefaultDirection *GetLibraryItemsDefaultDirection `default:"asc" json:"defaultDirection"` - DescKey *string `json:"descKey,omitempty"` - FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` - Key string `json:"key"` - Title string `json:"title"` -} - -func (g GetLibraryItemsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibraryItemsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { - return err - } - return nil -} - -func (g *GetLibraryItemsSort) GetDefault() *string { - if g == nil { - return nil - } - return g.Default -} - -func (g *GetLibraryItemsSort) GetActive() *bool { - if g == nil { - return nil - } - return g.Active -} - -func (g *GetLibraryItemsSort) GetActiveDirection() *GetLibraryItemsActiveDirection { - if g == nil { - return nil - } - return g.ActiveDirection -} - -func (g *GetLibraryItemsSort) GetDefaultDirection() *GetLibraryItemsDefaultDirection { - if g == nil { - return nil - } - return g.DefaultDirection -} - -func (g *GetLibraryItemsSort) GetDescKey() *string { - if g == nil { - return nil - } - return g.DescKey -} - -func (g *GetLibraryItemsSort) GetFirstCharacterKey() *string { - if g == nil { - return nil - } - return g.FirstCharacterKey -} - -func (g *GetLibraryItemsSort) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibraryItemsSort) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetLibraryItemsField struct { - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - SubType *string `json:"subType,omitempty"` -} - -func (g *GetLibraryItemsField) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibraryItemsField) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibraryItemsField) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibraryItemsField) GetSubType() *string { - if g == nil { - return nil - } - return g.SubType -} - -type GetLibraryItemsLibraryType struct { - Key string `json:"key"` - Type string `json:"type"` - Title string `json:"title"` - Active bool `json:"active"` - Filter []GetLibraryItemsFilter `json:"Filter,omitempty"` - Sort []GetLibraryItemsSort `json:"Sort,omitempty"` - Field []GetLibraryItemsField `json:"Field,omitempty"` -} - -func (g *GetLibraryItemsLibraryType) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibraryItemsLibraryType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibraryItemsLibraryType) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibraryItemsLibraryType) GetActive() bool { - if g == nil { - return false - } - return g.Active -} - -func (g *GetLibraryItemsLibraryType) GetFilter() []GetLibraryItemsFilter { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetLibraryItemsLibraryType) GetSort() []GetLibraryItemsSort { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetLibraryItemsLibraryType) GetField() []GetLibraryItemsField { - if g == nil { - return nil - } - return g.Field -} - -type GetLibraryItemsOperator struct { - Key string `json:"key"` - Title string `json:"title"` -} - -func (g *GetLibraryItemsOperator) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibraryItemsOperator) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetLibraryItemsFieldType struct { - Type string `json:"type"` - Operator []GetLibraryItemsOperator `json:"Operator"` -} - -func (g *GetLibraryItemsFieldType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibraryItemsFieldType) GetOperator() []GetLibraryItemsOperator { - if g == nil { - return []GetLibraryItemsOperator{} - } - return g.Operator -} - -// GetLibraryItemsMeta - The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. -type GetLibraryItemsMeta struct { - Type []GetLibraryItemsLibraryType `json:"Type,omitempty"` - FieldType []GetLibraryItemsFieldType `json:"FieldType,omitempty"` -} - -func (g *GetLibraryItemsMeta) GetType() []GetLibraryItemsLibraryType { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibraryItemsMeta) GetFieldType() []GetLibraryItemsFieldType { - if g == nil { - return nil - } - return g.FieldType -} - -type GetLibraryItemsMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Total number of media items in the library. - TotalSize int `json:"totalSize"` - // Offset value for pagination. - Offset int64 `json:"offset"` - // The content type or mode. - Content string `json:"content"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // Specifies whether caching is disabled. - Nocache bool `json:"nocache"` - // URL for the background artwork of the media container. - Art string `json:"art"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The unique identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The universally unique identifier for the library section. - LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // URL for the thumbnail image of the media container. - Thumb string `json:"thumb"` - // The primary title of the media container. - Title1 string `json:"title1"` - // The secondary title of the media container. - Title2 string `json:"title2"` - // Identifier for the view group layout. - ViewGroup string `json:"viewGroup"` - // Identifier for the view mode. - ViewMode *string `json:"viewMode,omitempty"` - // Indicates if the media container has mixed parents. - MixedParents *bool `json:"mixedParents,omitempty"` - // An array of metadata items. - Metadata []GetLibraryItemsMetadata `json:"Metadata"` - // The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - // - Meta *GetLibraryItemsMeta `json:"Meta,omitempty"` -} - -func (g *GetLibraryItemsMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetLibraryItemsMediaContainer) GetTotalSize() int { - if g == nil { - return 0 - } - return g.TotalSize -} - -func (g *GetLibraryItemsMediaContainer) GetOffset() int64 { - if g == nil { - return 0 - } - return g.Offset -} - -func (g *GetLibraryItemsMediaContainer) GetContent() string { - if g == nil { - return "" - } - return g.Content -} - -func (g *GetLibraryItemsMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetLibraryItemsMediaContainer) GetNocache() bool { - if g == nil { - return false - } - return g.Nocache -} - -func (g *GetLibraryItemsMediaContainer) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetLibraryItemsMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetLibraryItemsMediaContainer) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetLibraryItemsMediaContainer) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetLibraryItemsMediaContainer) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetLibraryItemsMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetLibraryItemsMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetLibraryItemsMediaContainer) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetLibraryItemsMediaContainer) GetTitle1() string { - if g == nil { - return "" - } - return g.Title1 -} - -func (g *GetLibraryItemsMediaContainer) GetTitle2() string { - if g == nil { - return "" - } - return g.Title2 -} - -func (g *GetLibraryItemsMediaContainer) GetViewGroup() string { - if g == nil { - return "" - } - return g.ViewGroup -} - -func (g *GetLibraryItemsMediaContainer) GetViewMode() *string { +func (g *GetLibraryItemsRequest) GetMarketplace() *string { if g == nil { return nil } - return g.ViewMode -} - -func (g *GetLibraryItemsMediaContainer) GetMixedParents() *bool { - if g == nil { - return nil - } - return g.MixedParents -} - -func (g *GetLibraryItemsMediaContainer) GetMetadata() []GetLibraryItemsMetadata { - if g == nil { - return []GetLibraryItemsMetadata{} - } - return g.Metadata -} - -func (g *GetLibraryItemsMediaContainer) GetMeta() *GetLibraryItemsMeta { - if g == nil { - return nil - } - return g.Meta -} - -// GetLibraryItemsResponseBody - The contents of the library by section and tag -type GetLibraryItemsResponseBody struct { - MediaContainer *GetLibraryItemsMediaContainer `json:"MediaContainer,omitempty"` + return g.Marketplace } -func (g *GetLibraryItemsResponseBody) GetMediaContainer() *GetLibraryItemsMediaContainer { +func (g *GetLibraryItemsRequest) GetMediaQuery() *components.MediaQuery { if g == nil { return nil } - return g.MediaContainer + return g.MediaQuery } type GetLibraryItemsResponse struct { @@ -2555,8 +250,9 @@ type GetLibraryItemsResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response - // The contents of the library by section and tag - Object *GetLibraryItemsResponseBody + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string } func (g *GetLibraryItemsResponse) GetContentType() string { @@ -2580,9 +276,16 @@ func (g *GetLibraryItemsResponse) GetRawResponse() *http.Response { return g.RawResponse } -func (g *GetLibraryItemsResponse) GetObject() *GetLibraryItemsResponseBody { +func (g *GetLibraryItemsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { if g == nil { return nil } - return g.Object + return g.MediaContainerWithMetadata +} + +func (g *GetLibraryItemsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers } diff --git a/models/operations/getlibrarymatches.go b/models/operations/getlibrarymatches.go new file mode 100644 index 0000000..97c36ee --- /dev/null +++ b/models/operations/getlibrarymatches.go @@ -0,0 +1,405 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetLibraryMatchesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetLibraryMatchesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLibraryMatchesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetLibraryMatchesGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLibraryMatchesGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLibraryMatchesGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLibraryMatchesGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLibraryMatchesGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLibraryMatchesGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLibraryMatchesGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLibraryMatchesGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLibraryMatchesGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLibraryMatchesGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLibraryMatchesGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetLibraryMatchesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The metadata type to filter by + Type *int64 `queryParam:"style=form,explode=true,name=type"` + IncludeFullMetadata *components.BoolInt `queryParam:"style=form,explode=true,name=includeFullMetadata"` + IncludeAncestorMetadata *components.BoolInt `queryParam:"style=form,explode=true,name=includeAncestorMetadata"` + IncludeAlternateMetadataSources *components.BoolInt `queryParam:"style=form,explode=true,name=includeAlternateMetadataSources"` + // Used for movies, shows, artists, albums, and tracks. Allowed for various URI schemes, to be defined. + GUID *string `queryParam:"style=form,explode=true,name=guid"` + // The title to filter by or assign + Title *string `queryParam:"style=form,explode=true,name=title"` + // Used for movies shows, and albums. Optional. + Year *int64 `queryParam:"style=form,explode=true,name=year"` + // Used for movies, episodes, and tracks. The full path to the media file, used for "cloud-scanning" an item. + Path *string `queryParam:"style=form,explode=true,name=path"` + // Used for episodes and tracks. The title of the show/artist. Required if `path` isn't passed. + GrandparentTitle *string `queryParam:"style=form,explode=true,name=grandparentTitle"` + // Used for episodes. The year of the show. + GrandparentYear *int64 `queryParam:"style=form,explode=true,name=grandparentYear"` + // Used for episodes and tracks. The season/album number. + ParentIndex *int64 `queryParam:"style=form,explode=true,name=parentIndex"` + // Used for episodes and tracks. The episode/tracks number in the season/album. + Index *int64 `queryParam:"style=form,explode=true,name=index"` + // Used for episodes. In the format `YYYY-MM-DD`. + OriginallyAvailableAt *string `queryParam:"style=form,explode=true,name=originallyAvailableAt"` + // Used for albums and tracks. The artist name for albums or the album name for tracks. + ParentTitle *string `queryParam:"style=form,explode=true,name=parentTitle"` +} + +func (g GetLibraryMatchesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLibraryMatchesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetLibraryMatchesRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLibraryMatchesRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLibraryMatchesRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLibraryMatchesRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLibraryMatchesRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLibraryMatchesRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLibraryMatchesRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLibraryMatchesRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLibraryMatchesRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLibraryMatchesRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLibraryMatchesRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetLibraryMatchesRequest) GetType() *int64 { + if g == nil { + return nil + } + return g.Type +} + +func (g *GetLibraryMatchesRequest) GetIncludeFullMetadata() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeFullMetadata +} + +func (g *GetLibraryMatchesRequest) GetIncludeAncestorMetadata() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeAncestorMetadata +} + +func (g *GetLibraryMatchesRequest) GetIncludeAlternateMetadataSources() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeAlternateMetadataSources +} + +func (g *GetLibraryMatchesRequest) GetGUID() *string { + if g == nil { + return nil + } + return g.GUID +} + +func (g *GetLibraryMatchesRequest) GetTitle() *string { + if g == nil { + return nil + } + return g.Title +} + +func (g *GetLibraryMatchesRequest) GetYear() *int64 { + if g == nil { + return nil + } + return g.Year +} + +func (g *GetLibraryMatchesRequest) GetPath() *string { + if g == nil { + return nil + } + return g.Path +} + +func (g *GetLibraryMatchesRequest) GetGrandparentTitle() *string { + if g == nil { + return nil + } + return g.GrandparentTitle +} + +func (g *GetLibraryMatchesRequest) GetGrandparentYear() *int64 { + if g == nil { + return nil + } + return g.GrandparentYear +} + +func (g *GetLibraryMatchesRequest) GetParentIndex() *int64 { + if g == nil { + return nil + } + return g.ParentIndex +} + +func (g *GetLibraryMatchesRequest) GetIndex() *int64 { + if g == nil { + return nil + } + return g.Index +} + +func (g *GetLibraryMatchesRequest) GetOriginallyAvailableAt() *string { + if g == nil { + return nil + } + return g.OriginallyAvailableAt +} + +func (g *GetLibraryMatchesRequest) GetParentTitle() *string { + if g == nil { + return nil + } + return g.ParentTitle +} + +type GetLibraryMatchesResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetLibraryMatchesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetLibraryMatchesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetLibraryMatchesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetLibraryMatchesResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetLibraryMatchesResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getlibrarysectionsall.go b/models/operations/getlibrarysectionsall.go deleted file mode 100644 index ab27105..0000000 --- a/models/operations/getlibrarysectionsall.go +++ /dev/null @@ -1,2612 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -// GetLibrarySectionsAllQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetLibrarySectionsAllQueryParamType int64 - -const ( - GetLibrarySectionsAllQueryParamTypeMovie GetLibrarySectionsAllQueryParamType = 1 - GetLibrarySectionsAllQueryParamTypeTvShow GetLibrarySectionsAllQueryParamType = 2 - GetLibrarySectionsAllQueryParamTypeSeason GetLibrarySectionsAllQueryParamType = 3 - GetLibrarySectionsAllQueryParamTypeEpisode GetLibrarySectionsAllQueryParamType = 4 - GetLibrarySectionsAllQueryParamTypeArtist GetLibrarySectionsAllQueryParamType = 5 - GetLibrarySectionsAllQueryParamTypeAlbum GetLibrarySectionsAllQueryParamType = 6 - GetLibrarySectionsAllQueryParamTypeTrack GetLibrarySectionsAllQueryParamType = 7 - GetLibrarySectionsAllQueryParamTypePhotoAlbum GetLibrarySectionsAllQueryParamType = 8 - GetLibrarySectionsAllQueryParamTypePhoto GetLibrarySectionsAllQueryParamType = 9 -) - -func (e GetLibrarySectionsAllQueryParamType) ToPointer() *GetLibrarySectionsAllQueryParamType { - return &e -} - -// GetLibrarySectionsAllQueryParamIncludeMeta - Adds the Meta object to the response -type GetLibrarySectionsAllQueryParamIncludeMeta int - -const ( - GetLibrarySectionsAllQueryParamIncludeMetaDisable GetLibrarySectionsAllQueryParamIncludeMeta = 0 - GetLibrarySectionsAllQueryParamIncludeMetaEnable GetLibrarySectionsAllQueryParamIncludeMeta = 1 -) - -func (e GetLibrarySectionsAllQueryParamIncludeMeta) ToPointer() *GetLibrarySectionsAllQueryParamIncludeMeta { - return &e -} -func (e *GetLibrarySectionsAllQueryParamIncludeMeta) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetLibrarySectionsAllQueryParamIncludeMeta(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibrarySectionsAllQueryParamIncludeMeta: %v", v) - } -} - -// QueryParamIncludeGuids - Adds the Guid object to the response -type QueryParamIncludeGuids int - -const ( - QueryParamIncludeGuidsDisable QueryParamIncludeGuids = 0 - QueryParamIncludeGuidsEnable QueryParamIncludeGuids = 1 -) - -func (e QueryParamIncludeGuids) ToPointer() *QueryParamIncludeGuids { - return &e -} -func (e *QueryParamIncludeGuids) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = QueryParamIncludeGuids(v) - return nil - default: - return fmt.Errorf("invalid value for QueryParamIncludeGuids: %v", v) - } -} - -type IncludeAdvanced int - -const ( - IncludeAdvancedDisable IncludeAdvanced = 0 - IncludeAdvancedEnable IncludeAdvanced = 1 -) - -func (e IncludeAdvanced) ToPointer() *IncludeAdvanced { - return &e -} -func (e *IncludeAdvanced) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeAdvanced(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeAdvanced: %v", v) - } -} - -type QueryParamIncludeCollections int - -const ( - QueryParamIncludeCollectionsDisable QueryParamIncludeCollections = 0 - QueryParamIncludeCollectionsEnable QueryParamIncludeCollections = 1 -) - -func (e QueryParamIncludeCollections) ToPointer() *QueryParamIncludeCollections { - return &e -} -func (e *QueryParamIncludeCollections) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = QueryParamIncludeCollections(v) - return nil - default: - return fmt.Errorf("invalid value for QueryParamIncludeCollections: %v", v) - } -} - -type QueryParamIncludeExternalMedia int - -const ( - QueryParamIncludeExternalMediaDisable QueryParamIncludeExternalMedia = 0 - QueryParamIncludeExternalMediaEnable QueryParamIncludeExternalMedia = 1 -) - -func (e QueryParamIncludeExternalMedia) ToPointer() *QueryParamIncludeExternalMedia { - return &e -} -func (e *QueryParamIncludeExternalMedia) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = QueryParamIncludeExternalMedia(v) - return nil - default: - return fmt.Errorf("invalid value for QueryParamIncludeExternalMedia: %v", v) - } -} - -type GetLibrarySectionsAllRequest struct { - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetLibrarySectionsAllQueryParamType `queryParam:"style=form,explode=true,name=type"` - // Adds the Meta object to the response - // - IncludeMeta *GetLibrarySectionsAllQueryParamIncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"` - // Adds the Guid object to the response - // - IncludeGuids *QueryParamIncludeGuids `default:"0" queryParam:"style=form,explode=true,name=includeGuids"` - IncludeAdvanced *IncludeAdvanced `default:"0" queryParam:"style=form,explode=true,name=includeAdvanced"` - IncludeCollections *QueryParamIncludeCollections `default:"0" queryParam:"style=form,explode=true,name=includeCollections"` - IncludeExternalMedia *QueryParamIncludeExternalMedia `default:"0" queryParam:"style=form,explode=true,name=includeExternalMedia"` - // The index of the first item to return. If not specified, the first item will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 0 - // - XPlexContainerStart *int `default:"0" queryParam:"style=form,explode=true,name=X-Plex-Container-Start"` - // The number of items to return. If not specified, all items will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 50 - // - XPlexContainerSize *int `default:"50" queryParam:"style=form,explode=true,name=X-Plex-Container-Size"` -} - -func (g GetLibrarySectionsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibrarySectionsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionKey", "type"}); err != nil { - return err - } - return nil -} - -func (g *GetLibrarySectionsAllRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -func (g *GetLibrarySectionsAllRequest) GetType() GetLibrarySectionsAllQueryParamType { - if g == nil { - return GetLibrarySectionsAllQueryParamType(0) - } - return g.Type -} - -func (g *GetLibrarySectionsAllRequest) GetIncludeMeta() *GetLibrarySectionsAllQueryParamIncludeMeta { - if g == nil { - return nil - } - return g.IncludeMeta -} - -func (g *GetLibrarySectionsAllRequest) GetIncludeGuids() *QueryParamIncludeGuids { - if g == nil { - return nil - } - return g.IncludeGuids -} - -func (g *GetLibrarySectionsAllRequest) GetIncludeAdvanced() *IncludeAdvanced { - if g == nil { - return nil - } - return g.IncludeAdvanced -} - -func (g *GetLibrarySectionsAllRequest) GetIncludeCollections() *QueryParamIncludeCollections { - if g == nil { - return nil - } - return g.IncludeCollections -} - -func (g *GetLibrarySectionsAllRequest) GetIncludeExternalMedia() *QueryParamIncludeExternalMedia { - if g == nil { - return nil - } - return g.IncludeExternalMedia -} - -func (g *GetLibrarySectionsAllRequest) GetXPlexContainerStart() *int { - if g == nil { - return nil - } - return g.XPlexContainerStart -} - -func (g *GetLibrarySectionsAllRequest) GetXPlexContainerSize() *int { - if g == nil { - return nil - } - return g.XPlexContainerSize -} - -type GetLibrarySectionsAllFilter struct { - Filter string `json:"filter"` - FilterType string `json:"filterType"` - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - Advanced *bool `json:"advanced,omitempty"` -} - -func (g *GetLibrarySectionsAllFilter) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetLibrarySectionsAllFilter) GetFilterType() string { - if g == nil { - return "" - } - return g.FilterType -} - -func (g *GetLibrarySectionsAllFilter) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllFilter) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibrarySectionsAllFilter) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibrarySectionsAllFilter) GetAdvanced() *bool { - if g == nil { - return nil - } - return g.Advanced -} - -// GetLibrarySectionsAllActiveDirection - The direction of the sort. Can be either `asc` or `desc`. -type GetLibrarySectionsAllActiveDirection string - -const ( - GetLibrarySectionsAllActiveDirectionAscending GetLibrarySectionsAllActiveDirection = "asc" - GetLibrarySectionsAllActiveDirectionDescending GetLibrarySectionsAllActiveDirection = "desc" -) - -func (e GetLibrarySectionsAllActiveDirection) ToPointer() *GetLibrarySectionsAllActiveDirection { - return &e -} -func (e *GetLibrarySectionsAllActiveDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = GetLibrarySectionsAllActiveDirection(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibrarySectionsAllActiveDirection: %v", v) - } -} - -// GetLibrarySectionsAllDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. -type GetLibrarySectionsAllDefaultDirection string - -const ( - GetLibrarySectionsAllDefaultDirectionAscending GetLibrarySectionsAllDefaultDirection = "asc" - GetLibrarySectionsAllDefaultDirectionDescending GetLibrarySectionsAllDefaultDirection = "desc" -) - -func (e GetLibrarySectionsAllDefaultDirection) ToPointer() *GetLibrarySectionsAllDefaultDirection { - return &e -} -func (e *GetLibrarySectionsAllDefaultDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = GetLibrarySectionsAllDefaultDirection(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibrarySectionsAllDefaultDirection: %v", v) - } -} - -type GetLibrarySectionsAllSort struct { - Default *string `json:"default,omitempty"` - Active *bool `json:"active,omitempty"` - // The direction of the sort. Can be either `asc` or `desc`. - // - ActiveDirection *GetLibrarySectionsAllActiveDirection `default:"asc" json:"activeDirection"` - // The direction of the sort. Can be either `asc` or `desc`. - // - DefaultDirection *GetLibrarySectionsAllDefaultDirection `default:"asc" json:"defaultDirection"` - DescKey *string `json:"descKey,omitempty"` - FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` - Key string `json:"key"` - Title string `json:"title"` -} - -func (g GetLibrarySectionsAllSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibrarySectionsAllSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { - return err - } - return nil -} - -func (g *GetLibrarySectionsAllSort) GetDefault() *string { - if g == nil { - return nil - } - return g.Default -} - -func (g *GetLibrarySectionsAllSort) GetActive() *bool { - if g == nil { - return nil - } - return g.Active -} - -func (g *GetLibrarySectionsAllSort) GetActiveDirection() *GetLibrarySectionsAllActiveDirection { - if g == nil { - return nil - } - return g.ActiveDirection -} - -func (g *GetLibrarySectionsAllSort) GetDefaultDirection() *GetLibrarySectionsAllDefaultDirection { - if g == nil { - return nil - } - return g.DefaultDirection -} - -func (g *GetLibrarySectionsAllSort) GetDescKey() *string { - if g == nil { - return nil - } - return g.DescKey -} - -func (g *GetLibrarySectionsAllSort) GetFirstCharacterKey() *string { - if g == nil { - return nil - } - return g.FirstCharacterKey -} - -func (g *GetLibrarySectionsAllSort) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllSort) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetLibrarySectionsAllField struct { - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - SubType *string `json:"subType,omitempty"` -} - -func (g *GetLibrarySectionsAllField) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllField) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibrarySectionsAllField) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibrarySectionsAllField) GetSubType() *string { - if g == nil { - return nil - } - return g.SubType -} - -type GetLibrarySectionsAllType struct { - Key string `json:"key"` - Type string `json:"type"` - Subtype *string `json:"subtype,omitempty"` - Title string `json:"title"` - Active bool `json:"active"` - Filter []GetLibrarySectionsAllFilter `json:"Filter,omitempty"` - Sort []GetLibrarySectionsAllSort `json:"Sort,omitempty"` - Field []GetLibrarySectionsAllField `json:"Field,omitempty"` -} - -func (g *GetLibrarySectionsAllType) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibrarySectionsAllType) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetLibrarySectionsAllType) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibrarySectionsAllType) GetActive() bool { - if g == nil { - return false - } - return g.Active -} - -func (g *GetLibrarySectionsAllType) GetFilter() []GetLibrarySectionsAllFilter { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetLibrarySectionsAllType) GetSort() []GetLibrarySectionsAllSort { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetLibrarySectionsAllType) GetField() []GetLibrarySectionsAllField { - if g == nil { - return nil - } - return g.Field -} - -type GetLibrarySectionsAllOperator struct { - Key string `json:"key"` - Title string `json:"title"` -} - -func (g *GetLibrarySectionsAllOperator) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllOperator) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetLibrarySectionsAllFieldType struct { - Type string `json:"type"` - Operator []GetLibrarySectionsAllOperator `json:"Operator"` -} - -func (g *GetLibrarySectionsAllFieldType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetLibrarySectionsAllFieldType) GetOperator() []GetLibrarySectionsAllOperator { - if g == nil { - return []GetLibrarySectionsAllOperator{} - } - return g.Operator -} - -// GetLibrarySectionsAllMeta - The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. -type GetLibrarySectionsAllMeta struct { - Type []GetLibrarySectionsAllType `json:"Type,omitempty"` - FieldType []GetLibrarySectionsAllFieldType `json:"FieldType,omitempty"` -} - -func (g *GetLibrarySectionsAllMeta) GetType() []GetLibrarySectionsAllType { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetLibrarySectionsAllMeta) GetFieldType() []GetLibrarySectionsAllFieldType { - if g == nil { - return nil - } - return g.FieldType -} - -// GetLibrarySectionsAllLibraryType - The type of media content in the Plex library. This can represent videos, music, or photos. -type GetLibrarySectionsAllLibraryType string - -const ( - GetLibrarySectionsAllLibraryTypeMovie GetLibrarySectionsAllLibraryType = "movie" - GetLibrarySectionsAllLibraryTypeTvShow GetLibrarySectionsAllLibraryType = "show" - GetLibrarySectionsAllLibraryTypeSeason GetLibrarySectionsAllLibraryType = "season" - GetLibrarySectionsAllLibraryTypeEpisode GetLibrarySectionsAllLibraryType = "episode" - GetLibrarySectionsAllLibraryTypeArtist GetLibrarySectionsAllLibraryType = "artist" - GetLibrarySectionsAllLibraryTypeAlbum GetLibrarySectionsAllLibraryType = "album" - GetLibrarySectionsAllLibraryTypeTrack GetLibrarySectionsAllLibraryType = "track" - GetLibrarySectionsAllLibraryTypePhotoAlbum GetLibrarySectionsAllLibraryType = "photoalbum" - GetLibrarySectionsAllLibraryTypePhoto GetLibrarySectionsAllLibraryType = "photo" - GetLibrarySectionsAllLibraryTypeCollection GetLibrarySectionsAllLibraryType = "collection" -) - -func (e GetLibrarySectionsAllLibraryType) ToPointer() *GetLibrarySectionsAllLibraryType { - return &e -} - -type GetLibrarySectionsAllLibraryResponseType string - -const ( - GetLibrarySectionsAllLibraryResponseTypeCoverPoster GetLibrarySectionsAllLibraryResponseType = "coverPoster" - GetLibrarySectionsAllLibraryResponseTypeBackground GetLibrarySectionsAllLibraryResponseType = "background" - GetLibrarySectionsAllLibraryResponseTypeSnapshot GetLibrarySectionsAllLibraryResponseType = "snapshot" - GetLibrarySectionsAllLibraryResponseTypeClearLogo GetLibrarySectionsAllLibraryResponseType = "clearLogo" -) - -func (e GetLibrarySectionsAllLibraryResponseType) ToPointer() *GetLibrarySectionsAllLibraryResponseType { - return &e -} - -type GetLibrarySectionsAllImage struct { - Alt string `json:"alt"` - Type GetLibrarySectionsAllLibraryResponseType `json:"type"` - URL string `json:"url"` -} - -func (g *GetLibrarySectionsAllImage) GetAlt() string { - if g == nil { - return "" - } - return g.Alt -} - -func (g *GetLibrarySectionsAllImage) GetType() GetLibrarySectionsAllLibraryResponseType { - if g == nil { - return GetLibrarySectionsAllLibraryResponseType("") - } - return g.Type -} - -func (g *GetLibrarySectionsAllImage) GetURL() string { - if g == nil { - return "" - } - return g.URL -} - -type GetLibrarySectionsAllUltraBlurColors struct { - TopLeft string `json:"topLeft"` - TopRight string `json:"topRight"` - BottomRight string `json:"bottomRight"` - BottomLeft string `json:"bottomLeft"` -} - -func (g *GetLibrarySectionsAllUltraBlurColors) GetTopLeft() string { - if g == nil { - return "" - } - return g.TopLeft -} - -func (g *GetLibrarySectionsAllUltraBlurColors) GetTopRight() string { - if g == nil { - return "" - } - return g.TopRight -} - -func (g *GetLibrarySectionsAllUltraBlurColors) GetBottomRight() string { - if g == nil { - return "" - } - return g.BottomRight -} - -func (g *GetLibrarySectionsAllUltraBlurColors) GetBottomLeft() string { - if g == nil { - return "" - } - return g.BottomLeft -} - -type GetLibrarySectionsAllGuids struct { - // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// - // - ID string `json:"id"` -} - -func (g *GetLibrarySectionsAllGuids) GetID() string { - if g == nil { - return "" - } - return g.ID -} - -type GetLibrarySectionsAllOptimizedForStreaming1 int - -const ( - GetLibrarySectionsAllOptimizedForStreaming1Zero GetLibrarySectionsAllOptimizedForStreaming1 = 0 - GetLibrarySectionsAllOptimizedForStreaming1One GetLibrarySectionsAllOptimizedForStreaming1 = 1 -) - -func (e GetLibrarySectionsAllOptimizedForStreaming1) ToPointer() *GetLibrarySectionsAllOptimizedForStreaming1 { - return &e -} -func (e *GetLibrarySectionsAllOptimizedForStreaming1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetLibrarySectionsAllOptimizedForStreaming1(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibrarySectionsAllOptimizedForStreaming1: %v", v) - } -} - -type GetLibrarySectionsAllOptimizedForStreamingType string - -const ( - GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreamingType = "get-library-sections-all_optimizedForStreaming_1" - GetLibrarySectionsAllOptimizedForStreamingTypeBoolean GetLibrarySectionsAllOptimizedForStreamingType = "boolean" -) - -// GetLibrarySectionsAllOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetLibrarySectionsAllOptimizedForStreaming struct { - GetLibrarySectionsAllOptimizedForStreaming1 *GetLibrarySectionsAllOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetLibrarySectionsAllOptimizedForStreamingType -} - -func CreateGetLibrarySectionsAllOptimizedForStreamingGetLibrarySectionsAllOptimizedForStreaming1(getLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreaming1) GetLibrarySectionsAllOptimizedForStreaming { - typ := GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 - - return GetLibrarySectionsAllOptimizedForStreaming{ - GetLibrarySectionsAllOptimizedForStreaming1: &getLibrarySectionsAllOptimizedForStreaming1, - Type: typ, - } -} - -func CreateGetLibrarySectionsAllOptimizedForStreamingBoolean(boolean bool) GetLibrarySectionsAllOptimizedForStreaming { - typ := GetLibrarySectionsAllOptimizedForStreamingTypeBoolean - - return GetLibrarySectionsAllOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetLibrarySectionsAllOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreaming1 = GetLibrarySectionsAllOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreaming1, "", true, nil); err == nil { - u.GetLibrarySectionsAllOptimizedForStreaming1 = &getLibrarySectionsAllOptimizedForStreaming1 - u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetLibrarySectionsAllOptimizedForStreaming", string(data)) -} - -func (u GetLibrarySectionsAllOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetLibrarySectionsAllOptimizedForStreaming1 != nil { - return utils.MarshalJSON(u.GetLibrarySectionsAllOptimizedForStreaming1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetLibrarySectionsAllOptimizedForStreaming: all fields are null") -} - -type GetLibrarySectionsAllOptimizedForStreamingLibrary1 int - -const ( - GetLibrarySectionsAllOptimizedForStreamingLibrary1Zero GetLibrarySectionsAllOptimizedForStreamingLibrary1 = 0 - GetLibrarySectionsAllOptimizedForStreamingLibrary1One GetLibrarySectionsAllOptimizedForStreamingLibrary1 = 1 -) - -func (e GetLibrarySectionsAllOptimizedForStreamingLibrary1) ToPointer() *GetLibrarySectionsAllOptimizedForStreamingLibrary1 { - return &e -} -func (e *GetLibrarySectionsAllOptimizedForStreamingLibrary1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetLibrarySectionsAllOptimizedForStreamingLibrary1(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibrarySectionsAllOptimizedForStreamingLibrary1: %v", v) - } -} - -type GetLibrarySectionsAllLibraryOptimizedForStreamingType string - -const ( - GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllLibraryOptimizedForStreamingType = "get-library-sections-all_optimizedForStreaming_Library_1" - GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean GetLibrarySectionsAllLibraryOptimizedForStreamingType = "boolean" -) - -// GetLibrarySectionsAllLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetLibrarySectionsAllLibraryOptimizedForStreaming struct { - GetLibrarySectionsAllOptimizedForStreamingLibrary1 *GetLibrarySectionsAllOptimizedForStreamingLibrary1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetLibrarySectionsAllLibraryOptimizedForStreamingType -} - -func CreateGetLibrarySectionsAllLibraryOptimizedForStreamingGetLibrarySectionsAllOptimizedForStreamingLibrary1(getLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllOptimizedForStreamingLibrary1) GetLibrarySectionsAllLibraryOptimizedForStreaming { - typ := GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 - - return GetLibrarySectionsAllLibraryOptimizedForStreaming{ - GetLibrarySectionsAllOptimizedForStreamingLibrary1: &getLibrarySectionsAllOptimizedForStreamingLibrary1, - Type: typ, - } -} - -func CreateGetLibrarySectionsAllLibraryOptimizedForStreamingBoolean(boolean bool) GetLibrarySectionsAllLibraryOptimizedForStreaming { - typ := GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean - - return GetLibrarySectionsAllLibraryOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetLibrarySectionsAllLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllOptimizedForStreamingLibrary1 = GetLibrarySectionsAllOptimizedForStreamingLibrary1(0) - if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreamingLibrary1, "", true, nil); err == nil { - u.GetLibrarySectionsAllOptimizedForStreamingLibrary1 = &getLibrarySectionsAllOptimizedForStreamingLibrary1 - u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetLibrarySectionsAllLibraryOptimizedForStreaming", string(data)) -} - -func (u GetLibrarySectionsAllLibraryOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetLibrarySectionsAllOptimizedForStreamingLibrary1 != nil { - return utils.MarshalJSON(u.GetLibrarySectionsAllOptimizedForStreamingLibrary1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetLibrarySectionsAllLibraryOptimizedForStreaming: all fields are null") -} - -// GetLibrarySectionsAllHasThumbnail - Indicates if the part has a thumbnail. -type GetLibrarySectionsAllHasThumbnail string - -const ( - GetLibrarySectionsAllHasThumbnailFalse GetLibrarySectionsAllHasThumbnail = "0" - GetLibrarySectionsAllHasThumbnailTrue GetLibrarySectionsAllHasThumbnail = "1" -) - -func (e GetLibrarySectionsAllHasThumbnail) ToPointer() *GetLibrarySectionsAllHasThumbnail { - return &e -} -func (e *GetLibrarySectionsAllHasThumbnail) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "0": - fallthrough - case "1": - *e = GetLibrarySectionsAllHasThumbnail(v) - return nil - default: - return fmt.Errorf("invalid value for GetLibrarySectionsAllHasThumbnail: %v", v) - } -} - -type GetLibrarySectionsAllStream struct { - // Unique stream identifier. - ID int64 `json:"id"` - // Stream type: - // - VIDEO = 1 - // - AUDIO = 2 - // - SUBTITLE = 3 - // - streamType int64 `const:"1" json:"streamType"` - // Format of the stream (e.g., srt). - Format *string `json:"format,omitempty"` - // Indicates if this stream is default. - Default *bool `json:"default,omitempty"` - // Codec used by the stream. - Codec string `json:"codec"` - // Index of the stream. - Index *int `json:"index,omitempty"` - // Bitrate of the stream. - Bitrate *int `json:"bitrate,omitempty"` - // Language of the stream. - Language *string `json:"language,omitempty"` - // Language tag (e.g., en). - LanguageTag *string `json:"languageTag,omitempty"` - // ISO language code. - LanguageCode *string `json:"languageCode,omitempty"` - // Indicates whether header compression is enabled. - HeaderCompression *bool `json:"headerCompression,omitempty"` - // Dolby Vision BL compatibility ID. - DOVIBLCompatID *int `json:"DOVIBLCompatID,omitempty"` - // Indicates if Dolby Vision BL is present. - DOVIBLPresent *bool `json:"DOVIBLPresent,omitempty"` - // Indicates if Dolby Vision EL is present. - DOVIELPresent *bool `json:"DOVIELPresent,omitempty"` - // Dolby Vision level. - DOVILevel *int `json:"DOVILevel,omitempty"` - // Indicates if Dolby Vision is present. - DOVIPresent *bool `json:"DOVIPresent,omitempty"` - // Dolby Vision profile. - DOVIProfile *int `json:"DOVIProfile,omitempty"` - // Indicates if Dolby Vision RPU is present. - DOVIRPUPresent *bool `json:"DOVIRPUPresent,omitempty"` - // Dolby Vision version. - DOVIVersion *string `json:"DOVIVersion,omitempty"` - // Bit depth of the video stream. - BitDepth *int `json:"bitDepth,omitempty"` - // Chroma sample location. - ChromaLocation *string `json:"chromaLocation,omitempty"` - // Chroma subsampling format. - ChromaSubsampling *string `json:"chromaSubsampling,omitempty"` - // Coded video height. - CodedHeight *int `json:"codedHeight,omitempty"` - // Coded video width. - CodedWidth *int `json:"codedWidth,omitempty"` - ClosedCaptions *bool `json:"closedCaptions,omitempty"` - // Color primaries used. - ColorPrimaries *string `json:"colorPrimaries,omitempty"` - // Color range (e.g., tv). - ColorRange *string `json:"colorRange,omitempty"` - // Color space. - ColorSpace *string `json:"colorSpace,omitempty"` - // Color transfer characteristics. - ColorTrc *string `json:"colorTrc,omitempty"` - // Frame rate of the stream. - FrameRate *float32 `json:"frameRate,omitempty"` - // Key to access this stream part. - Key *string `json:"key,omitempty"` - // Height of the video stream. - Height *int `json:"height,omitempty"` - // Video level. - Level *int `json:"level,omitempty"` - // Indicates if this is the original stream. - Original *bool `json:"original,omitempty"` - HasScalingMatrix *bool `json:"hasScalingMatrix,omitempty"` - // Video profile. - Profile *string `json:"profile,omitempty"` - ScanType *string `json:"scanType,omitempty"` - EmbeddedInVideo *string `json:"embeddedInVideo,omitempty"` - // Number of reference frames. - RefFrames *int `json:"refFrames,omitempty"` - // Width of the video stream. - Width *int `json:"width,omitempty"` - // Display title for the stream. - DisplayTitle string `json:"displayTitle"` - // Extended display title for the stream. - ExtendedDisplayTitle string `json:"extendedDisplayTitle"` - // Indicates if this stream is selected (applicable for audio streams). - Selected *bool `json:"selected,omitempty"` - Forced *bool `json:"forced,omitempty"` - // Number of audio channels (for audio streams). - Channels *int `json:"channels,omitempty"` - // Audio channel layout. - AudioChannelLayout *string `json:"audioChannelLayout,omitempty"` - // Sampling rate for the audio stream. - SamplingRate *int `json:"samplingRate,omitempty"` - // Indicates if the stream can auto-sync. - CanAutoSync *bool `json:"canAutoSync,omitempty"` - // Indicates if the stream is for the hearing impaired. - HearingImpaired *bool `json:"hearingImpaired,omitempty"` - // Indicates if the stream is a dub. - Dub *bool `json:"dub,omitempty"` - // Optional title for the stream (e.g., language variant). - Title *string `json:"title,omitempty"` -} - -func (g GetLibrarySectionsAllStream) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibrarySectionsAllStream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "streamType", "codec", "displayTitle", "extendedDisplayTitle"}); err != nil { - return err - } - return nil -} - -func (g *GetLibrarySectionsAllStream) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibrarySectionsAllStream) GetStreamType() int64 { - return 1 -} - -func (g *GetLibrarySectionsAllStream) GetFormat() *string { - if g == nil { - return nil - } - return g.Format -} - -func (g *GetLibrarySectionsAllStream) GetDefault() *bool { - if g == nil { - return nil - } - return g.Default -} - -func (g *GetLibrarySectionsAllStream) GetCodec() string { - if g == nil { - return "" - } - return g.Codec -} - -func (g *GetLibrarySectionsAllStream) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetLibrarySectionsAllStream) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetLibrarySectionsAllStream) GetLanguage() *string { - if g == nil { - return nil - } - return g.Language -} - -func (g *GetLibrarySectionsAllStream) GetLanguageTag() *string { - if g == nil { - return nil - } - return g.LanguageTag -} - -func (g *GetLibrarySectionsAllStream) GetLanguageCode() *string { - if g == nil { - return nil - } - return g.LanguageCode -} - -func (g *GetLibrarySectionsAllStream) GetHeaderCompression() *bool { - if g == nil { - return nil - } - return g.HeaderCompression -} - -func (g *GetLibrarySectionsAllStream) GetDOVIBLCompatID() *int { - if g == nil { - return nil - } - return g.DOVIBLCompatID -} - -func (g *GetLibrarySectionsAllStream) GetDOVIBLPresent() *bool { - if g == nil { - return nil - } - return g.DOVIBLPresent -} - -func (g *GetLibrarySectionsAllStream) GetDOVIELPresent() *bool { - if g == nil { - return nil - } - return g.DOVIELPresent -} - -func (g *GetLibrarySectionsAllStream) GetDOVILevel() *int { - if g == nil { - return nil - } - return g.DOVILevel -} - -func (g *GetLibrarySectionsAllStream) GetDOVIPresent() *bool { - if g == nil { - return nil - } - return g.DOVIPresent -} - -func (g *GetLibrarySectionsAllStream) GetDOVIProfile() *int { - if g == nil { - return nil - } - return g.DOVIProfile -} - -func (g *GetLibrarySectionsAllStream) GetDOVIRPUPresent() *bool { - if g == nil { - return nil - } - return g.DOVIRPUPresent -} - -func (g *GetLibrarySectionsAllStream) GetDOVIVersion() *string { - if g == nil { - return nil - } - return g.DOVIVersion -} - -func (g *GetLibrarySectionsAllStream) GetBitDepth() *int { - if g == nil { - return nil - } - return g.BitDepth -} - -func (g *GetLibrarySectionsAllStream) GetChromaLocation() *string { - if g == nil { - return nil - } - return g.ChromaLocation -} - -func (g *GetLibrarySectionsAllStream) GetChromaSubsampling() *string { - if g == nil { - return nil - } - return g.ChromaSubsampling -} - -func (g *GetLibrarySectionsAllStream) GetCodedHeight() *int { - if g == nil { - return nil - } - return g.CodedHeight -} - -func (g *GetLibrarySectionsAllStream) GetCodedWidth() *int { - if g == nil { - return nil - } - return g.CodedWidth -} - -func (g *GetLibrarySectionsAllStream) GetClosedCaptions() *bool { - if g == nil { - return nil - } - return g.ClosedCaptions -} - -func (g *GetLibrarySectionsAllStream) GetColorPrimaries() *string { - if g == nil { - return nil - } - return g.ColorPrimaries -} - -func (g *GetLibrarySectionsAllStream) GetColorRange() *string { - if g == nil { - return nil - } - return g.ColorRange -} - -func (g *GetLibrarySectionsAllStream) GetColorSpace() *string { - if g == nil { - return nil - } - return g.ColorSpace -} - -func (g *GetLibrarySectionsAllStream) GetColorTrc() *string { - if g == nil { - return nil - } - return g.ColorTrc -} - -func (g *GetLibrarySectionsAllStream) GetFrameRate() *float32 { - if g == nil { - return nil - } - return g.FrameRate -} - -func (g *GetLibrarySectionsAllStream) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetLibrarySectionsAllStream) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetLibrarySectionsAllStream) GetLevel() *int { - if g == nil { - return nil - } - return g.Level -} - -func (g *GetLibrarySectionsAllStream) GetOriginal() *bool { - if g == nil { - return nil - } - return g.Original -} - -func (g *GetLibrarySectionsAllStream) GetHasScalingMatrix() *bool { - if g == nil { - return nil - } - return g.HasScalingMatrix -} - -func (g *GetLibrarySectionsAllStream) GetProfile() *string { - if g == nil { - return nil - } - return g.Profile -} - -func (g *GetLibrarySectionsAllStream) GetScanType() *string { - if g == nil { - return nil - } - return g.ScanType -} - -func (g *GetLibrarySectionsAllStream) GetEmbeddedInVideo() *string { - if g == nil { - return nil - } - return g.EmbeddedInVideo -} - -func (g *GetLibrarySectionsAllStream) GetRefFrames() *int { - if g == nil { - return nil - } - return g.RefFrames -} - -func (g *GetLibrarySectionsAllStream) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetLibrarySectionsAllStream) GetDisplayTitle() string { - if g == nil { - return "" - } - return g.DisplayTitle -} - -func (g *GetLibrarySectionsAllStream) GetExtendedDisplayTitle() string { - if g == nil { - return "" - } - return g.ExtendedDisplayTitle -} - -func (g *GetLibrarySectionsAllStream) GetSelected() *bool { - if g == nil { - return nil - } - return g.Selected -} - -func (g *GetLibrarySectionsAllStream) GetForced() *bool { - if g == nil { - return nil - } - return g.Forced -} - -func (g *GetLibrarySectionsAllStream) GetChannels() *int { - if g == nil { - return nil - } - return g.Channels -} - -func (g *GetLibrarySectionsAllStream) GetAudioChannelLayout() *string { - if g == nil { - return nil - } - return g.AudioChannelLayout -} - -func (g *GetLibrarySectionsAllStream) GetSamplingRate() *int { - if g == nil { - return nil - } - return g.SamplingRate -} - -func (g *GetLibrarySectionsAllStream) GetCanAutoSync() *bool { - if g == nil { - return nil - } - return g.CanAutoSync -} - -func (g *GetLibrarySectionsAllStream) GetHearingImpaired() *bool { - if g == nil { - return nil - } - return g.HearingImpaired -} - -func (g *GetLibrarySectionsAllStream) GetDub() *bool { - if g == nil { - return nil - } - return g.Dub -} - -func (g *GetLibrarySectionsAllStream) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -type GetLibrarySectionsAllPart struct { - // Indicates if the part is accessible. - Accessible *bool `json:"accessible,omitempty"` - // Indicates if the part exists. - Exists *bool `json:"exists,omitempty"` - // Unique part identifier. - ID int64 `json:"id"` - // Key to access this part. - Key string `json:"key"` - Indexes *string `json:"indexes,omitempty"` - // Duration of the part in milliseconds. - Duration *int `json:"duration,omitempty"` - // File path for the part. - File string `json:"file"` - // File size in bytes. - Size int64 `json:"size"` - PacketLength *int `json:"packetLength,omitempty"` - // Container format of the part. - Container *string `json:"container,omitempty"` - // Video profile for the part. - VideoProfile *string `json:"videoProfile,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *GetLibrarySectionsAllLibraryOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - HasThumbnail *GetLibrarySectionsAllHasThumbnail `default:"0" json:"hasThumbnail"` - // An array of streams for this part. - Stream []GetLibrarySectionsAllStream `json:"Stream,omitempty"` -} - -func (g GetLibrarySectionsAllPart) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibrarySectionsAllPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "key", "file", "size"}); err != nil { - return err - } - return nil -} - -func (g *GetLibrarySectionsAllPart) GetAccessible() *bool { - if g == nil { - return nil - } - return g.Accessible -} - -func (g *GetLibrarySectionsAllPart) GetExists() *bool { - if g == nil { - return nil - } - return g.Exists -} - -func (g *GetLibrarySectionsAllPart) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibrarySectionsAllPart) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllPart) GetIndexes() *string { - if g == nil { - return nil - } - return g.Indexes -} - -func (g *GetLibrarySectionsAllPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibrarySectionsAllPart) GetFile() string { - if g == nil { - return "" - } - return g.File -} - -func (g *GetLibrarySectionsAllPart) GetSize() int64 { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetLibrarySectionsAllPart) GetPacketLength() *int { - if g == nil { - return nil - } - return g.PacketLength -} - -func (g *GetLibrarySectionsAllPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetLibrarySectionsAllPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetLibrarySectionsAllPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetLibrarySectionsAllPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetLibrarySectionsAllPart) GetOptimizedForStreaming() *GetLibrarySectionsAllLibraryOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetLibrarySectionsAllPart) GetHasThumbnail() *GetLibrarySectionsAllHasThumbnail { - if g == nil { - return nil - } - return g.HasThumbnail -} - -func (g *GetLibrarySectionsAllPart) GetStream() []GetLibrarySectionsAllStream { - if g == nil { - return nil - } - return g.Stream -} - -type GetLibrarySectionsAllMedia struct { - // Unique media identifier. - ID int64 `json:"id"` - // Duration of the media in milliseconds. - Duration *int `json:"duration,omitempty"` - // Bitrate in bits per second. - Bitrate *int `json:"bitrate,omitempty"` - // Video width in pixels. - Width *int `json:"width,omitempty"` - // Video height in pixels. - Height *int `json:"height,omitempty"` - // Aspect ratio of the video. - AspectRatio *float32 `json:"aspectRatio,omitempty"` - // Number of audio channels. - AudioChannels *int `json:"audioChannels,omitempty"` - DisplayOffset *int `json:"displayOffset,omitempty"` - // Audio codec used. - AudioCodec *string `json:"audioCodec,omitempty"` - // Video codec used. - VideoCodec *string `json:"videoCodec,omitempty"` - // Video resolution (e.g., 4k). - VideoResolution *string `json:"videoResolution,omitempty"` - // File container type. - Container *string `json:"container,omitempty"` - // Frame rate of the video. Values found include NTSC, PAL, 24p - // - VideoFrameRate *string `json:"videoFrameRate,omitempty"` - // Video profile (e.g., main 10). - VideoProfile *string `json:"videoProfile,omitempty"` - // Indicates whether voice activity is detected. - HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *GetLibrarySectionsAllOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // An array of parts for this media item. - Part []GetLibrarySectionsAllPart `json:"Part,omitempty"` -} - -func (g *GetLibrarySectionsAllMedia) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetLibrarySectionsAllMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetLibrarySectionsAllMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetLibrarySectionsAllMedia) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetLibrarySectionsAllMedia) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetLibrarySectionsAllMedia) GetAspectRatio() *float32 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetLibrarySectionsAllMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetLibrarySectionsAllMedia) GetDisplayOffset() *int { - if g == nil { - return nil - } - return g.DisplayOffset -} - -func (g *GetLibrarySectionsAllMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetLibrarySectionsAllMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetLibrarySectionsAllMedia) GetVideoResolution() *string { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetLibrarySectionsAllMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetLibrarySectionsAllMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetLibrarySectionsAllMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetLibrarySectionsAllMedia) GetHasVoiceActivity() *bool { - if g == nil { - return nil - } - return g.HasVoiceActivity -} - -func (g *GetLibrarySectionsAllMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetLibrarySectionsAllMedia) GetOptimizedForStreaming() *GetLibrarySectionsAllOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetLibrarySectionsAllMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetLibrarySectionsAllMedia) GetPart() []GetLibrarySectionsAllPart { - if g == nil { - return nil - } - return g.Part -} - -type GetLibrarySectionsAllGenre struct { - // The genre name of this media-item - // - Tag string `json:"tag"` -} - -func (g *GetLibrarySectionsAllGenre) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibrarySectionsAllCountry struct { - // The country of origin of this media item - Tag string `json:"tag"` -} - -func (g *GetLibrarySectionsAllCountry) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibrarySectionsAllDirector struct { - // The role of Director - Tag string `json:"tag"` -} - -func (g *GetLibrarySectionsAllDirector) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibrarySectionsAllWriter struct { - // The role of Writer - Tag string `json:"tag"` -} - -func (g *GetLibrarySectionsAllWriter) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibrarySectionsAllRole struct { - // The display tag for the actor (typically the actor's name). - Tag string `json:"tag"` -} - -func (g *GetLibrarySectionsAllRole) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetLibrarySectionsAllCollection struct { - // The user-made collection this media item belongs to - Tag string `json:"tag"` -} - -func (g *GetLibrarySectionsAllCollection) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -// GetLibrarySectionsAllMetadata - Unknown -type GetLibrarySectionsAllMetadata struct { - // The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. - RatingKey string `json:"ratingKey"` - // The unique key for the media item. - Key string `json:"key"` - // The globally unique identifier for the media item. - GUID string `json:"guid"` - // A URL‐friendly version of the media title. - Slug string `json:"slug"` - // The studio that produced the media item. - Studio *string `json:"studio,omitempty"` - Type GetLibrarySectionsAllLibraryType `json:"type"` - // The title of the media item. - Title string `json:"title"` - // The sort title used for ordering media items. - TitleSort string `json:"titleSort"` - // The content rating for the media item. - ContentRating *string `json:"contentRating,omitempty"` - // A synopsis of the media item. - Summary string `json:"summary"` - // The critic rating for the media item. - Rating float32 `json:"rating"` - // The audience rating for the media item. - AudienceRating float64 `json:"audienceRating"` - // The release year of the media item. - Year *int `json:"year,omitempty"` - // A brief tagline for the media item. - Tagline string `json:"tagline"` - // The thumbnail image URL for the media item. - Thumb string `json:"thumb"` - // The art image URL for the media item. - Art string `json:"art"` - // The theme URL for the media item. - Theme string `json:"theme"` - // The index position of the media item. - Index int `json:"index"` - // The number of leaf items (end nodes) under this media item. - LeafCount *int `json:"leafCount,omitempty"` - // The number of leaf items that have been viewed. - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - // The number of child items associated with this media item. - ChildCount int `json:"childCount"` - // The total number of seasons (for TV shows). - SeasonCount int `json:"seasonCount"` - // The duration of the media item in milliseconds. - Duration int `json:"duration"` - // The original release date of the media item. - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - AddedAt int64 `json:"addedAt"` - // Unix epoch datetime in seconds - UpdatedAt *int64 `json:"updatedAt,omitempty"` - // The URL for the audience rating image. - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - // The source from which chapter data is derived. - ChapterSource *string `json:"chapterSource,omitempty"` - // The primary extra key associated with this media item. - PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` - // The original title of the media item (if different). - OriginalTitle *string `json:"originalTitle,omitempty"` - // The rating key of the parent media item. - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - // The rating key of the grandparent media item. - GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` - // The GUID of the parent media item. - ParentGUID *string `json:"parentGuid,omitempty"` - // The GUID of the grandparent media item. - GrandparentGUID *string `json:"grandparentGuid,omitempty"` - // The slug for the grandparent media item. - GrandparentSlug *string `json:"grandparentSlug,omitempty"` - // The key of the grandparent media item. - GrandparentKey *string `json:"grandparentKey,omitempty"` - // The key of the parent media item. - ParentKey *string `json:"parentKey,omitempty"` - // The title of the grandparent media item. - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - // The thumbnail URL for the grandparent media item. - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - // The theme URL for the grandparent media item. - GrandparentTheme *string `json:"grandparentTheme,omitempty"` - // The art URL for the grandparent media item. - GrandparentArt *string `json:"grandparentArt,omitempty"` - // The title of the parent media item. - ParentTitle *string `json:"parentTitle,omitempty"` - // The index position of the parent media item. - ParentIndex *int `json:"parentIndex,omitempty"` - // The thumbnail URL for the parent media item. - ParentThumb *string `json:"parentThumb,omitempty"` - // The URL for the rating image. - RatingImage *string `json:"ratingImage,omitempty"` - // The number of times this media item has been viewed. - ViewCount *int `json:"viewCount,omitempty"` - // The current playback offset (in milliseconds). - ViewOffset *int `json:"viewOffset,omitempty"` - // The number of times this media item has been skipped. - SkipCount *int `json:"skipCount,omitempty"` - // A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. - Subtype *string `json:"subtype,omitempty"` - // The Unix timestamp representing the last time the item was rated. - LastRatedAt *int64 `json:"lastRatedAt,omitempty"` - // The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). - CreatedAtAccuracy *string `json:"createdAtAccuracy,omitempty"` - // The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. - CreatedAtTZOffset *string `json:"createdAtTZOffset,omitempty"` - // Unix timestamp for when the media item was last viewed. - LastViewedAt *int `json:"lastViewedAt,omitempty"` - // The rating provided by a user for the item. This value is expressed as a decimal number. - UserRating *float32 `json:"userRating,omitempty"` - Image []GetLibrarySectionsAllImage `json:"Image,omitempty"` - UltraBlurColors *GetLibrarySectionsAllUltraBlurColors `json:"UltraBlurColors,omitempty"` - Guids []GetLibrarySectionsAllGuids `json:"Guid,omitempty"` - Media []GetLibrarySectionsAllMedia `json:"Media,omitempty"` - Genre []GetLibrarySectionsAllGenre `json:"Genre,omitempty"` - Country []GetLibrarySectionsAllCountry `json:"Country,omitempty"` - Director []GetLibrarySectionsAllDirector `json:"Director,omitempty"` - Writer []GetLibrarySectionsAllWriter `json:"Writer,omitempty"` - Role []GetLibrarySectionsAllRole `json:"Role,omitempty"` - Collection []GetLibrarySectionsAllCollection `json:"Collection,omitempty"` -} - -func (g GetLibrarySectionsAllMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetLibrarySectionsAllMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { - return err - } - return nil -} - -func (g *GetLibrarySectionsAllMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetLibrarySectionsAllMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetLibrarySectionsAllMetadata) GetGUID() string { - if g == nil { - return "" - } - return g.GUID -} - -func (g *GetLibrarySectionsAllMetadata) GetSlug() string { - if g == nil { - return "" - } - return g.Slug -} - -func (g *GetLibrarySectionsAllMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetLibrarySectionsAllMetadata) GetType() GetLibrarySectionsAllLibraryType { - if g == nil { - return GetLibrarySectionsAllLibraryType("") - } - return g.Type -} - -func (g *GetLibrarySectionsAllMetadata) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetLibrarySectionsAllMetadata) GetTitleSort() string { - if g == nil { - return "" - } - return g.TitleSort -} - -func (g *GetLibrarySectionsAllMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetLibrarySectionsAllMetadata) GetSummary() string { - if g == nil { - return "" - } - return g.Summary -} - -func (g *GetLibrarySectionsAllMetadata) GetRating() float32 { - if g == nil { - return 0.0 - } - return g.Rating -} - -func (g *GetLibrarySectionsAllMetadata) GetAudienceRating() float64 { - if g == nil { - return 0.0 - } - return g.AudienceRating -} - -func (g *GetLibrarySectionsAllMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetLibrarySectionsAllMetadata) GetTagline() string { - if g == nil { - return "" - } - return g.Tagline -} - -func (g *GetLibrarySectionsAllMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetLibrarySectionsAllMetadata) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetLibrarySectionsAllMetadata) GetTheme() string { - if g == nil { - return "" - } - return g.Theme -} - -func (g *GetLibrarySectionsAllMetadata) GetIndex() int { - if g == nil { - return 0 - } - return g.Index -} - -func (g *GetLibrarySectionsAllMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetLibrarySectionsAllMetadata) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetLibrarySectionsAllMetadata) GetChildCount() int { - if g == nil { - return 0 - } - return g.ChildCount -} - -func (g *GetLibrarySectionsAllMetadata) GetSeasonCount() int { - if g == nil { - return 0 - } - return g.SeasonCount -} - -func (g *GetLibrarySectionsAllMetadata) GetDuration() int { - if g == nil { - return 0 - } - return g.Duration -} - -func (g *GetLibrarySectionsAllMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetLibrarySectionsAllMetadata) GetAddedAt() int64 { - if g == nil { - return 0 - } - return g.AddedAt -} - -func (g *GetLibrarySectionsAllMetadata) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetLibrarySectionsAllMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetLibrarySectionsAllMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetLibrarySectionsAllMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetLibrarySectionsAllMetadata) GetOriginalTitle() *string { - if g == nil { - return nil - } - return g.OriginalTitle -} - -func (g *GetLibrarySectionsAllMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentRatingKey() *string { - if g == nil { - return nil - } - return g.GrandparentRatingKey -} - -func (g *GetLibrarySectionsAllMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentGUID() *string { - if g == nil { - return nil - } - return g.GrandparentGUID -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentSlug() *string { - if g == nil { - return nil - } - return g.GrandparentSlug -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetLibrarySectionsAllMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentTheme() *string { - if g == nil { - return nil - } - return g.GrandparentTheme -} - -func (g *GetLibrarySectionsAllMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetLibrarySectionsAllMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetLibrarySectionsAllMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetLibrarySectionsAllMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetLibrarySectionsAllMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetLibrarySectionsAllMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetLibrarySectionsAllMetadata) GetViewOffset() *int { - if g == nil { - return nil - } - return g.ViewOffset -} - -func (g *GetLibrarySectionsAllMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetLibrarySectionsAllMetadata) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetLibrarySectionsAllMetadata) GetLastRatedAt() *int64 { - if g == nil { - return nil - } - return g.LastRatedAt -} - -func (g *GetLibrarySectionsAllMetadata) GetCreatedAtAccuracy() *string { - if g == nil { - return nil - } - return g.CreatedAtAccuracy -} - -func (g *GetLibrarySectionsAllMetadata) GetCreatedAtTZOffset() *string { - if g == nil { - return nil - } - return g.CreatedAtTZOffset -} - -func (g *GetLibrarySectionsAllMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetLibrarySectionsAllMetadata) GetUserRating() *float32 { - if g == nil { - return nil - } - return g.UserRating -} - -func (g *GetLibrarySectionsAllMetadata) GetImage() []GetLibrarySectionsAllImage { - if g == nil { - return nil - } - return g.Image -} - -func (g *GetLibrarySectionsAllMetadata) GetUltraBlurColors() *GetLibrarySectionsAllUltraBlurColors { - if g == nil { - return nil - } - return g.UltraBlurColors -} - -func (g *GetLibrarySectionsAllMetadata) GetGuids() []GetLibrarySectionsAllGuids { - if g == nil { - return nil - } - return g.Guids -} - -func (g *GetLibrarySectionsAllMetadata) GetMedia() []GetLibrarySectionsAllMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetLibrarySectionsAllMetadata) GetGenre() []GetLibrarySectionsAllGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetLibrarySectionsAllMetadata) GetCountry() []GetLibrarySectionsAllCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetLibrarySectionsAllMetadata) GetDirector() []GetLibrarySectionsAllDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetLibrarySectionsAllMetadata) GetWriter() []GetLibrarySectionsAllWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetLibrarySectionsAllMetadata) GetRole() []GetLibrarySectionsAllRole { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetLibrarySectionsAllMetadata) GetCollection() []GetLibrarySectionsAllCollection { - if g == nil { - return nil - } - return g.Collection -} - -type GetLibrarySectionsAllMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Total number of media items in the library. - TotalSize int `json:"totalSize"` - // Offset value for pagination. - Offset int64 `json:"offset"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // URL for the background artwork of the media container. - Art string `json:"art"` - // The content type or mode. - Content string `json:"content"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The unique identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The universally unique identifier for the library section. - LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // URL for the thumbnail image of the media container. - Thumb string `json:"thumb"` - // Specifies whether caching is disabled. - Nocache bool `json:"nocache"` - // The primary title of the media container. - Title1 string `json:"title1"` - // The secondary title of the media container. - Title2 string `json:"title2"` - // Identifier for the view group layout. - ViewGroup string `json:"viewGroup"` - // The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - // - Meta *GetLibrarySectionsAllMeta `json:"Meta,omitempty"` - // An array of metadata items. - Metadata []GetLibrarySectionsAllMetadata `json:"Metadata,omitempty"` -} - -func (g *GetLibrarySectionsAllMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetLibrarySectionsAllMediaContainer) GetTotalSize() int { - if g == nil { - return 0 - } - return g.TotalSize -} - -func (g *GetLibrarySectionsAllMediaContainer) GetOffset() int64 { - if g == nil { - return 0 - } - return g.Offset -} - -func (g *GetLibrarySectionsAllMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetLibrarySectionsAllMediaContainer) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetLibrarySectionsAllMediaContainer) GetContent() string { - if g == nil { - return "" - } - return g.Content -} - -func (g *GetLibrarySectionsAllMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetLibrarySectionsAllMediaContainer) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetLibrarySectionsAllMediaContainer) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetLibrarySectionsAllMediaContainer) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetLibrarySectionsAllMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetLibrarySectionsAllMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetLibrarySectionsAllMediaContainer) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetLibrarySectionsAllMediaContainer) GetNocache() bool { - if g == nil { - return false - } - return g.Nocache -} - -func (g *GetLibrarySectionsAllMediaContainer) GetTitle1() string { - if g == nil { - return "" - } - return g.Title1 -} - -func (g *GetLibrarySectionsAllMediaContainer) GetTitle2() string { - if g == nil { - return "" - } - return g.Title2 -} - -func (g *GetLibrarySectionsAllMediaContainer) GetViewGroup() string { - if g == nil { - return "" - } - return g.ViewGroup -} - -func (g *GetLibrarySectionsAllMediaContainer) GetMeta() *GetLibrarySectionsAllMeta { - if g == nil { - return nil - } - return g.Meta -} - -func (g *GetLibrarySectionsAllMediaContainer) GetMetadata() []GetLibrarySectionsAllMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetLibrarySectionsAllResponseBody - Successful response containing media container data. -type GetLibrarySectionsAllResponseBody struct { - MediaContainer *GetLibrarySectionsAllMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetLibrarySectionsAllResponseBody) GetMediaContainer() *GetLibrarySectionsAllMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetLibrarySectionsAllResponse 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 - // Successful response containing media container data. - Object *GetLibrarySectionsAllResponseBody -} - -func (g *GetLibrarySectionsAllResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetLibrarySectionsAllResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetLibrarySectionsAllResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetLibrarySectionsAllResponse) GetObject() *GetLibrarySectionsAllResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getlineup.go b/models/operations/getlineup.go new file mode 100644 index 0000000..8f4ecf9 --- /dev/null +++ b/models/operations/getlineup.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetLineupGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetLineupGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLineupGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetLineupGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLineupGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLineupGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLineupGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLineupGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLineupGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLineupGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLineupGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLineupGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLineupGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLineupGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetLineupRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The URI describing the device + DeviceQueryParameter string `queryParam:"style=form,explode=true,name=device"` + // The URI describing the lineupGroup + LineupGroup string `queryParam:"style=form,explode=true,name=lineupGroup"` +} + +func (g GetLineupRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLineupRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"device", "lineupGroup"}); err != nil { + return err + } + return nil +} + +func (g *GetLineupRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLineupRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLineupRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLineupRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLineupRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLineupRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLineupRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLineupRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLineupRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLineupRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLineupRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetLineupRequest) GetDeviceQueryParameter() string { + if g == nil { + return "" + } + return g.DeviceQueryParameter +} + +func (g *GetLineupRequest) GetLineupGroup() string { + if g == nil { + return "" + } + return g.LineupGroup +} + +type GetLineupResponse 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 + Headers map[string][]string +} + +func (g *GetLineupResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetLineupResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetLineupResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetLineupResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getlineupchannels.go b/models/operations/getlineupchannels.go new file mode 100644 index 0000000..3db44e0 --- /dev/null +++ b/models/operations/getlineupchannels.go @@ -0,0 +1,451 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetLineupChannelsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetLineupChannelsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLineupChannelsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetLineupChannelsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLineupChannelsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLineupChannelsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLineupChannelsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLineupChannelsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLineupChannelsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLineupChannelsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLineupChannelsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLineupChannelsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLineupChannelsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLineupChannelsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetLineupChannelsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The URIs describing the lineups + Lineup []string `queryParam:"style=form,explode=true,name=lineup"` +} + +func (g GetLineupChannelsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLineupChannelsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"lineup"}); err != nil { + return err + } + return nil +} + +func (g *GetLineupChannelsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLineupChannelsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLineupChannelsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLineupChannelsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLineupChannelsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLineupChannelsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLineupChannelsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLineupChannelsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLineupChannelsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLineupChannelsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLineupChannelsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetLineupChannelsRequest) GetLineup() []string { + if g == nil { + return []string{} + } + return g.Lineup +} + +// LineupType - - `-1`: N/A +// - `0`: Over the air +// - `1`: Cable +// - `2`: Satellite +// - `3`: IPTV +// - `4`: Virtual +type LineupType int64 + +const ( + LineupTypeMinus1 LineupType = -1 + LineupTypeZero LineupType = 0 + LineupTypeOne LineupType = 1 + LineupTypeTwo LineupType = 2 + LineupTypeThree LineupType = 3 + LineupTypeFour LineupType = 4 +) + +func (e LineupType) ToPointer() *LineupType { + return &e +} +func (e *LineupType) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case -1: + fallthrough + case 0: + fallthrough + case 1: + fallthrough + case 2: + fallthrough + case 3: + fallthrough + case 4: + *e = LineupType(v) + return nil + default: + return fmt.Errorf("invalid value for LineupType: %v", v) + } +} + +type Lineup struct { + Title *string `json:"title,omitempty"` + // The type of this object (`lineup` in this case) + Type *string `json:"type,omitempty"` + // - `-1`: N/A + // - `0`: Over the air + // - `1`: Cable + // - `2`: Satellite + // - `3`: IPTV + // - `4`: Virtual + // + LineupType *LineupType `json:"lineupType,omitempty"` + Location *string `json:"location,omitempty"` + // The uuid of this lineup + UUID *string `json:"uuid,omitempty"` + Channel []components.Channel `json:"Channel,omitempty"` +} + +func (l *Lineup) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +func (l *Lineup) GetType() *string { + if l == nil { + return nil + } + return l.Type +} + +func (l *Lineup) GetLineupType() *LineupType { + if l == nil { + return nil + } + return l.LineupType +} + +func (l *Lineup) GetLocation() *string { + if l == nil { + return nil + } + return l.Location +} + +func (l *Lineup) GetUUID() *string { + if l == nil { + return nil + } + return l.UUID +} + +func (l *Lineup) GetChannel() []components.Channel { + if l == nil { + return nil + } + return l.Channel +} + +// GetLineupChannelsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetLineupChannelsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Lineup []Lineup `json:"Lineup,omitempty"` +} + +func (g *GetLineupChannelsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetLineupChannelsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetLineupChannelsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetLineupChannelsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetLineupChannelsMediaContainer) GetLineup() []Lineup { + if g == nil { + return nil + } + return g.Lineup +} + +// GetLineupChannelsResponseBody - OK +type GetLineupChannelsResponseBody struct { + MediaContainer *GetLineupChannelsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetLineupChannelsResponseBody) GetMediaContainer() *GetLineupChannelsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetLineupChannelsResponse 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 + // OK + Object *GetLineupChannelsResponseBody +} + +func (g *GetLineupChannelsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetLineupChannelsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetLineupChannelsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetLineupChannelsResponse) GetObject() *GetLineupChannelsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getlivetvsession.go b/models/operations/getlivetvsession.go new file mode 100644 index 0000000..47561f4 --- /dev/null +++ b/models/operations/getlivetvsession.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetLiveTVSessionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetLiveTVSessionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLiveTVSessionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetLiveTVSessionGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLiveTVSessionGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLiveTVSessionGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLiveTVSessionGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLiveTVSessionGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLiveTVSessionGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLiveTVSessionGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLiveTVSessionGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLiveTVSessionGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLiveTVSessionGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLiveTVSessionGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetLiveTVSessionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The session id + SessionID string `pathParam:"style=simple,explode=false,name=sessionId"` +} + +func (g GetLiveTVSessionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLiveTVSessionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sessionId"}); err != nil { + return err + } + return nil +} + +func (g *GetLiveTVSessionRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetLiveTVSessionRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetLiveTVSessionRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetLiveTVSessionRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetLiveTVSessionRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetLiveTVSessionRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetLiveTVSessionRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetLiveTVSessionRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetLiveTVSessionRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetLiveTVSessionRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetLiveTVSessionRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetLiveTVSessionRequest) GetSessionID() string { + if g == nil { + return "" + } + return g.SessionID +} + +type GetLiveTVSessionResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetLiveTVSessionResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetLiveTVSessionResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetLiveTVSessionResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetLiveTVSessionResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetLiveTVSessionResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getmediaarts.go b/models/operations/getmediaarts.go deleted file mode 100644 index 5baed5c..0000000 --- a/models/operations/getmediaarts.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type GetMediaArtsRequest struct { - // the id of the library item to return the artwork of. - RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"` -} - -func (g *GetMediaArtsRequest) GetRatingKey() int64 { - if g == nil { - return 0 - } - return g.RatingKey -} - -type GetMediaArtsMetadata struct { - // The URL of the artwork. - Key string `json:"key"` - // The provider of the artwork. - Provider *string `json:"provider,omitempty"` - // The URL of the artwork. - RatingKey string `json:"ratingKey"` - // Whether this is the selected artwork. - Selected bool `json:"selected"` - // The URL of the artwork thumbnail. - Thumb string `json:"thumb"` -} - -func (g *GetMediaArtsMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetMediaArtsMetadata) GetProvider() *string { - if g == nil { - return nil - } - return g.Provider -} - -func (g *GetMediaArtsMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetMediaArtsMetadata) GetSelected() bool { - if g == nil { - return false - } - return g.Selected -} - -func (g *GetMediaArtsMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -type GetMediaArtsMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - Metadata []GetMediaArtsMetadata `json:"Metadata"` -} - -func (g *GetMediaArtsMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetMediaArtsMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetMediaArtsMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetMediaArtsMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetMediaArtsMediaContainer) GetMetadata() []GetMediaArtsMetadata { - if g == nil { - return []GetMediaArtsMetadata{} - } - return g.Metadata -} - -// GetMediaArtsResponseBody - The available background artwork for the library item. -type GetMediaArtsResponseBody struct { - MediaContainer *GetMediaArtsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetMediaArtsResponseBody) GetMediaContainer() *GetMediaArtsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetMediaArtsResponse 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 available background artwork for the library item. - Object *GetMediaArtsResponseBody -} - -func (g *GetMediaArtsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetMediaArtsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetMediaArtsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetMediaArtsResponse) GetObject() *GetMediaArtsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getmediametadata.go b/models/operations/getmediametadata.go deleted file mode 100644 index 17d5931..0000000 --- a/models/operations/getmediametadata.go +++ /dev/null @@ -1,2533 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -type GetMediaMetaDataRequest struct { - // The id(s) of the library item(s) to return metadata for. Can be a single ID or comma-separated list of IDs. - RatingKey string `pathParam:"style=simple,explode=false,name=ratingKey"` - // Include concerts data if set to true. - IncludeConcerts *bool `queryParam:"style=form,explode=true,name=includeConcerts"` - // Include extra content (e.g. bonus features). - IncludeExtras *bool `queryParam:"style=form,explode=true,name=includeExtras"` - // Include on-deck items. - IncludeOnDeck *bool `queryParam:"style=form,explode=true,name=includeOnDeck"` - // Include popular leaves (episodes/chapters). - IncludePopularLeaves *bool `queryParam:"style=form,explode=true,name=includePopularLeaves"` - // Include preferences information. - IncludePreferences *bool `queryParam:"style=form,explode=true,name=includePreferences"` - // Include reviews for the content. - IncludeReviews *bool `queryParam:"style=form,explode=true,name=includeReviews"` - // Include chapter details. - IncludeChapters *bool `queryParam:"style=form,explode=true,name=includeChapters"` - // Include station data. - IncludeStations *bool `queryParam:"style=form,explode=true,name=includeStations"` - // Include external media data. - IncludeExternalMedia *bool `queryParam:"style=form,explode=true,name=includeExternalMedia"` - // Trigger asynchronous metadata augmentation. - AsyncAugmentMetadata *bool `queryParam:"style=form,explode=true,name=asyncAugmentMetadata"` - // Trigger asynchronous file checking. - AsyncCheckFiles *bool `queryParam:"style=form,explode=true,name=asyncCheckFiles"` - // Trigger asynchronous refresh of analysis. - AsyncRefreshAnalysis *bool `queryParam:"style=form,explode=true,name=asyncRefreshAnalysis"` - // Trigger asynchronous refresh of the local media agent. - AsyncRefreshLocalMediaAgent *bool `queryParam:"style=form,explode=true,name=asyncRefreshLocalMediaAgent"` -} - -func (g *GetMediaMetaDataRequest) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetMediaMetaDataRequest) GetIncludeConcerts() *bool { - if g == nil { - return nil - } - return g.IncludeConcerts -} - -func (g *GetMediaMetaDataRequest) GetIncludeExtras() *bool { - if g == nil { - return nil - } - return g.IncludeExtras -} - -func (g *GetMediaMetaDataRequest) GetIncludeOnDeck() *bool { - if g == nil { - return nil - } - return g.IncludeOnDeck -} - -func (g *GetMediaMetaDataRequest) GetIncludePopularLeaves() *bool { - if g == nil { - return nil - } - return g.IncludePopularLeaves -} - -func (g *GetMediaMetaDataRequest) GetIncludePreferences() *bool { - if g == nil { - return nil - } - return g.IncludePreferences -} - -func (g *GetMediaMetaDataRequest) GetIncludeReviews() *bool { - if g == nil { - return nil - } - return g.IncludeReviews -} - -func (g *GetMediaMetaDataRequest) GetIncludeChapters() *bool { - if g == nil { - return nil - } - return g.IncludeChapters -} - -func (g *GetMediaMetaDataRequest) GetIncludeStations() *bool { - if g == nil { - return nil - } - return g.IncludeStations -} - -func (g *GetMediaMetaDataRequest) GetIncludeExternalMedia() *bool { - if g == nil { - return nil - } - return g.IncludeExternalMedia -} - -func (g *GetMediaMetaDataRequest) GetAsyncAugmentMetadata() *bool { - if g == nil { - return nil - } - return g.AsyncAugmentMetadata -} - -func (g *GetMediaMetaDataRequest) GetAsyncCheckFiles() *bool { - if g == nil { - return nil - } - return g.AsyncCheckFiles -} - -func (g *GetMediaMetaDataRequest) GetAsyncRefreshAnalysis() *bool { - if g == nil { - return nil - } - return g.AsyncRefreshAnalysis -} - -func (g *GetMediaMetaDataRequest) GetAsyncRefreshLocalMediaAgent() *bool { - if g == nil { - return nil - } - return g.AsyncRefreshLocalMediaAgent -} - -// GetMediaMetaDataType - The type of media content in the Plex library. This can represent videos, music, or photos. -type GetMediaMetaDataType string - -const ( - GetMediaMetaDataTypeMovie GetMediaMetaDataType = "movie" - GetMediaMetaDataTypeTvShow GetMediaMetaDataType = "show" - GetMediaMetaDataTypeSeason GetMediaMetaDataType = "season" - GetMediaMetaDataTypeEpisode GetMediaMetaDataType = "episode" - GetMediaMetaDataTypeArtist GetMediaMetaDataType = "artist" - GetMediaMetaDataTypeAlbum GetMediaMetaDataType = "album" - GetMediaMetaDataTypeTrack GetMediaMetaDataType = "track" - GetMediaMetaDataTypePhotoAlbum GetMediaMetaDataType = "photoalbum" - GetMediaMetaDataTypePhoto GetMediaMetaDataType = "photo" - GetMediaMetaDataTypeCollection GetMediaMetaDataType = "collection" -) - -func (e GetMediaMetaDataType) ToPointer() *GetMediaMetaDataType { - return &e -} - -type GetMediaMetaDataLibraryType string - -const ( - GetMediaMetaDataLibraryTypeCoverPoster GetMediaMetaDataLibraryType = "coverPoster" - GetMediaMetaDataLibraryTypeBackground GetMediaMetaDataLibraryType = "background" - GetMediaMetaDataLibraryTypeSnapshot GetMediaMetaDataLibraryType = "snapshot" - GetMediaMetaDataLibraryTypeClearLogo GetMediaMetaDataLibraryType = "clearLogo" -) - -func (e GetMediaMetaDataLibraryType) ToPointer() *GetMediaMetaDataLibraryType { - return &e -} - -type GetMediaMetaDataImage struct { - Alt string `json:"alt"` - Type GetMediaMetaDataLibraryType `json:"type"` - URL string `json:"url"` -} - -func (g *GetMediaMetaDataImage) GetAlt() string { - if g == nil { - return "" - } - return g.Alt -} - -func (g *GetMediaMetaDataImage) GetType() GetMediaMetaDataLibraryType { - if g == nil { - return GetMediaMetaDataLibraryType("") - } - return g.Type -} - -func (g *GetMediaMetaDataImage) GetURL() string { - if g == nil { - return "" - } - return g.URL -} - -type GetMediaMetaDataUltraBlurColors struct { - TopLeft string `json:"topLeft"` - TopRight string `json:"topRight"` - BottomRight string `json:"bottomRight"` - BottomLeft string `json:"bottomLeft"` -} - -func (g *GetMediaMetaDataUltraBlurColors) GetTopLeft() string { - if g == nil { - return "" - } - return g.TopLeft -} - -func (g *GetMediaMetaDataUltraBlurColors) GetTopRight() string { - if g == nil { - return "" - } - return g.TopRight -} - -func (g *GetMediaMetaDataUltraBlurColors) GetBottomRight() string { - if g == nil { - return "" - } - return g.BottomRight -} - -func (g *GetMediaMetaDataUltraBlurColors) GetBottomLeft() string { - if g == nil { - return "" - } - return g.BottomLeft -} - -type GetMediaMetaDataGuids struct { - // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// - // - ID string `json:"id"` -} - -func (g *GetMediaMetaDataGuids) GetID() string { - if g == nil { - return "" - } - return g.ID -} - -type GetMediaMetaDataOptimizedForStreaming1 int - -const ( - GetMediaMetaDataOptimizedForStreaming1Zero GetMediaMetaDataOptimizedForStreaming1 = 0 - GetMediaMetaDataOptimizedForStreaming1One GetMediaMetaDataOptimizedForStreaming1 = 1 -) - -func (e GetMediaMetaDataOptimizedForStreaming1) ToPointer() *GetMediaMetaDataOptimizedForStreaming1 { - return &e -} -func (e *GetMediaMetaDataOptimizedForStreaming1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetMediaMetaDataOptimizedForStreaming1(v) - return nil - default: - return fmt.Errorf("invalid value for GetMediaMetaDataOptimizedForStreaming1: %v", v) - } -} - -type GetMediaMetaDataOptimizedForStreamingType string - -const ( - GetMediaMetaDataOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreaming1 GetMediaMetaDataOptimizedForStreamingType = "get-media-meta-data_optimizedForStreaming_1" - GetMediaMetaDataOptimizedForStreamingTypeBoolean GetMediaMetaDataOptimizedForStreamingType = "boolean" -) - -// GetMediaMetaDataOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetMediaMetaDataOptimizedForStreaming struct { - GetMediaMetaDataOptimizedForStreaming1 *GetMediaMetaDataOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetMediaMetaDataOptimizedForStreamingType -} - -func CreateGetMediaMetaDataOptimizedForStreamingGetMediaMetaDataOptimizedForStreaming1(getMediaMetaDataOptimizedForStreaming1 GetMediaMetaDataOptimizedForStreaming1) GetMediaMetaDataOptimizedForStreaming { - typ := GetMediaMetaDataOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreaming1 - - return GetMediaMetaDataOptimizedForStreaming{ - GetMediaMetaDataOptimizedForStreaming1: &getMediaMetaDataOptimizedForStreaming1, - Type: typ, - } -} - -func CreateGetMediaMetaDataOptimizedForStreamingBoolean(boolean bool) GetMediaMetaDataOptimizedForStreaming { - typ := GetMediaMetaDataOptimizedForStreamingTypeBoolean - - return GetMediaMetaDataOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetMediaMetaDataOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getMediaMetaDataOptimizedForStreaming1 GetMediaMetaDataOptimizedForStreaming1 = GetMediaMetaDataOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getMediaMetaDataOptimizedForStreaming1, "", true, nil); err == nil { - u.GetMediaMetaDataOptimizedForStreaming1 = &getMediaMetaDataOptimizedForStreaming1 - u.Type = GetMediaMetaDataOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreaming1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetMediaMetaDataOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetMediaMetaDataOptimizedForStreaming", string(data)) -} - -func (u GetMediaMetaDataOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetMediaMetaDataOptimizedForStreaming1 != nil { - return utils.MarshalJSON(u.GetMediaMetaDataOptimizedForStreaming1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetMediaMetaDataOptimizedForStreaming: all fields are null") -} - -type GetMediaMetaDataOptimizedForStreamingLibrary1 int - -const ( - GetMediaMetaDataOptimizedForStreamingLibrary1Zero GetMediaMetaDataOptimizedForStreamingLibrary1 = 0 - GetMediaMetaDataOptimizedForStreamingLibrary1One GetMediaMetaDataOptimizedForStreamingLibrary1 = 1 -) - -func (e GetMediaMetaDataOptimizedForStreamingLibrary1) ToPointer() *GetMediaMetaDataOptimizedForStreamingLibrary1 { - return &e -} -func (e *GetMediaMetaDataOptimizedForStreamingLibrary1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetMediaMetaDataOptimizedForStreamingLibrary1(v) - return nil - default: - return fmt.Errorf("invalid value for GetMediaMetaDataOptimizedForStreamingLibrary1: %v", v) - } -} - -type GetMediaMetaDataLibraryOptimizedForStreamingType string - -const ( - GetMediaMetaDataLibraryOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreamingLibrary1 GetMediaMetaDataLibraryOptimizedForStreamingType = "get-media-meta-data_optimizedForStreaming_Library_1" - GetMediaMetaDataLibraryOptimizedForStreamingTypeBoolean GetMediaMetaDataLibraryOptimizedForStreamingType = "boolean" -) - -// GetMediaMetaDataLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetMediaMetaDataLibraryOptimizedForStreaming struct { - GetMediaMetaDataOptimizedForStreamingLibrary1 *GetMediaMetaDataOptimizedForStreamingLibrary1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetMediaMetaDataLibraryOptimizedForStreamingType -} - -func CreateGetMediaMetaDataLibraryOptimizedForStreamingGetMediaMetaDataOptimizedForStreamingLibrary1(getMediaMetaDataOptimizedForStreamingLibrary1 GetMediaMetaDataOptimizedForStreamingLibrary1) GetMediaMetaDataLibraryOptimizedForStreaming { - typ := GetMediaMetaDataLibraryOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreamingLibrary1 - - return GetMediaMetaDataLibraryOptimizedForStreaming{ - GetMediaMetaDataOptimizedForStreamingLibrary1: &getMediaMetaDataOptimizedForStreamingLibrary1, - Type: typ, - } -} - -func CreateGetMediaMetaDataLibraryOptimizedForStreamingBoolean(boolean bool) GetMediaMetaDataLibraryOptimizedForStreaming { - typ := GetMediaMetaDataLibraryOptimizedForStreamingTypeBoolean - - return GetMediaMetaDataLibraryOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetMediaMetaDataLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getMediaMetaDataOptimizedForStreamingLibrary1 GetMediaMetaDataOptimizedForStreamingLibrary1 = GetMediaMetaDataOptimizedForStreamingLibrary1(0) - if err := utils.UnmarshalJSON(data, &getMediaMetaDataOptimizedForStreamingLibrary1, "", true, nil); err == nil { - u.GetMediaMetaDataOptimizedForStreamingLibrary1 = &getMediaMetaDataOptimizedForStreamingLibrary1 - u.Type = GetMediaMetaDataLibraryOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreamingLibrary1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetMediaMetaDataLibraryOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetMediaMetaDataLibraryOptimizedForStreaming", string(data)) -} - -func (u GetMediaMetaDataLibraryOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetMediaMetaDataOptimizedForStreamingLibrary1 != nil { - return utils.MarshalJSON(u.GetMediaMetaDataOptimizedForStreamingLibrary1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetMediaMetaDataLibraryOptimizedForStreaming: all fields are null") -} - -// GetMediaMetaDataHasThumbnail - Indicates if the part has a thumbnail. -type GetMediaMetaDataHasThumbnail string - -const ( - GetMediaMetaDataHasThumbnailFalse GetMediaMetaDataHasThumbnail = "0" - GetMediaMetaDataHasThumbnailTrue GetMediaMetaDataHasThumbnail = "1" -) - -func (e GetMediaMetaDataHasThumbnail) ToPointer() *GetMediaMetaDataHasThumbnail { - return &e -} -func (e *GetMediaMetaDataHasThumbnail) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "0": - fallthrough - case "1": - *e = GetMediaMetaDataHasThumbnail(v) - return nil - default: - return fmt.Errorf("invalid value for GetMediaMetaDataHasThumbnail: %v", v) - } -} - -type GetMediaMetaDataStream struct { - // Unique stream identifier. - ID int64 `json:"id"` - // Stream type: - // - VIDEO = 1 - // - AUDIO = 2 - // - SUBTITLE = 3 - // - streamType int64 `const:"1" json:"streamType"` - // Format of the stream (e.g., srt). - Format *string `json:"format,omitempty"` - // Indicates if this stream is default. - Default *bool `json:"default,omitempty"` - // Codec used by the stream. - Codec *string `json:"codec,omitempty"` - // Index of the stream. - Index *int `json:"index,omitempty"` - // Bitrate of the stream. - Bitrate *int `json:"bitrate,omitempty"` - // Language of the stream. - Language *string `json:"language,omitempty"` - // Language tag (e.g., en). - LanguageTag *string `json:"languageTag,omitempty"` - // ISO language code. - LanguageCode *string `json:"languageCode,omitempty"` - // Indicates whether header compression is enabled. - HeaderCompression *bool `json:"headerCompression,omitempty"` - // Dolby Vision BL compatibility ID. - DOVIBLCompatID *int `json:"DOVIBLCompatID,omitempty"` - // Indicates if Dolby Vision BL is present. - DOVIBLPresent *bool `json:"DOVIBLPresent,omitempty"` - // Indicates if Dolby Vision EL is present. - DOVIELPresent *bool `json:"DOVIELPresent,omitempty"` - // Dolby Vision level. - DOVILevel *int `json:"DOVILevel,omitempty"` - // Indicates if Dolby Vision is present. - DOVIPresent *bool `json:"DOVIPresent,omitempty"` - // Dolby Vision profile. - DOVIProfile *int `json:"DOVIProfile,omitempty"` - // Indicates if Dolby Vision RPU is present. - DOVIRPUPresent *bool `json:"DOVIRPUPresent,omitempty"` - // Dolby Vision version. - DOVIVersion *string `json:"DOVIVersion,omitempty"` - // Bit depth of the video stream. - BitDepth *int `json:"bitDepth,omitempty"` - // Chroma sample location. - ChromaLocation *string `json:"chromaLocation,omitempty"` - // Chroma subsampling format. - ChromaSubsampling *string `json:"chromaSubsampling,omitempty"` - // Coded video height. - CodedHeight *int `json:"codedHeight,omitempty"` - // Coded video width. - CodedWidth *int `json:"codedWidth,omitempty"` - ClosedCaptions *bool `json:"closedCaptions,omitempty"` - // Color primaries used. - ColorPrimaries *string `json:"colorPrimaries,omitempty"` - // Color range (e.g., tv). - ColorRange *string `json:"colorRange,omitempty"` - // Color space. - ColorSpace *string `json:"colorSpace,omitempty"` - // Color transfer characteristics. - ColorTrc *string `json:"colorTrc,omitempty"` - // Frame rate of the stream. - FrameRate *float32 `json:"frameRate,omitempty"` - // Key to access this stream part. - Key *string `json:"key,omitempty"` - // Height of the video stream. - Height *int `json:"height,omitempty"` - // Video level. - Level *int `json:"level,omitempty"` - // Indicates if this is the original stream. - Original *bool `json:"original,omitempty"` - HasScalingMatrix *bool `json:"hasScalingMatrix,omitempty"` - // Video profile. - Profile *string `json:"profile,omitempty"` - ScanType *string `json:"scanType,omitempty"` - EmbeddedInVideo *string `json:"embeddedInVideo,omitempty"` - // Number of reference frames. - RefFrames *int `json:"refFrames,omitempty"` - // Width of the video stream. - Width *int `json:"width,omitempty"` - // Display title for the stream. - DisplayTitle *string `json:"displayTitle,omitempty"` - // Extended display title for the stream. - ExtendedDisplayTitle *string `json:"extendedDisplayTitle,omitempty"` - // Indicates if this stream is selected (applicable for audio streams). - Selected *bool `json:"selected,omitempty"` - Forced *bool `json:"forced,omitempty"` - // Number of audio channels (for audio streams). - Channels *int `json:"channels,omitempty"` - // Audio channel layout. - AudioChannelLayout *string `json:"audioChannelLayout,omitempty"` - // Sampling rate for the audio stream. - SamplingRate *int `json:"samplingRate,omitempty"` - // Indicates if the stream can auto-sync. - CanAutoSync *bool `json:"canAutoSync,omitempty"` - // Indicates if the stream is for the hearing impaired. - HearingImpaired *bool `json:"hearingImpaired,omitempty"` - // Indicates if the stream is a dub. - Dub *bool `json:"dub,omitempty"` - // Optional title for the stream (e.g., language variant). - Title *string `json:"title,omitempty"` -} - -func (g GetMediaMetaDataStream) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetMediaMetaDataStream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "streamType"}); err != nil { - return err - } - return nil -} - -func (g *GetMediaMetaDataStream) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataStream) GetStreamType() int64 { - return 1 -} - -func (g *GetMediaMetaDataStream) GetFormat() *string { - if g == nil { - return nil - } - return g.Format -} - -func (g *GetMediaMetaDataStream) GetDefault() *bool { - if g == nil { - return nil - } - return g.Default -} - -func (g *GetMediaMetaDataStream) GetCodec() *string { - if g == nil { - return nil - } - return g.Codec -} - -func (g *GetMediaMetaDataStream) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetMediaMetaDataStream) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetMediaMetaDataStream) GetLanguage() *string { - if g == nil { - return nil - } - return g.Language -} - -func (g *GetMediaMetaDataStream) GetLanguageTag() *string { - if g == nil { - return nil - } - return g.LanguageTag -} - -func (g *GetMediaMetaDataStream) GetLanguageCode() *string { - if g == nil { - return nil - } - return g.LanguageCode -} - -func (g *GetMediaMetaDataStream) GetHeaderCompression() *bool { - if g == nil { - return nil - } - return g.HeaderCompression -} - -func (g *GetMediaMetaDataStream) GetDOVIBLCompatID() *int { - if g == nil { - return nil - } - return g.DOVIBLCompatID -} - -func (g *GetMediaMetaDataStream) GetDOVIBLPresent() *bool { - if g == nil { - return nil - } - return g.DOVIBLPresent -} - -func (g *GetMediaMetaDataStream) GetDOVIELPresent() *bool { - if g == nil { - return nil - } - return g.DOVIELPresent -} - -func (g *GetMediaMetaDataStream) GetDOVILevel() *int { - if g == nil { - return nil - } - return g.DOVILevel -} - -func (g *GetMediaMetaDataStream) GetDOVIPresent() *bool { - if g == nil { - return nil - } - return g.DOVIPresent -} - -func (g *GetMediaMetaDataStream) GetDOVIProfile() *int { - if g == nil { - return nil - } - return g.DOVIProfile -} - -func (g *GetMediaMetaDataStream) GetDOVIRPUPresent() *bool { - if g == nil { - return nil - } - return g.DOVIRPUPresent -} - -func (g *GetMediaMetaDataStream) GetDOVIVersion() *string { - if g == nil { - return nil - } - return g.DOVIVersion -} - -func (g *GetMediaMetaDataStream) GetBitDepth() *int { - if g == nil { - return nil - } - return g.BitDepth -} - -func (g *GetMediaMetaDataStream) GetChromaLocation() *string { - if g == nil { - return nil - } - return g.ChromaLocation -} - -func (g *GetMediaMetaDataStream) GetChromaSubsampling() *string { - if g == nil { - return nil - } - return g.ChromaSubsampling -} - -func (g *GetMediaMetaDataStream) GetCodedHeight() *int { - if g == nil { - return nil - } - return g.CodedHeight -} - -func (g *GetMediaMetaDataStream) GetCodedWidth() *int { - if g == nil { - return nil - } - return g.CodedWidth -} - -func (g *GetMediaMetaDataStream) GetClosedCaptions() *bool { - if g == nil { - return nil - } - return g.ClosedCaptions -} - -func (g *GetMediaMetaDataStream) GetColorPrimaries() *string { - if g == nil { - return nil - } - return g.ColorPrimaries -} - -func (g *GetMediaMetaDataStream) GetColorRange() *string { - if g == nil { - return nil - } - return g.ColorRange -} - -func (g *GetMediaMetaDataStream) GetColorSpace() *string { - if g == nil { - return nil - } - return g.ColorSpace -} - -func (g *GetMediaMetaDataStream) GetColorTrc() *string { - if g == nil { - return nil - } - return g.ColorTrc -} - -func (g *GetMediaMetaDataStream) GetFrameRate() *float32 { - if g == nil { - return nil - } - return g.FrameRate -} - -func (g *GetMediaMetaDataStream) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetMediaMetaDataStream) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetMediaMetaDataStream) GetLevel() *int { - if g == nil { - return nil - } - return g.Level -} - -func (g *GetMediaMetaDataStream) GetOriginal() *bool { - if g == nil { - return nil - } - return g.Original -} - -func (g *GetMediaMetaDataStream) GetHasScalingMatrix() *bool { - if g == nil { - return nil - } - return g.HasScalingMatrix -} - -func (g *GetMediaMetaDataStream) GetProfile() *string { - if g == nil { - return nil - } - return g.Profile -} - -func (g *GetMediaMetaDataStream) GetScanType() *string { - if g == nil { - return nil - } - return g.ScanType -} - -func (g *GetMediaMetaDataStream) GetEmbeddedInVideo() *string { - if g == nil { - return nil - } - return g.EmbeddedInVideo -} - -func (g *GetMediaMetaDataStream) GetRefFrames() *int { - if g == nil { - return nil - } - return g.RefFrames -} - -func (g *GetMediaMetaDataStream) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetMediaMetaDataStream) GetDisplayTitle() *string { - if g == nil { - return nil - } - return g.DisplayTitle -} - -func (g *GetMediaMetaDataStream) GetExtendedDisplayTitle() *string { - if g == nil { - return nil - } - return g.ExtendedDisplayTitle -} - -func (g *GetMediaMetaDataStream) GetSelected() *bool { - if g == nil { - return nil - } - return g.Selected -} - -func (g *GetMediaMetaDataStream) GetForced() *bool { - if g == nil { - return nil - } - return g.Forced -} - -func (g *GetMediaMetaDataStream) GetChannels() *int { - if g == nil { - return nil - } - return g.Channels -} - -func (g *GetMediaMetaDataStream) GetAudioChannelLayout() *string { - if g == nil { - return nil - } - return g.AudioChannelLayout -} - -func (g *GetMediaMetaDataStream) GetSamplingRate() *int { - if g == nil { - return nil - } - return g.SamplingRate -} - -func (g *GetMediaMetaDataStream) GetCanAutoSync() *bool { - if g == nil { - return nil - } - return g.CanAutoSync -} - -func (g *GetMediaMetaDataStream) GetHearingImpaired() *bool { - if g == nil { - return nil - } - return g.HearingImpaired -} - -func (g *GetMediaMetaDataStream) GetDub() *bool { - if g == nil { - return nil - } - return g.Dub -} - -func (g *GetMediaMetaDataStream) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -type GetMediaMetaDataPart struct { - // Indicates if the part is accessible. - Accessible *bool `json:"accessible,omitempty"` - // Indicates if the part exists. - Exists *bool `json:"exists,omitempty"` - // Unique part identifier. - ID int64 `json:"id"` - // Key to access this part. - Key *string `json:"key,omitempty"` - Indexes *string `json:"indexes,omitempty"` - // Duration of the part in milliseconds. - Duration *int `json:"duration,omitempty"` - // File path for the part. - File *string `json:"file,omitempty"` - // File size in bytes. - Size *int64 `json:"size,omitempty"` - PacketLength *int `json:"packetLength,omitempty"` - // Container format of the part. - Container *string `json:"container,omitempty"` - // Video profile for the part. - VideoProfile *string `json:"videoProfile,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - // - OptimizedForStreaming *GetMediaMetaDataLibraryOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - HasThumbnail *GetMediaMetaDataHasThumbnail `default:"0" json:"hasThumbnail"` - Stream []GetMediaMetaDataStream `json:"Stream,omitempty"` -} - -func (g GetMediaMetaDataPart) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetMediaMetaDataPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id"}); err != nil { - return err - } - return nil -} - -func (g *GetMediaMetaDataPart) GetAccessible() *bool { - if g == nil { - return nil - } - return g.Accessible -} - -func (g *GetMediaMetaDataPart) GetExists() *bool { - if g == nil { - return nil - } - return g.Exists -} - -func (g *GetMediaMetaDataPart) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetMediaMetaDataPart) GetIndexes() *string { - if g == nil { - return nil - } - return g.Indexes -} - -func (g *GetMediaMetaDataPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetMediaMetaDataPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetMediaMetaDataPart) GetSize() *int64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetMediaMetaDataPart) GetPacketLength() *int { - if g == nil { - return nil - } - return g.PacketLength -} - -func (g *GetMediaMetaDataPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetMediaMetaDataPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetMediaMetaDataPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetMediaMetaDataPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetMediaMetaDataPart) GetOptimizedForStreaming() *GetMediaMetaDataLibraryOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetMediaMetaDataPart) GetHasThumbnail() *GetMediaMetaDataHasThumbnail { - if g == nil { - return nil - } - return g.HasThumbnail -} - -func (g *GetMediaMetaDataPart) GetStream() []GetMediaMetaDataStream { - if g == nil { - return nil - } - return g.Stream -} - -type GetMediaMetaDataMedia struct { - // Unique media identifier. - ID int64 `json:"id"` - // Duration of the media in milliseconds. - Duration *int `json:"duration,omitempty"` - // Bitrate in bits per second. - Bitrate *int `json:"bitrate,omitempty"` - // Video width in pixels. - Width *int `json:"width,omitempty"` - // Video height in pixels. - Height *int `json:"height,omitempty"` - // Aspect ratio of the video. - AspectRatio *float32 `json:"aspectRatio,omitempty"` - // Number of audio channels. - AudioChannels *int `json:"audioChannels,omitempty"` - DisplayOffset *int `json:"displayOffset,omitempty"` - // Audio codec used. - AudioCodec *string `json:"audioCodec,omitempty"` - // Video codec used. - VideoCodec *string `json:"videoCodec,omitempty"` - // Video resolution (e.g., 4k). - VideoResolution *string `json:"videoResolution,omitempty"` - // Container format of the media. - Container *string `json:"container,omitempty"` - // Frame rate of the video. Values found include NTSC, PAL, 24p - // - VideoFrameRate *string `json:"videoFrameRate,omitempty"` - // Video profile (e.g., main 10). - VideoProfile *string `json:"videoProfile,omitempty"` - // Indicates whether voice activity is detected. - HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *GetMediaMetaDataOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - // Indicates whether the media has 64-bit offsets. - // This is relevant for media files that may require larger offsets than what 32-bit integers can provide. - // - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - Part []GetMediaMetaDataPart `json:"Part,omitempty"` -} - -func (g *GetMediaMetaDataMedia) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetMediaMetaDataMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetMediaMetaDataMedia) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetMediaMetaDataMedia) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetMediaMetaDataMedia) GetAspectRatio() *float32 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetMediaMetaDataMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetMediaMetaDataMedia) GetDisplayOffset() *int { - if g == nil { - return nil - } - return g.DisplayOffset -} - -func (g *GetMediaMetaDataMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetMediaMetaDataMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetMediaMetaDataMedia) GetVideoResolution() *string { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetMediaMetaDataMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetMediaMetaDataMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetMediaMetaDataMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetMediaMetaDataMedia) GetHasVoiceActivity() *bool { - if g == nil { - return nil - } - return g.HasVoiceActivity -} - -func (g *GetMediaMetaDataMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetMediaMetaDataMedia) GetOptimizedForStreaming() *GetMediaMetaDataOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetMediaMetaDataMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetMediaMetaDataMedia) GetPart() []GetMediaMetaDataPart { - if g == nil { - return nil - } - return g.Part -} - -// GetMediaMetaDataGenre - The filter query string for similar items. -type GetMediaMetaDataGenre struct { - // The unique identifier for the genre. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The genre name of this media-item - // - Tag string `json:"tag"` - Filter string `json:"filter"` -} - -func (g *GetMediaMetaDataGenre) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataGenre) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetMediaMetaDataGenre) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -// GetMediaMetaDataCountry - The filter query string for country media items. -type GetMediaMetaDataCountry struct { - // The unique identifier for the country. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The country of origin of this media item - Tag string `json:"tag"` - Filter string `json:"filter"` -} - -func (g *GetMediaMetaDataCountry) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataCountry) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetMediaMetaDataCountry) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -type GetMediaMetaDataDirector struct { - // Unique identifier for the director. - ID int `json:"id"` - // The role of Director - Tag string `json:"tag"` - // The filter string used to query this director. - Filter string `json:"filter"` - // A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. - TagKey string `json:"tagKey"` - // The absolute URL of the thumbnail image for the director. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetMediaMetaDataDirector) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataDirector) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetMediaMetaDataDirector) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetMediaMetaDataDirector) GetTagKey() string { - if g == nil { - return "" - } - return g.TagKey -} - -func (g *GetMediaMetaDataDirector) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetMediaMetaDataWriter struct { - // Unique identifier for the writer. - ID int `json:"id"` - // The role of Writer - Tag string `json:"tag"` - // The filter string used to query this writer. - Filter string `json:"filter"` - // The absolute URL of the thumbnail image for the writer. - Thumb *string `json:"thumb,omitempty"` - // A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. - TagKey *string `json:"tagKey,omitempty"` -} - -func (g *GetMediaMetaDataWriter) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataWriter) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetMediaMetaDataWriter) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetMediaMetaDataWriter) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetMediaMetaDataWriter) GetTagKey() *string { - if g == nil { - return nil - } - return g.TagKey -} - -type GetMediaMetaDataProducer struct { - // The unique role identifier. - ID int64 `json:"id"` - // The filter string for the role. - Filter string `json:"filter"` - // The actor's name. - Tag string `json:"tag"` - // A key associated with the actor tag. - TagKey string `json:"tagKey"` - // The character name or role. - Role *string `json:"role,omitempty"` - // URL for the role thumbnail image. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetMediaMetaDataProducer) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataProducer) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetMediaMetaDataProducer) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetMediaMetaDataProducer) GetTagKey() string { - if g == nil { - return "" - } - return g.TagKey -} - -func (g *GetMediaMetaDataProducer) GetRole() *string { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetMediaMetaDataProducer) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetMediaMetaDataRole struct { - // The unique identifier for the role. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The display tag for the actor (typically the actor's name). - Tag string `json:"tag"` - // The role played by the actor in the media item. - Role *string `json:"role,omitempty"` - // The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. - Filter string `json:"filter"` - // A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification. - // NOTE: This is globally unique across all Plex Servers. - // - TagKey string `json:"tagKey"` - // The absolute URL of the thumbnail image for the actor. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetMediaMetaDataRole) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataRole) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetMediaMetaDataRole) GetRole() *string { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetMediaMetaDataRole) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetMediaMetaDataRole) GetTagKey() string { - if g == nil { - return "" - } - return g.TagKey -} - -func (g *GetMediaMetaDataRole) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetMediaMetaDataRatings struct { - // The image or reference for the rating. - Image string `json:"image"` - // The rating value. - Value float32 `json:"value"` - // The type of rating (e.g., audience, critic). - Type string `json:"type"` -} - -func (g *GetMediaMetaDataRatings) GetImage() string { - if g == nil { - return "" - } - return g.Image -} - -func (g *GetMediaMetaDataRatings) GetValue() float32 { - if g == nil { - return 0.0 - } - return g.Value -} - -func (g *GetMediaMetaDataRatings) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -type GetMediaMetaDataSimilar struct { - // The unique similar item identifier. - ID int64 `json:"id"` - // The filter string for similar items. - Filter string `json:"filter"` - // The tag or title of the similar content. - Tag string `json:"tag"` -} - -func (g *GetMediaMetaDataSimilar) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataSimilar) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetMediaMetaDataSimilar) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetMediaMetaDataLocation struct { - // The file path for the location. - Path string `json:"path"` -} - -func (g *GetMediaMetaDataLocation) GetPath() string { - if g == nil { - return "" - } - return g.Path -} - -// GetMediaMetaDataChapter - The thumbnail for the chapter -type GetMediaMetaDataChapter struct { - ID int64 `json:"id"` - Filter string `json:"filter"` - Index int64 `json:"index"` - StartTimeOffset int64 `json:"startTimeOffset"` - EndTimeOffset int64 `json:"endTimeOffset"` - Thumb string `json:"thumb"` -} - -func (g *GetMediaMetaDataChapter) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataChapter) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetMediaMetaDataChapter) GetIndex() int64 { - if g == nil { - return 0 - } - return g.Index -} - -func (g *GetMediaMetaDataChapter) GetStartTimeOffset() int64 { - if g == nil { - return 0 - } - return g.StartTimeOffset -} - -func (g *GetMediaMetaDataChapter) GetEndTimeOffset() int64 { - if g == nil { - return 0 - } - return g.EndTimeOffset -} - -func (g *GetMediaMetaDataChapter) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -// GetMediaMetaDataAttributes - Attributes associated with the marker. -type GetMediaMetaDataAttributes struct { - // The identifier for the attributes. - ID int64 `json:"id"` - // The version number of the marker attributes. - Version *int64 `json:"version,omitempty"` -} - -func (g *GetMediaMetaDataAttributes) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataAttributes) GetVersion() *int64 { - if g == nil { - return nil - } - return g.Version -} - -// GetMediaMetaDataMarker - The final status of the marker -type GetMediaMetaDataMarker struct { - ID int64 `json:"id"` - Type string `json:"type"` - StartTimeOffset int64 `json:"startTimeOffset"` - EndTimeOffset int64 `json:"endTimeOffset"` - Final *bool `json:"final,omitempty"` - // Attributes associated with the marker. - Attributes *GetMediaMetaDataAttributes `json:"Attributes,omitempty"` -} - -func (g *GetMediaMetaDataMarker) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetMediaMetaDataMarker) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetMediaMetaDataMarker) GetStartTimeOffset() int64 { - if g == nil { - return 0 - } - return g.StartTimeOffset -} - -func (g *GetMediaMetaDataMarker) GetEndTimeOffset() int64 { - if g == nil { - return 0 - } - return g.EndTimeOffset -} - -func (g *GetMediaMetaDataMarker) GetFinal() *bool { - if g == nil { - return nil - } - return g.Final -} - -func (g *GetMediaMetaDataMarker) GetAttributes() *GetMediaMetaDataAttributes { - if g == nil { - return nil - } - return g.Attributes -} - -type GetMediaMetaDataExtras struct { - // The size of the extras. - Size *int64 `json:"size,omitempty"` -} - -func (g *GetMediaMetaDataExtras) GetSize() *int64 { - if g == nil { - return nil - } - return g.Size -} - -// GetMediaMetaDataMetadata - Unknown -type GetMediaMetaDataMetadata struct { - // The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. - RatingKey string `json:"ratingKey"` - // The unique key for the media item. - Key string `json:"key"` - // The globally unique identifier for the media item. - GUID string `json:"guid"` - // A URL‐friendly version of the media title. - Slug string `json:"slug"` - // The studio that produced the media item. - Studio *string `json:"studio,omitempty"` - Type GetMediaMetaDataType `json:"type"` - // The title of the media item. - Title string `json:"title"` - // The sort title used for ordering media items. - TitleSort string `json:"titleSort"` - // The content rating for the media item. - ContentRating *string `json:"contentRating,omitempty"` - // A synopsis of the media item. - Summary string `json:"summary"` - // The critic rating for the media item. - Rating float32 `json:"rating"` - // The audience rating for the media item. - AudienceRating float64 `json:"audienceRating"` - // The release year of the media item. - Year *int `json:"year,omitempty"` - // A brief tagline for the media item. - Tagline string `json:"tagline"` - // The thumbnail image URL for the media item. - Thumb string `json:"thumb"` - // The art image URL for the media item. - Art string `json:"art"` - // The theme URL for the media item. - Theme string `json:"theme"` - // The index position of the media item. - Index int `json:"index"` - // The number of leaf items (end nodes) under this media item. - LeafCount *int `json:"leafCount,omitempty"` - // The number of leaf items that have been viewed. - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - // The number of child items associated with this media item. - ChildCount int `json:"childCount"` - // The total number of seasons (for TV shows). - SeasonCount int `json:"seasonCount"` - // The duration of the media item in milliseconds. - Duration int `json:"duration"` - // The original release date of the media item. - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - AddedAt int64 `json:"addedAt"` - // Unix epoch datetime in seconds - UpdatedAt *int64 `json:"updatedAt,omitempty"` - // The URL for the audience rating image. - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - // The source from which chapter data is derived. - ChapterSource *string `json:"chapterSource,omitempty"` - // The primary extra key associated with this media item. - PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` - // The original title of the media item (if different). - OriginalTitle *string `json:"originalTitle,omitempty"` - // The rating key of the parent media item. - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - // The rating key of the grandparent media item. - GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` - // The GUID of the parent media item. - ParentGUID *string `json:"parentGuid,omitempty"` - // The GUID of the grandparent media item. - GrandparentGUID *string `json:"grandparentGuid,omitempty"` - // The slug for the grandparent media item. - GrandparentSlug *string `json:"grandparentSlug,omitempty"` - // The key of the grandparent media item. - GrandparentKey *string `json:"grandparentKey,omitempty"` - // The key of the parent media item. - ParentKey *string `json:"parentKey,omitempty"` - // The title of the grandparent media item. - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - // The thumbnail URL for the grandparent media item. - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - // The theme URL for the grandparent media item. - GrandparentTheme *string `json:"grandparentTheme,omitempty"` - // The art URL for the grandparent media item. - GrandparentArt *string `json:"grandparentArt,omitempty"` - // The title of the parent media item. - ParentTitle *string `json:"parentTitle,omitempty"` - // The index position of the parent media item. - ParentIndex *int `json:"parentIndex,omitempty"` - // The thumbnail URL for the parent media item. - ParentThumb *string `json:"parentThumb,omitempty"` - // The URL for the rating image. - RatingImage *string `json:"ratingImage,omitempty"` - // The number of times this media item has been viewed. - ViewCount *int `json:"viewCount,omitempty"` - // The current playback offset (in milliseconds). - ViewOffset *int `json:"viewOffset,omitempty"` - // The number of times this media item has been skipped. - SkipCount *int `json:"skipCount,omitempty"` - // A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. - Subtype *string `json:"subtype,omitempty"` - // The Unix timestamp representing the last time the item was rated. - LastRatedAt *int64 `json:"lastRatedAt,omitempty"` - // The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). - CreatedAtAccuracy *string `json:"createdAtAccuracy,omitempty"` - // The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. - CreatedAtTZOffset *string `json:"createdAtTZOffset,omitempty"` - // Unix timestamp for when the media item was last viewed. - LastViewedAt *int `json:"lastViewedAt,omitempty"` - // The rating provided by a user for the item. This value is expressed as a decimal number. - UserRating *float32 `json:"userRating,omitempty"` - Image []GetMediaMetaDataImage `json:"Image,omitempty"` - UltraBlurColors *GetMediaMetaDataUltraBlurColors `json:"UltraBlurColors,omitempty"` - // The identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The key corresponding to the library section. - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - Guids []GetMediaMetaDataGuids `json:"Guid,omitempty"` - Media []GetMediaMetaDataMedia `json:"Media,omitempty"` - Genre []GetMediaMetaDataGenre `json:"Genre,omitempty"` - Country []GetMediaMetaDataCountry `json:"Country,omitempty"` - Director []GetMediaMetaDataDirector `json:"Director,omitempty"` - Writer []GetMediaMetaDataWriter `json:"Writer,omitempty"` - Producer []GetMediaMetaDataProducer `json:"Producer,omitempty"` - Role []GetMediaMetaDataRole `json:"Role,omitempty"` - Ratings []GetMediaMetaDataRatings `json:"Rating,omitempty"` - Similar []GetMediaMetaDataSimilar `json:"Similar,omitempty"` - Location []GetMediaMetaDataLocation `json:"Location,omitempty"` - Chapter []GetMediaMetaDataChapter `json:"Chapter,omitempty"` - Marker []GetMediaMetaDataMarker `json:"Marker,omitempty"` - Extras *GetMediaMetaDataExtras `json:"Extras,omitempty"` -} - -func (g GetMediaMetaDataMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetMediaMetaDataMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { - return err - } - return nil -} - -func (g *GetMediaMetaDataMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetMediaMetaDataMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetMediaMetaDataMetadata) GetGUID() string { - if g == nil { - return "" - } - return g.GUID -} - -func (g *GetMediaMetaDataMetadata) GetSlug() string { - if g == nil { - return "" - } - return g.Slug -} - -func (g *GetMediaMetaDataMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetMediaMetaDataMetadata) GetType() GetMediaMetaDataType { - if g == nil { - return GetMediaMetaDataType("") - } - return g.Type -} - -func (g *GetMediaMetaDataMetadata) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetMediaMetaDataMetadata) GetTitleSort() string { - if g == nil { - return "" - } - return g.TitleSort -} - -func (g *GetMediaMetaDataMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetMediaMetaDataMetadata) GetSummary() string { - if g == nil { - return "" - } - return g.Summary -} - -func (g *GetMediaMetaDataMetadata) GetRating() float32 { - if g == nil { - return 0.0 - } - return g.Rating -} - -func (g *GetMediaMetaDataMetadata) GetAudienceRating() float64 { - if g == nil { - return 0.0 - } - return g.AudienceRating -} - -func (g *GetMediaMetaDataMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetMediaMetaDataMetadata) GetTagline() string { - if g == nil { - return "" - } - return g.Tagline -} - -func (g *GetMediaMetaDataMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetMediaMetaDataMetadata) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetMediaMetaDataMetadata) GetTheme() string { - if g == nil { - return "" - } - return g.Theme -} - -func (g *GetMediaMetaDataMetadata) GetIndex() int { - if g == nil { - return 0 - } - return g.Index -} - -func (g *GetMediaMetaDataMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetMediaMetaDataMetadata) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetMediaMetaDataMetadata) GetChildCount() int { - if g == nil { - return 0 - } - return g.ChildCount -} - -func (g *GetMediaMetaDataMetadata) GetSeasonCount() int { - if g == nil { - return 0 - } - return g.SeasonCount -} - -func (g *GetMediaMetaDataMetadata) GetDuration() int { - if g == nil { - return 0 - } - return g.Duration -} - -func (g *GetMediaMetaDataMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetMediaMetaDataMetadata) GetAddedAt() int64 { - if g == nil { - return 0 - } - return g.AddedAt -} - -func (g *GetMediaMetaDataMetadata) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetMediaMetaDataMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetMediaMetaDataMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetMediaMetaDataMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetMediaMetaDataMetadata) GetOriginalTitle() *string { - if g == nil { - return nil - } - return g.OriginalTitle -} - -func (g *GetMediaMetaDataMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentRatingKey() *string { - if g == nil { - return nil - } - return g.GrandparentRatingKey -} - -func (g *GetMediaMetaDataMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentGUID() *string { - if g == nil { - return nil - } - return g.GrandparentGUID -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentSlug() *string { - if g == nil { - return nil - } - return g.GrandparentSlug -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetMediaMetaDataMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentTheme() *string { - if g == nil { - return nil - } - return g.GrandparentTheme -} - -func (g *GetMediaMetaDataMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetMediaMetaDataMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetMediaMetaDataMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetMediaMetaDataMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetMediaMetaDataMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetMediaMetaDataMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetMediaMetaDataMetadata) GetViewOffset() *int { - if g == nil { - return nil - } - return g.ViewOffset -} - -func (g *GetMediaMetaDataMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetMediaMetaDataMetadata) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetMediaMetaDataMetadata) GetLastRatedAt() *int64 { - if g == nil { - return nil - } - return g.LastRatedAt -} - -func (g *GetMediaMetaDataMetadata) GetCreatedAtAccuracy() *string { - if g == nil { - return nil - } - return g.CreatedAtAccuracy -} - -func (g *GetMediaMetaDataMetadata) GetCreatedAtTZOffset() *string { - if g == nil { - return nil - } - return g.CreatedAtTZOffset -} - -func (g *GetMediaMetaDataMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetMediaMetaDataMetadata) GetUserRating() *float32 { - if g == nil { - return nil - } - return g.UserRating -} - -func (g *GetMediaMetaDataMetadata) GetImage() []GetMediaMetaDataImage { - if g == nil { - return nil - } - return g.Image -} - -func (g *GetMediaMetaDataMetadata) GetUltraBlurColors() *GetMediaMetaDataUltraBlurColors { - if g == nil { - return nil - } - return g.UltraBlurColors -} - -func (g *GetMediaMetaDataMetadata) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetMediaMetaDataMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetMediaMetaDataMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetMediaMetaDataMetadata) GetGuids() []GetMediaMetaDataGuids { - if g == nil { - return nil - } - return g.Guids -} - -func (g *GetMediaMetaDataMetadata) GetMedia() []GetMediaMetaDataMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetMediaMetaDataMetadata) GetGenre() []GetMediaMetaDataGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetMediaMetaDataMetadata) GetCountry() []GetMediaMetaDataCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetMediaMetaDataMetadata) GetDirector() []GetMediaMetaDataDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetMediaMetaDataMetadata) GetWriter() []GetMediaMetaDataWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetMediaMetaDataMetadata) GetProducer() []GetMediaMetaDataProducer { - if g == nil { - return nil - } - return g.Producer -} - -func (g *GetMediaMetaDataMetadata) GetRole() []GetMediaMetaDataRole { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetMediaMetaDataMetadata) GetRatings() []GetMediaMetaDataRatings { - if g == nil { - return nil - } - return g.Ratings -} - -func (g *GetMediaMetaDataMetadata) GetSimilar() []GetMediaMetaDataSimilar { - if g == nil { - return nil - } - return g.Similar -} - -func (g *GetMediaMetaDataMetadata) GetLocation() []GetMediaMetaDataLocation { - if g == nil { - return nil - } - return g.Location -} - -func (g *GetMediaMetaDataMetadata) GetChapter() []GetMediaMetaDataChapter { - if g == nil { - return nil - } - return g.Chapter -} - -func (g *GetMediaMetaDataMetadata) GetMarker() []GetMediaMetaDataMarker { - if g == nil { - return nil - } - return g.Marker -} - -func (g *GetMediaMetaDataMetadata) GetExtras() *GetMediaMetaDataExtras { - if g == nil { - return nil - } - return g.Extras -} - -type GetMediaMetaDataMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The unique identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The universally unique identifier for the library section. - LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // An array of metadata items. - Metadata []GetMediaMetaDataMetadata `json:"Metadata"` -} - -func (g *GetMediaMetaDataMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetMediaMetaDataMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetMediaMetaDataMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetMediaMetaDataMediaContainer) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetMediaMetaDataMediaContainer) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetMediaMetaDataMediaContainer) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetMediaMetaDataMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetMediaMetaDataMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetMediaMetaDataMediaContainer) GetMetadata() []GetMediaMetaDataMetadata { - if g == nil { - return []GetMediaMetaDataMetadata{} - } - return g.Metadata -} - -// GetMediaMetaDataResponseBody - The metadata of the library item. -type GetMediaMetaDataResponseBody struct { - MediaContainer *GetMediaMetaDataMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetMediaMetaDataResponseBody) GetMediaContainer() *GetMediaMetaDataMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetMediaMetaDataResponse 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 metadata of the library item. - Object *GetMediaMetaDataResponseBody -} - -func (g *GetMediaMetaDataResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetMediaMetaDataResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetMediaMetaDataResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetMediaMetaDataResponse) GetObject() *GetMediaMetaDataResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getmediapart.go b/models/operations/getmediapart.go new file mode 100644 index 0000000..0f833e3 --- /dev/null +++ b/models/operations/getmediapart.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetMediaPartGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetMediaPartGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetMediaPartGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetMediaPartGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetMediaPartGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetMediaPartGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetMediaPartGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetMediaPartGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetMediaPartGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetMediaPartGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetMediaPartGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetMediaPartGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetMediaPartGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetMediaPartGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetMediaPartRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The part id who's index is to be fetched + PartID int64 `pathParam:"style=simple,explode=false,name=partId"` + // The changestamp of the part; used for busting potential caches. Provided in the `key` for the part + Changestamp int64 `pathParam:"style=simple,explode=false,name=changestamp"` + // A generic filename used for a client media stack which relies on the extension in the request. Provided in the `key` for the part + Filename string `pathParam:"style=simple,explode=false,name=filename"` + // Whether this is a file download + Download *components.BoolInt `queryParam:"style=form,explode=true,name=download"` +} + +func (g GetMediaPartRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetMediaPartRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"partId", "changestamp", "filename"}); err != nil { + return err + } + return nil +} + +func (g *GetMediaPartRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetMediaPartRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetMediaPartRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetMediaPartRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetMediaPartRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetMediaPartRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetMediaPartRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetMediaPartRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetMediaPartRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetMediaPartRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetMediaPartRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetMediaPartRequest) GetPartID() int64 { + if g == nil { + return 0 + } + return g.PartID +} + +func (g *GetMediaPartRequest) GetChangestamp() int64 { + if g == nil { + return 0 + } + return g.Changestamp +} + +func (g *GetMediaPartRequest) GetFilename() string { + if g == nil { + return "" + } + return g.Filename +} + +func (g *GetMediaPartRequest) GetDownload() *components.BoolInt { + if g == nil { + return nil + } + return g.Download +} + +type GetMediaPartResponse 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 + Headers map[string][]string +} + +func (g *GetMediaPartResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetMediaPartResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetMediaPartResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetMediaPartResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getmediaposters.go b/models/operations/getmediaposters.go deleted file mode 100644 index fb41a6f..0000000 --- a/models/operations/getmediaposters.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type GetMediaPostersRequest struct { - // the id of the library item to return the posters of. - RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"` -} - -func (g *GetMediaPostersRequest) GetRatingKey() int64 { - if g == nil { - return 0 - } - return g.RatingKey -} - -type GetMediaPostersMetadata struct { - // The URL of the poster. - Key string `json:"key"` - // The provider of the poster. - Provider *string `json:"provider,omitempty"` - // The URL of the poster. - RatingKey string `json:"ratingKey"` - // Whether this is the selected poster. - Selected bool `json:"selected"` - // The URL of the poster thumbnail. - Thumb string `json:"thumb"` -} - -func (g *GetMediaPostersMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetMediaPostersMetadata) GetProvider() *string { - if g == nil { - return nil - } - return g.Provider -} - -func (g *GetMediaPostersMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetMediaPostersMetadata) GetSelected() bool { - if g == nil { - return false - } - return g.Selected -} - -func (g *GetMediaPostersMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -type GetMediaPostersMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - Metadata []GetMediaPostersMetadata `json:"Metadata"` -} - -func (g *GetMediaPostersMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetMediaPostersMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetMediaPostersMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetMediaPostersMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetMediaPostersMediaContainer) GetMetadata() []GetMediaPostersMetadata { - if g == nil { - return []GetMediaPostersMetadata{} - } - return g.Metadata -} - -// GetMediaPostersResponseBody - The available posters for the library item. -type GetMediaPostersResponseBody struct { - MediaContainer *GetMediaPostersMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetMediaPostersResponseBody) GetMediaContainer() *GetMediaPostersMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetMediaPostersResponse 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 available posters for the library item. - Object *GetMediaPostersResponseBody -} - -func (g *GetMediaPostersResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetMediaPostersResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetMediaPostersResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetMediaPostersResponse) GetObject() *GetMediaPostersResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getmediaproviders.go b/models/operations/getmediaproviders.go deleted file mode 100644 index 4ac9968..0000000 --- a/models/operations/getmediaproviders.go +++ /dev/null @@ -1,712 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type GetMediaProvidersRequest struct { - // An authentication token, obtained from plex.tv - XPlexToken string `header:"style=simple,explode=false,name=X-Plex-Token"` -} - -func (g *GetMediaProvidersRequest) GetXPlexToken() string { - if g == nil { - return "" - } - return g.XPlexToken -} - -type Pivot struct { - ID *string `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - Context *string `json:"context,omitempty"` - Symbol *string `json:"symbol,omitempty"` -} - -func (p *Pivot) GetID() *string { - if p == nil { - return nil - } - return p.ID -} - -func (p *Pivot) GetKey() *string { - if p == nil { - return nil - } - return p.Key -} - -func (p *Pivot) GetType() *string { - if p == nil { - return nil - } - return p.Type -} - -func (p *Pivot) GetTitle() *string { - if p == nil { - return nil - } - return p.Title -} - -func (p *Pivot) GetContext() *string { - if p == nil { - return nil - } - return p.Context -} - -func (p *Pivot) GetSymbol() *string { - if p == nil { - return nil - } - return p.Symbol -} - -type GetMediaProvidersDirectory struct { - HubKey *string `json:"hubKey,omitempty"` - Title *string `json:"title,omitempty"` - Agent *string `json:"agent,omitempty"` - Language *string `json:"language,omitempty"` - Refreshing *bool `json:"refreshing,omitempty"` - Scanner *string `json:"scanner,omitempty"` - UUID *string `json:"uuid,omitempty"` - ID *string `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Type *string `json:"type,omitempty"` - Subtype *string `json:"subtype,omitempty"` - UpdatedAt *int64 `json:"updatedAt,omitempty"` - ScannedAt *int64 `json:"scannedAt,omitempty"` - Pivot []Pivot `json:"Pivot,omitempty"` -} - -func (g *GetMediaProvidersDirectory) GetHubKey() *string { - if g == nil { - return nil - } - return g.HubKey -} - -func (g *GetMediaProvidersDirectory) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetMediaProvidersDirectory) GetAgent() *string { - if g == nil { - return nil - } - return g.Agent -} - -func (g *GetMediaProvidersDirectory) GetLanguage() *string { - if g == nil { - return nil - } - return g.Language -} - -func (g *GetMediaProvidersDirectory) GetRefreshing() *bool { - if g == nil { - return nil - } - return g.Refreshing -} - -func (g *GetMediaProvidersDirectory) GetScanner() *string { - if g == nil { - return nil - } - return g.Scanner -} - -func (g *GetMediaProvidersDirectory) GetUUID() *string { - if g == nil { - return nil - } - return g.UUID -} - -func (g *GetMediaProvidersDirectory) GetID() *string { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetMediaProvidersDirectory) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetMediaProvidersDirectory) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetMediaProvidersDirectory) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetMediaProvidersDirectory) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetMediaProvidersDirectory) GetScannedAt() *int64 { - if g == nil { - return nil - } - return g.ScannedAt -} - -func (g *GetMediaProvidersDirectory) GetPivot() []Pivot { - if g == nil { - return nil - } - return g.Pivot -} - -type Action struct { - ID string `json:"id"` - Key string `json:"key"` -} - -func (a *Action) GetID() string { - if a == nil { - return "" - } - return a.ID -} - -func (a *Action) GetKey() string { - if a == nil { - return "" - } - return a.Key -} - -type Feature struct { - Key *string `json:"key,omitempty"` - Type string `json:"type"` - Flavor *string `json:"flavor,omitempty"` - ScrobbleKey *string `json:"scrobbleKey,omitempty"` - UnscrobbleKey *string `json:"unscrobbleKey,omitempty"` - Directory []GetMediaProvidersDirectory `json:"Directory,omitempty"` - Action []Action `json:"Action,omitempty"` -} - -func (f *Feature) GetKey() *string { - if f == nil { - return nil - } - return f.Key -} - -func (f *Feature) GetType() string { - if f == nil { - return "" - } - return f.Type -} - -func (f *Feature) GetFlavor() *string { - if f == nil { - return nil - } - return f.Flavor -} - -func (f *Feature) GetScrobbleKey() *string { - if f == nil { - return nil - } - return f.ScrobbleKey -} - -func (f *Feature) GetUnscrobbleKey() *string { - if f == nil { - return nil - } - return f.UnscrobbleKey -} - -func (f *Feature) GetDirectory() []GetMediaProvidersDirectory { - if f == nil { - return nil - } - return f.Directory -} - -func (f *Feature) GetAction() []Action { - if f == nil { - return nil - } - return f.Action -} - -type MediaProvider struct { - Identifier *string `json:"identifier,omitempty"` - Title *string `json:"title,omitempty"` - Types *string `json:"types,omitempty"` - Protocols *string `json:"protocols,omitempty"` - Feature []Feature `json:"Feature,omitempty"` -} - -func (m *MediaProvider) GetIdentifier() *string { - if m == nil { - return nil - } - return m.Identifier -} - -func (m *MediaProvider) GetTitle() *string { - if m == nil { - return nil - } - return m.Title -} - -func (m *MediaProvider) GetTypes() *string { - if m == nil { - return nil - } - return m.Types -} - -func (m *MediaProvider) GetProtocols() *string { - if m == nil { - return nil - } - return m.Protocols -} - -func (m *MediaProvider) GetFeature() []Feature { - if m == nil { - return nil - } - return m.Feature -} - -type GetMediaProvidersMediaContainer struct { - Size *int64 `json:"size,omitempty"` - AllowCameraUpload *bool `json:"allowCameraUpload,omitempty"` - AllowChannelAccess *bool `json:"allowChannelAccess,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"` - Livetv *int64 `json:"livetv,omitempty"` - MachineIdentifier *string `json:"machineIdentifier,omitempty"` - MusicAnalysis *int64 `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 *int64 `json:"offlineTranscode,omitempty"` - OwnerFeatures *string `json:"ownerFeatures,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 *int64 `json:"streamingBrainABRVersion,omitempty"` - StreamingBrainVersion *int64 `json:"streamingBrainVersion,omitempty"` - Sync *bool `json:"sync,omitempty"` - TranscoderActiveVideoSessions *int64 `json:"transcoderActiveVideoSessions,omitempty"` - TranscoderAudio *bool `json:"transcoderAudio,omitempty"` - TranscoderLyrics *bool `json:"transcoderLyrics,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 *int64 `json:"updatedAt,omitempty"` - Updater *bool `json:"updater,omitempty"` - Version *string `json:"version,omitempty"` - VoiceSearch *bool `json:"voiceSearch,omitempty"` - MediaProvider []MediaProvider `json:"MediaProvider,omitempty"` -} - -func (g *GetMediaProvidersMediaContainer) GetSize() *int64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetMediaProvidersMediaContainer) GetAllowCameraUpload() *bool { - if g == nil { - return nil - } - return g.AllowCameraUpload -} - -func (g *GetMediaProvidersMediaContainer) GetAllowChannelAccess() *bool { - if g == nil { - return nil - } - return g.AllowChannelAccess -} - -func (g *GetMediaProvidersMediaContainer) GetAllowSharing() *bool { - if g == nil { - return nil - } - return g.AllowSharing -} - -func (g *GetMediaProvidersMediaContainer) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetMediaProvidersMediaContainer) GetAllowTuners() *bool { - if g == nil { - return nil - } - return g.AllowTuners -} - -func (g *GetMediaProvidersMediaContainer) GetBackgroundProcessing() *bool { - if g == nil { - return nil - } - return g.BackgroundProcessing -} - -func (g *GetMediaProvidersMediaContainer) GetCertificate() *bool { - if g == nil { - return nil - } - return g.Certificate -} - -func (g *GetMediaProvidersMediaContainer) GetCompanionProxy() *bool { - if g == nil { - return nil - } - return g.CompanionProxy -} - -func (g *GetMediaProvidersMediaContainer) GetCountryCode() *string { - if g == nil { - return nil - } - return g.CountryCode -} - -func (g *GetMediaProvidersMediaContainer) GetDiagnostics() *string { - if g == nil { - return nil - } - return g.Diagnostics -} - -func (g *GetMediaProvidersMediaContainer) GetEventStream() *bool { - if g == nil { - return nil - } - return g.EventStream -} - -func (g *GetMediaProvidersMediaContainer) GetFriendlyName() *string { - if g == nil { - return nil - } - return g.FriendlyName -} - -func (g *GetMediaProvidersMediaContainer) GetLivetv() *int64 { - if g == nil { - return nil - } - return g.Livetv -} - -func (g *GetMediaProvidersMediaContainer) GetMachineIdentifier() *string { - if g == nil { - return nil - } - return g.MachineIdentifier -} - -func (g *GetMediaProvidersMediaContainer) GetMusicAnalysis() *int64 { - if g == nil { - return nil - } - return g.MusicAnalysis -} - -func (g *GetMediaProvidersMediaContainer) GetMyPlex() *bool { - if g == nil { - return nil - } - return g.MyPlex -} - -func (g *GetMediaProvidersMediaContainer) GetMyPlexMappingState() *string { - if g == nil { - return nil - } - return g.MyPlexMappingState -} - -func (g *GetMediaProvidersMediaContainer) GetMyPlexSigninState() *string { - if g == nil { - return nil - } - return g.MyPlexSigninState -} - -func (g *GetMediaProvidersMediaContainer) GetMyPlexSubscription() *bool { - if g == nil { - return nil - } - return g.MyPlexSubscription -} - -func (g *GetMediaProvidersMediaContainer) GetMyPlexUsername() *string { - if g == nil { - return nil - } - return g.MyPlexUsername -} - -func (g *GetMediaProvidersMediaContainer) GetOfflineTranscode() *int64 { - if g == nil { - return nil - } - return g.OfflineTranscode -} - -func (g *GetMediaProvidersMediaContainer) GetOwnerFeatures() *string { - if g == nil { - return nil - } - return g.OwnerFeatures -} - -func (g *GetMediaProvidersMediaContainer) GetPlatform() *string { - if g == nil { - return nil - } - return g.Platform -} - -func (g *GetMediaProvidersMediaContainer) GetPlatformVersion() *string { - if g == nil { - return nil - } - return g.PlatformVersion -} - -func (g *GetMediaProvidersMediaContainer) GetPluginHost() *bool { - if g == nil { - return nil - } - return g.PluginHost -} - -func (g *GetMediaProvidersMediaContainer) GetPushNotifications() *bool { - if g == nil { - return nil - } - return g.PushNotifications -} - -func (g *GetMediaProvidersMediaContainer) GetReadOnlyLibraries() *bool { - if g == nil { - return nil - } - return g.ReadOnlyLibraries -} - -func (g *GetMediaProvidersMediaContainer) GetStreamingBrainABRVersion() *int64 { - if g == nil { - return nil - } - return g.StreamingBrainABRVersion -} - -func (g *GetMediaProvidersMediaContainer) GetStreamingBrainVersion() *int64 { - if g == nil { - return nil - } - return g.StreamingBrainVersion -} - -func (g *GetMediaProvidersMediaContainer) GetSync() *bool { - if g == nil { - return nil - } - return g.Sync -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderActiveVideoSessions() *int64 { - if g == nil { - return nil - } - return g.TranscoderActiveVideoSessions -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderAudio() *bool { - if g == nil { - return nil - } - return g.TranscoderAudio -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderLyrics() *bool { - if g == nil { - return nil - } - return g.TranscoderLyrics -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderSubtitles() *bool { - if g == nil { - return nil - } - return g.TranscoderSubtitles -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderVideo() *bool { - if g == nil { - return nil - } - return g.TranscoderVideo -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderVideoBitrates() *string { - if g == nil { - return nil - } - return g.TranscoderVideoBitrates -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderVideoQualities() *string { - if g == nil { - return nil - } - return g.TranscoderVideoQualities -} - -func (g *GetMediaProvidersMediaContainer) GetTranscoderVideoResolutions() *string { - if g == nil { - return nil - } - return g.TranscoderVideoResolutions -} - -func (g *GetMediaProvidersMediaContainer) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetMediaProvidersMediaContainer) GetUpdater() *bool { - if g == nil { - return nil - } - return g.Updater -} - -func (g *GetMediaProvidersMediaContainer) GetVersion() *string { - if g == nil { - return nil - } - return g.Version -} - -func (g *GetMediaProvidersMediaContainer) GetVoiceSearch() *bool { - if g == nil { - return nil - } - return g.VoiceSearch -} - -func (g *GetMediaProvidersMediaContainer) GetMediaProvider() []MediaProvider { - if g == nil { - return nil - } - return g.MediaProvider -} - -// GetMediaProvidersResponseBody - Media providers and their features -type GetMediaProvidersResponseBody struct { - MediaContainer *GetMediaProvidersMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetMediaProvidersResponseBody) GetMediaContainer() *GetMediaProvidersMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetMediaProvidersResponse 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 - // Media providers and their features - Object *GetMediaProvidersResponseBody -} - -func (g *GetMediaProvidersResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetMediaProvidersResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetMediaProvidersResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetMediaProvidersResponse) GetObject() *GetMediaProvidersResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getmetadatachildren.go b/models/operations/getmetadatachildren.go deleted file mode 100644 index 1e007c8..0000000 --- a/models/operations/getmetadatachildren.go +++ /dev/null @@ -1,529 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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"` - // Adds additional elements to the response. Supported types are (Stream) - // - IncludeElements *string `queryParam:"style=form,explode=true,name=includeElements"` -} - -func (g *GetMetadataChildrenRequest) GetRatingKey() float64 { - if g == nil { - return 0.0 - } - return g.RatingKey -} - -func (g *GetMetadataChildrenRequest) GetIncludeElements() *string { - if g == nil { - return nil - } - return g.IncludeElements -} - -type GetMetadataChildrenDirectory struct { - LeafCount *int `json:"leafCount,omitempty"` - Thumb *string `json:"thumb,omitempty"` - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (g *GetMetadataChildrenDirectory) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetMetadataChildrenDirectory) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetMetadataChildrenDirectory) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetMetadataChildrenDirectory) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetMetadataChildrenDirectory) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -type GetMetadataChildrenMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - GUID *string `json:"guid,omitempty"` - ParentGUID *string `json:"parentGuid,omitempty"` - ParentStudio *string `json:"parentStudio,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - ParentKey *string `json:"parentKey,omitempty"` - ParentTitle *string `json:"parentTitle,omitempty"` - Summary *string `json:"summary,omitempty"` - Index *int `json:"index,omitempty"` - ParentIndex *int `json:"parentIndex,omitempty"` - ViewCount *int `json:"viewCount,omitempty"` - LastViewedAt *int `json:"lastViewedAt,omitempty"` - ParentYear *int `json:"parentYear,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Art *string `json:"art,omitempty"` - ParentThumb *string `json:"parentThumb,omitempty"` - ParentTheme *string `json:"parentTheme,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` - UserRating *int `json:"userRating,omitempty"` - SkipCount *int `json:"skipCount,omitempty"` - LastRatedAt *int `json:"lastRatedAt,omitempty"` -} - -func (g *GetMetadataChildrenMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetMetadataChildrenMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetMetadataChildrenMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetMetadataChildrenMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetMetadataChildrenMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetMetadataChildrenMetadata) GetParentStudio() *string { - if g == nil { - return nil - } - return g.ParentStudio -} - -func (g *GetMetadataChildrenMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetMetadataChildrenMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetMetadataChildrenMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetMetadataChildrenMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetMetadataChildrenMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetMetadataChildrenMetadata) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetMetadataChildrenMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetMetadataChildrenMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetMetadataChildrenMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetMetadataChildrenMetadata) GetParentYear() *int { - if g == nil { - return nil - } - return g.ParentYear -} - -func (g *GetMetadataChildrenMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetMetadataChildrenMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetMetadataChildrenMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetMetadataChildrenMetadata) GetParentTheme() *string { - if g == nil { - return nil - } - return g.ParentTheme -} - -func (g *GetMetadataChildrenMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetMetadataChildrenMetadata) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetMetadataChildrenMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetMetadataChildrenMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetMetadataChildrenMetadata) GetUserRating() *int { - if g == nil { - return nil - } - return g.UserRating -} - -func (g *GetMetadataChildrenMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetMetadataChildrenMetadata) GetLastRatedAt() *int { - if g == nil { - return nil - } - return g.LastRatedAt -} - -type GetMetadataChildrenMediaContainer struct { - Size *int `json:"size,omitempty"` - AllowSync *bool `json:"allowSync,omitempty"` - Art *string `json:"art,omitempty"` - Identifier *string `json:"identifier,omitempty"` - Key *string `json:"key,omitempty"` - LibrarySectionID *int `json:"librarySectionID,omitempty"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` - MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` - MediaTagVersion *int `json:"mediaTagVersion,omitempty"` - Nocache *bool `json:"nocache,omitempty"` - ParentIndex *int `json:"parentIndex,omitempty"` - ParentTitle *string `json:"parentTitle,omitempty"` - ParentYear *int `json:"parentYear,omitempty"` - Summary *string `json:"summary,omitempty"` - Theme *string `json:"theme,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Title1 *string `json:"title1,omitempty"` - Title2 *string `json:"title2,omitempty"` - ViewGroup *string `json:"viewGroup,omitempty"` - ViewMode *int `json:"viewMode,omitempty"` - Directory []GetMetadataChildrenDirectory `json:"Directory,omitempty"` - Metadata []GetMetadataChildrenMetadata `json:"Metadata,omitempty"` -} - -func (g *GetMetadataChildrenMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetMetadataChildrenMediaContainer) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetMetadataChildrenMediaContainer) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetMetadataChildrenMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetMetadataChildrenMediaContainer) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetMetadataChildrenMediaContainer) GetLibrarySectionID() *int { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetMetadataChildrenMediaContainer) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetMetadataChildrenMediaContainer) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetMetadataChildrenMediaContainer) GetMediaTagPrefix() *string { - if g == nil { - return nil - } - return g.MediaTagPrefix -} - -func (g *GetMetadataChildrenMediaContainer) GetMediaTagVersion() *int { - if g == nil { - return nil - } - return g.MediaTagVersion -} - -func (g *GetMetadataChildrenMediaContainer) GetNocache() *bool { - if g == nil { - return nil - } - return g.Nocache -} - -func (g *GetMetadataChildrenMediaContainer) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetMetadataChildrenMediaContainer) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetMetadataChildrenMediaContainer) GetParentYear() *int { - if g == nil { - return nil - } - return g.ParentYear -} - -func (g *GetMetadataChildrenMediaContainer) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetMetadataChildrenMediaContainer) GetTheme() *string { - if g == nil { - return nil - } - return g.Theme -} - -func (g *GetMetadataChildrenMediaContainer) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetMetadataChildrenMediaContainer) GetTitle1() *string { - if g == nil { - return nil - } - return g.Title1 -} - -func (g *GetMetadataChildrenMediaContainer) GetTitle2() *string { - if g == nil { - return nil - } - return g.Title2 -} - -func (g *GetMetadataChildrenMediaContainer) GetViewGroup() *string { - if g == nil { - return nil - } - return g.ViewGroup -} - -func (g *GetMetadataChildrenMediaContainer) GetViewMode() *int { - if g == nil { - return nil - } - return g.ViewMode -} - -func (g *GetMetadataChildrenMediaContainer) GetDirectory() []GetMetadataChildrenDirectory { - if g == nil { - return nil - } - return g.Directory -} - -func (g *GetMetadataChildrenMediaContainer) GetMetadata() []GetMetadataChildrenMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetMetadataChildrenResponseBody - The children of the library item. -type GetMetadataChildrenResponseBody struct { - MediaContainer *GetMetadataChildrenMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetMetadataChildrenResponseBody) GetMediaContainer() *GetMetadataChildrenMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // The children of the library item. - Object *GetMetadataChildrenResponseBody -} - -func (g *GetMetadataChildrenResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetMetadataChildrenResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetMetadataChildrenResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetMetadataChildrenResponse) GetObject() *GetMetadataChildrenResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getmetadatahubs.go b/models/operations/getmetadatahubs.go new file mode 100644 index 0000000..886e3ae --- /dev/null +++ b/models/operations/getmetadatahubs.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetMetadataHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetMetadataHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetMetadataHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetMetadataHubsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetMetadataHubsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetMetadataHubsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetMetadataHubsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetMetadataHubsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetMetadataHubsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetMetadataHubsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetMetadataHubsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetMetadataHubsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetMetadataHubsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetMetadataHubsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetMetadataHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The metadata ID for the hubs to fetch + MetadataID int64 `pathParam:"style=simple,explode=false,name=metadataId"` + // Limit results to count items + Count *int64 `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 *components.BoolInt `queryParam:"style=form,explode=true,name=onlyTransient"` +} + +func (g GetMetadataHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetMetadataHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"metadataId"}); err != nil { + return err + } + return nil +} + +func (g *GetMetadataHubsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetMetadataHubsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetMetadataHubsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetMetadataHubsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetMetadataHubsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetMetadataHubsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetMetadataHubsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetMetadataHubsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetMetadataHubsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetMetadataHubsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetMetadataHubsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetMetadataHubsRequest) GetMetadataID() int64 { + if g == nil { + return 0 + } + return g.MetadataID +} + +func (g *GetMetadataHubsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetMetadataHubsRequest) GetOnlyTransient() *components.BoolInt { + if g == nil { + return nil + } + return g.OnlyTransient +} + +type GetMetadataHubsResponse 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 + // OK + MediaContainerWithHubs *components.MediaContainerWithHubs + Headers map[string][]string +} + +func (g *GetMetadataHubsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetMetadataHubsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetMetadataHubsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetMetadataHubsResponse) GetMediaContainerWithHubs() *components.MediaContainerWithHubs { + if g == nil { + return nil + } + return g.MediaContainerWithHubs +} + +func (g *GetMetadataHubsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getmetadataitem.go b/models/operations/getmetadataitem.go new file mode 100644 index 0000000..ff7482a --- /dev/null +++ b/models/operations/getmetadataitem.go @@ -0,0 +1,362 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetMetadataItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetMetadataItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetMetadataItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetMetadataItemGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetMetadataItemGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetMetadataItemGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetMetadataItemGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetMetadataItemGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetMetadataItemGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetMetadataItemGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetMetadataItemGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetMetadataItemGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetMetadataItemGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetMetadataItemGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetMetadataItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids []string `pathParam:"style=simple,explode=false,name=ids"` + // Determines if file check should be performed asynchronously. An activity is created to indicate progress. Default is false. + AsyncCheckFiles *components.BoolInt `queryParam:"style=form,explode=true,name=asyncCheckFiles"` + // Determines if local media agent refresh should be performed asynchronously. An activity is created to indicate progress. Default is false. + AsyncRefreshLocalMediaAgent *components.BoolInt `queryParam:"style=form,explode=true,name=asyncRefreshLocalMediaAgent"` + // Determines if analysis refresh should be performed asynchronously. An activity is created to indicate progress. Default is false. + AsyncRefreshAnalysis *components.BoolInt `queryParam:"style=form,explode=true,name=asyncRefreshAnalysis"` + // Determines if file check should be performed synchronously. Specifying `asyncCheckFiles` will cause this option to be ignored. Default is false. + CheckFiles *components.BoolInt `queryParam:"style=form,explode=true,name=checkFiles"` + // Determines if synchronous local media agent and analysis refresh should be skipped. Specifying async versions will cause synchronous versions to be skipped. Default is false. + SkipRefresh *components.BoolInt `queryParam:"style=form,explode=true,name=skipRefresh"` + // Determines if file existence check should be performed synchronously. Specifying `checkFiles` will imply this option. Default is false. + CheckFileAvailability *components.BoolInt `queryParam:"style=form,explode=true,name=checkFileAvailability"` + // Add metadata augmentations. An activity is created to indicate progress. Option will be ignored if specified by non-admin or if multiple metadata items are requested. Default is false. + AsyncAugmentMetadata *components.BoolInt `queryParam:"style=form,explode=true,name=asyncAugmentMetadata"` + // Number of augmentations to add. Requires `asyncAugmentMetadata` to be specified. + AugmentCount *components.BoolInt `queryParam:"style=form,explode=true,name=augmentCount"` +} + +func (g GetMetadataItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetMetadataItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GetMetadataItemRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetMetadataItemRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetMetadataItemRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetMetadataItemRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetMetadataItemRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetMetadataItemRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetMetadataItemRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetMetadataItemRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetMetadataItemRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetMetadataItemRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetMetadataItemRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetMetadataItemRequest) GetIds() []string { + if g == nil { + return []string{} + } + return g.Ids +} + +func (g *GetMetadataItemRequest) GetAsyncCheckFiles() *components.BoolInt { + if g == nil { + return nil + } + return g.AsyncCheckFiles +} + +func (g *GetMetadataItemRequest) GetAsyncRefreshLocalMediaAgent() *components.BoolInt { + if g == nil { + return nil + } + return g.AsyncRefreshLocalMediaAgent +} + +func (g *GetMetadataItemRequest) GetAsyncRefreshAnalysis() *components.BoolInt { + if g == nil { + return nil + } + return g.AsyncRefreshAnalysis +} + +func (g *GetMetadataItemRequest) GetCheckFiles() *components.BoolInt { + if g == nil { + return nil + } + return g.CheckFiles +} + +func (g *GetMetadataItemRequest) GetSkipRefresh() *components.BoolInt { + if g == nil { + return nil + } + return g.SkipRefresh +} + +func (g *GetMetadataItemRequest) GetCheckFileAvailability() *components.BoolInt { + if g == nil { + return nil + } + return g.CheckFileAvailability +} + +func (g *GetMetadataItemRequest) GetAsyncAugmentMetadata() *components.BoolInt { + if g == nil { + return nil + } + return g.AsyncAugmentMetadata +} + +func (g *GetMetadataItemRequest) GetAugmentCount() *components.BoolInt { + if g == nil { + return nil + } + return g.AugmentCount +} + +type GetMetadataItemResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetMetadataItemResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetMetadataItemResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetMetadataItemResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetMetadataItemResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetMetadataItemResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getmyplexaccount.go b/models/operations/getmyplexaccount.go deleted file mode 100644 index 918f779..0000000 --- a/models/operations/getmyplexaccount.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (m *MyPlex) GetAuthToken() *string { - if m == nil { - return nil - } - return m.AuthToken -} - -func (m *MyPlex) GetUsername() *string { - if m == nil { - return nil - } - return m.Username -} - -func (m *MyPlex) GetMappingState() *string { - if m == nil { - return nil - } - return m.MappingState -} - -func (m *MyPlex) GetMappingError() *string { - if m == nil { - return nil - } - return m.MappingError -} - -func (m *MyPlex) GetSignInState() *string { - if m == nil { - return nil - } - return m.SignInState -} - -func (m *MyPlex) GetPublicAddress() *string { - if m == nil { - return nil - } - return m.PublicAddress -} - -func (m *MyPlex) GetPublicPort() *float64 { - if m == nil { - return nil - } - return m.PublicPort -} - -func (m *MyPlex) GetPrivateAddress() *string { - if m == nil { - return nil - } - return m.PrivateAddress -} - -func (m *MyPlex) GetPrivatePort() *float64 { - if m == nil { - return nil - } - return m.PrivatePort -} - -func (m *MyPlex) GetSubscriptionFeatures() *string { - if m == nil { - return nil - } - return m.SubscriptionFeatures -} - -func (m *MyPlex) GetSubscriptionActive() *bool { - if m == nil { - return nil - } - return m.SubscriptionActive -} - -func (m *MyPlex) GetSubscriptionState() *string { - if m == nil { - return nil - } - return m.SubscriptionState -} - -// GetMyPlexAccountResponseBody - MyPlex Account -type GetMyPlexAccountResponseBody struct { - MyPlex *MyPlex `json:"MyPlex,omitempty"` -} - -func (g *GetMyPlexAccountResponseBody) GetMyPlex() *MyPlex { - if g == nil { - return nil - } - return g.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 (g *GetMyPlexAccountResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetMyPlexAccountResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetMyPlexAccountResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetMyPlexAccountResponse) GetObject() *GetMyPlexAccountResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getnotifications.go b/models/operations/getnotifications.go new file mode 100644 index 0000000..231c474 --- /dev/null +++ b/models/operations/getnotifications.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetNotificationsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetNotificationsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetNotificationsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetNotificationsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetNotificationsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetNotificationsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetNotificationsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetNotificationsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetNotificationsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetNotificationsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetNotificationsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetNotificationsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetNotificationsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetNotificationsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetNotificationsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // By default, all events except logs are sent. A rich filtering mechanism is provided to allow clients to opt into or out of each event type using the `filters` parameter. For example: + // + // - `filters=-log`: All event types except logs (the default). + // - `filters=foo,bar`: Only the foo and bar event types. + // - `filters=`: All events types. + // - `filters=-foo,bar`: All event types except foo and bar. + // + Filter []string `queryParam:"style=form,explode=true,name=filter"` +} + +func (g GetNotificationsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetNotificationsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetNotificationsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetNotificationsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetNotificationsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetNotificationsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetNotificationsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetNotificationsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetNotificationsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetNotificationsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetNotificationsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetNotificationsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetNotificationsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetNotificationsRequest) GetFilter() []string { + if g == nil { + return nil + } + return g.Filter +} + +type GetNotificationsResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (g *GetNotificationsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetNotificationsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetNotificationsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetNotificationsResponse) GetResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.ResponseStream +} diff --git a/models/operations/getpartindex.go b/models/operations/getpartindex.go new file mode 100644 index 0000000..bcfd734 --- /dev/null +++ b/models/operations/getpartindex.go @@ -0,0 +1,329 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type GetPartIndexGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPartIndexGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPartIndexGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPartIndexGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPartIndexGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPartIndexGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPartIndexGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPartIndexGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPartIndexGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPartIndexGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPartIndexGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPartIndexGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPartIndexGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPartIndexGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +// Index - The type of index to grab. +type Index string + +const ( + IndexSd Index = "sd" +) + +func (e Index) ToPointer() *Index { + return &e +} +func (e *Index) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "sd": + *e = Index(v) + return nil + default: + return fmt.Errorf("invalid value for Index: %v", v) + } +} + +type GetPartIndexRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The part id who's index is to be fetched + PartID int64 `pathParam:"style=simple,explode=false,name=partId"` + // The type of index to grab. + Index Index `pathParam:"style=simple,explode=false,name=index"` + // The interval between images to return in ms. + Interval *int64 `queryParam:"style=form,explode=true,name=interval"` +} + +func (g GetPartIndexRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPartIndexRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"partId", "index"}); err != nil { + return err + } + return nil +} + +func (g *GetPartIndexRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPartIndexRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPartIndexRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPartIndexRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPartIndexRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPartIndexRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPartIndexRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPartIndexRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPartIndexRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPartIndexRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPartIndexRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPartIndexRequest) GetPartID() int64 { + if g == nil { + return 0 + } + return g.PartID +} + +func (g *GetPartIndexRequest) GetIndex() Index { + if g == nil { + return Index("") + } + return g.Index +} + +func (g *GetPartIndexRequest) GetInterval() *int64 { + if g == nil { + return nil + } + return g.Interval +} + +type GetPartIndexResponse 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 + // OK + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (g *GetPartIndexResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPartIndexResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPartIndexResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPartIndexResponse) GetResponseStream() io.ReadCloser { + if g == nil { + return nil + } + return g.ResponseStream +} diff --git a/models/operations/getperson.go b/models/operations/getperson.go new file mode 100644 index 0000000..dc6002b --- /dev/null +++ b/models/operations/getperson.go @@ -0,0 +1,345 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPersonGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPersonGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPersonGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPersonGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPersonGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPersonGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPersonGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPersonGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPersonGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPersonGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPersonGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPersonGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPersonGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPersonGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPersonRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Either the PMS tag `id` of the person or `tagKey` of the actor. Note the `tagKey` is the hex portion of the plex guid for the actor + PersonID string `pathParam:"style=simple,explode=false,name=personId"` +} + +func (g GetPersonRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPersonRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"personId"}); err != nil { + return err + } + return nil +} + +func (g *GetPersonRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPersonRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPersonRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPersonRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPersonRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPersonRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPersonRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPersonRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPersonRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPersonRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPersonRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPersonRequest) GetPersonID() string { + if g == nil { + return "" + } + return g.PersonID +} + +// GetPersonMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetPersonMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []components.Tag `json:"Directory,omitempty"` +} + +func (g *GetPersonMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetPersonMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetPersonMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetPersonMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetPersonMediaContainer) GetDirectory() []components.Tag { + if g == nil { + return nil + } + return g.Directory +} + +// GetPersonResponseBody - OK +type GetPersonResponseBody struct { + MediaContainer *GetPersonMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetPersonResponseBody) GetMediaContainer() *GetPersonMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetPersonResponse 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 + // OK + Object *GetPersonResponseBody +} + +func (g *GetPersonResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPersonResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPersonResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPersonResponse) GetObject() *GetPersonResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getpin.go b/models/operations/getpin.go deleted file mode 100644 index 78daf6c..0000000 --- a/models/operations/getpin.go +++ /dev/null @@ -1,351 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" - "time" -) - -var GetPinServerList = []string{ - "https://plex.tv/api/v2", -} - -type GetPinRequest struct { - // Determines the kind of code returned by the API call - // Strong codes are used for Pin authentication flows - // Non-Strong codes are used for `Plex.tv/link` - // - Strong *bool `default:"false" queryParam:"style=form,explode=true,name=strong"` - // An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` - // The name of the client application. (Plex Web, Plex Media Server, etc.) - ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"` - // A relatively friendly name for the client device - DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"` - // The version of the client application. - ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"` - // The platform of the client application. - Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` -} - -func (g GetPinRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetPinRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"X-Plex-Client-Identifier"}); err != nil { - return err - } - return nil -} - -func (g *GetPinRequest) GetStrong() *bool { - if g == nil { - return nil - } - return g.Strong -} - -func (g *GetPinRequest) GetClientID() string { - if g == nil { - return "" - } - return g.ClientID -} - -func (g *GetPinRequest) GetClientName() *string { - if g == nil { - return nil - } - return g.ClientName -} - -func (g *GetPinRequest) GetDeviceNickname() *string { - if g == nil { - return nil - } - return g.DeviceNickname -} - -func (g *GetPinRequest) GetClientVersion() *string { - if g == nil { - return nil - } - return g.ClientVersion -} - -func (g *GetPinRequest) GetPlatform() *string { - if g == nil { - return nil - } - return g.Platform -} - -// GeoData - Geo location data -type GeoData struct { - // The ISO 3166-1 alpha-2 code of the country. - Code string `json:"code"` - // The continent code where the country is located. - ContinentCode string `json:"continent_code"` - // The official name of the country. - Country string `json:"country"` - // The name of the city. - City string `json:"city"` - // Indicates if the country is a member of the European Union. - EuropeanUnionMember *bool `default:"false" json:"european_union_member"` - // The time zone of the country. - TimeZone string `json:"time_zone"` - // The postal code of the location. - PostalCode string `json:"postal_code"` - // Indicates if the country has privacy restrictions. - InPrivacyRestrictedCountry *bool `default:"false" json:"in_privacy_restricted_country"` - // Indicates if the region has privacy restrictions. - InPrivacyRestrictedRegion *bool `default:"false" json:"in_privacy_restricted_region"` - // The name of the primary administrative subdivision. - Subdivisions string `json:"subdivisions"` - // The geographical coordinates (latitude, longitude) of the location. - Coordinates string `json:"coordinates"` -} - -func (g GeoData) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GeoData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil { - return err - } - return nil -} - -func (g *GeoData) GetCode() string { - if g == nil { - return "" - } - return g.Code -} - -func (g *GeoData) GetContinentCode() string { - if g == nil { - return "" - } - return g.ContinentCode -} - -func (g *GeoData) GetCountry() string { - if g == nil { - return "" - } - return g.Country -} - -func (g *GeoData) GetCity() string { - if g == nil { - return "" - } - return g.City -} - -func (g *GeoData) GetEuropeanUnionMember() *bool { - if g == nil { - return nil - } - return g.EuropeanUnionMember -} - -func (g *GeoData) GetTimeZone() string { - if g == nil { - return "" - } - return g.TimeZone -} - -func (g *GeoData) GetPostalCode() string { - if g == nil { - return "" - } - return g.PostalCode -} - -func (g *GeoData) GetInPrivacyRestrictedCountry() *bool { - if g == nil { - return nil - } - return g.InPrivacyRestrictedCountry -} - -func (g *GeoData) GetInPrivacyRestrictedRegion() *bool { - if g == nil { - return nil - } - return g.InPrivacyRestrictedRegion -} - -func (g *GeoData) GetSubdivisions() string { - if g == nil { - return "" - } - return g.Subdivisions -} - -func (g *GeoData) GetCoordinates() string { - if g == nil { - return "" - } - return g.Coordinates -} - -// GetPinAuthPinContainer - Requests a new pin id used in the authentication flow -type GetPinAuthPinContainer struct { - ID int64 `json:"id"` - Code string `json:"code"` - Product string `json:"product"` - Trusted *bool `default:"false" json:"trusted"` - Qr string `json:"qr"` - // The X-Client-Identifier used in the request - ClientIdentifier string `json:"clientIdentifier"` - // Geo location data - Location GeoData `json:"location"` - // The number of seconds this pin expires, by default 900 seconds - ExpiresIn *int64 `default:"900" json:"expiresIn"` - CreatedAt time.Time `json:"createdAt"` - ExpiresAt time.Time `json:"expiresAt"` - AuthToken *string `json:"authToken,omitempty"` - NewRegistration any `json:"newRegistration,omitempty"` -} - -func (g GetPinAuthPinContainer) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetPinAuthPinContainer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "code", "product", "qr", "clientIdentifier", "location", "createdAt", "expiresAt"}); err != nil { - return err - } - return nil -} - -func (g *GetPinAuthPinContainer) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetPinAuthPinContainer) GetCode() string { - if g == nil { - return "" - } - return g.Code -} - -func (g *GetPinAuthPinContainer) GetProduct() string { - if g == nil { - return "" - } - return g.Product -} - -func (g *GetPinAuthPinContainer) GetTrusted() *bool { - if g == nil { - return nil - } - return g.Trusted -} - -func (g *GetPinAuthPinContainer) GetQr() string { - if g == nil { - return "" - } - return g.Qr -} - -func (g *GetPinAuthPinContainer) GetClientIdentifier() string { - if g == nil { - return "" - } - return g.ClientIdentifier -} - -func (g *GetPinAuthPinContainer) GetLocation() GeoData { - if g == nil { - return GeoData{} - } - return g.Location -} - -func (g *GetPinAuthPinContainer) GetExpiresIn() *int64 { - if g == nil { - return nil - } - return g.ExpiresIn -} - -func (g *GetPinAuthPinContainer) GetCreatedAt() time.Time { - if g == nil { - return time.Time{} - } - return g.CreatedAt -} - -func (g *GetPinAuthPinContainer) GetExpiresAt() time.Time { - if g == nil { - return time.Time{} - } - return g.ExpiresAt -} - -func (g *GetPinAuthPinContainer) GetAuthToken() *string { - if g == nil { - return nil - } - return g.AuthToken -} - -func (g *GetPinAuthPinContainer) GetNewRegistration() any { - if g == nil { - return nil - } - return g.NewRegistration -} - -type GetPinResponse 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 - // Requests a new pin id used in the authentication flow - AuthPinContainer *GetPinAuthPinContainer -} - -func (g *GetPinResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetPinResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetPinResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetPinResponse) GetAuthPinContainer() *GetPinAuthPinContainer { - if g == nil { - return nil - } - return g.AuthPinContainer -} diff --git a/models/operations/getplaylist.go b/models/operations/getplaylist.go index 869b034..1ca3696 100644 --- a/models/operations/getplaylist.go +++ b/models/operations/getplaylist.go @@ -3,175 +3,246 @@ package operations import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -type GetPlaylistRequest struct { - // the ID of the playlist - PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` +type GetPlaylistGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (g *GetPlaylistRequest) GetPlaylistID() float64 { +func (g GetPlaylistGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGlobals) GetAccepts() *components.Accepts { if g == nil { - return 0.0 + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPlaylistRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` +} + +func (g GetPlaylistRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPlaylistRequest) GetPlaylistID() int64 { + if g == nil { + return 0 } return g.PlaylistID } -type GetPlaylistMetadata struct { - Content *string `json:"content,omitempty"` - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - GUID *string `json:"guid,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - Summary *string `json:"summary,omitempty"` - Smart *bool `json:"smart,omitempty"` - PlaylistType *string `json:"playlistType,omitempty"` - Composite *string `json:"composite,omitempty"` - Icon *string `json:"icon,omitempty"` - Duration *int `json:"duration,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` -} - -func (g *GetPlaylistMetadata) GetContent() *string { - if g == nil { - return nil - } - return g.Content -} - -func (g *GetPlaylistMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetPlaylistMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetPlaylistMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetPlaylistMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetPlaylistMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetPlaylistMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetPlaylistMetadata) GetSmart() *bool { - if g == nil { - return nil - } - return g.Smart -} - -func (g *GetPlaylistMetadata) GetPlaylistType() *string { - if g == nil { - return nil - } - return g.PlaylistType -} - -func (g *GetPlaylistMetadata) GetComposite() *string { - if g == nil { - return nil - } - return g.Composite -} - -func (g *GetPlaylistMetadata) GetIcon() *string { - if g == nil { - return nil - } - return g.Icon -} - -func (g *GetPlaylistMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetPlaylistMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetPlaylistMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetPlaylistMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -type GetPlaylistMediaContainer struct { - Size *int `json:"size,omitempty"` - Metadata []GetPlaylistMetadata `json:"Metadata,omitempty"` -} - -func (g *GetPlaylistMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetPlaylistMediaContainer) GetMetadata() []GetPlaylistMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetPlaylistResponseBody - The playlist -type GetPlaylistResponseBody struct { - MediaContainer *GetPlaylistMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetPlaylistResponseBody) GetMediaContainer() *GetPlaylistMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - type GetPlaylistResponse struct { // HTTP response content type for this operation ContentType string @@ -179,8 +250,8 @@ type GetPlaylistResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response - // The playlist - Object *GetPlaylistResponseBody + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata } func (g *GetPlaylistResponse) GetContentType() string { @@ -204,9 +275,9 @@ func (g *GetPlaylistResponse) GetRawResponse() *http.Response { return g.RawResponse } -func (g *GetPlaylistResponse) GetObject() *GetPlaylistResponseBody { +func (g *GetPlaylistResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { if g == nil { return nil } - return g.Object + return g.MediaContainerWithPlaylistMetadata } diff --git a/models/operations/getplaylistcontents.go b/models/operations/getplaylistcontents.go deleted file mode 100644 index c991f8f..0000000 --- a/models/operations/getplaylistcontents.go +++ /dev/null @@ -1,733 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -// GetPlaylistContentsQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetPlaylistContentsQueryParamType int64 - -const ( - GetPlaylistContentsQueryParamTypeMovie GetPlaylistContentsQueryParamType = 1 - GetPlaylistContentsQueryParamTypeTvShow GetPlaylistContentsQueryParamType = 2 - GetPlaylistContentsQueryParamTypeSeason GetPlaylistContentsQueryParamType = 3 - GetPlaylistContentsQueryParamTypeEpisode GetPlaylistContentsQueryParamType = 4 - GetPlaylistContentsQueryParamTypeArtist GetPlaylistContentsQueryParamType = 5 - GetPlaylistContentsQueryParamTypeAlbum GetPlaylistContentsQueryParamType = 6 - GetPlaylistContentsQueryParamTypeTrack GetPlaylistContentsQueryParamType = 7 - GetPlaylistContentsQueryParamTypePhotoAlbum GetPlaylistContentsQueryParamType = 8 - GetPlaylistContentsQueryParamTypePhoto GetPlaylistContentsQueryParamType = 9 -) - -func (e GetPlaylistContentsQueryParamType) ToPointer() *GetPlaylistContentsQueryParamType { - return &e -} - -type GetPlaylistContentsRequest struct { - // the ID of the playlist - PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetPlaylistContentsQueryParamType `queryParam:"style=form,explode=true,name=type"` -} - -func (g *GetPlaylistContentsRequest) GetPlaylistID() float64 { - if g == nil { - return 0.0 - } - return g.PlaylistID -} - -func (g *GetPlaylistContentsRequest) GetType() GetPlaylistContentsQueryParamType { - if g == nil { - return GetPlaylistContentsQueryParamType(0) - } - return g.Type -} - -type GetPlaylistContentsPart struct { - ID *int `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Duration *int `json:"duration,omitempty"` - File *string `json:"file,omitempty"` - Size *int `json:"size,omitempty"` - AudioProfile *string `json:"audioProfile,omitempty"` - Container *string `json:"container,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` - VideoProfile *string `json:"videoProfile,omitempty"` -} - -func (g *GetPlaylistContentsPart) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetPlaylistContentsPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetPlaylistContentsPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetPlaylistContentsPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetPlaylistContentsPart) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetPlaylistContentsPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetPlaylistContentsPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetPlaylistContentsPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetPlaylistContentsPart) GetOptimizedForStreaming() *bool { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetPlaylistContentsPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -type GetPlaylistContentsMedia struct { - ID *int `json:"id,omitempty"` - Duration *int `json:"duration,omitempty"` - Bitrate *int `json:"bitrate,omitempty"` - Width *int `json:"width,omitempty"` - Height *int `json:"height,omitempty"` - AspectRatio *float64 `json:"aspectRatio,omitempty"` - AudioChannels *int `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"` - OptimizedForStreaming *int `json:"optimizedForStreaming,omitempty"` - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - VideoProfile *string `json:"videoProfile,omitempty"` - Part []GetPlaylistContentsPart `json:"Part,omitempty"` -} - -func (g *GetPlaylistContentsMedia) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetPlaylistContentsMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetPlaylistContentsMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetPlaylistContentsMedia) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetPlaylistContentsMedia) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetPlaylistContentsMedia) GetAspectRatio() *float64 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetPlaylistContentsMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetPlaylistContentsMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetPlaylistContentsMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetPlaylistContentsMedia) GetVideoResolution() *string { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetPlaylistContentsMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetPlaylistContentsMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetPlaylistContentsMedia) GetOptimizedForStreaming() *int { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetPlaylistContentsMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetPlaylistContentsMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetPlaylistContentsMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetPlaylistContentsMedia) GetPart() []GetPlaylistContentsPart { - if g == nil { - return nil - } - return g.Part -} - -type GetPlaylistContentsGenre struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetPlaylistContentsGenre) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetPlaylistContentsCountry struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetPlaylistContentsCountry) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetPlaylistContentsDirector struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetPlaylistContentsDirector) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetPlaylistContentsWriter struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetPlaylistContentsWriter) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetPlaylistContentsRole struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetPlaylistContentsRole) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetPlaylistContentsMetadata struct { - RatingKey *string `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"` - TitleSort *string `json:"titleSort,omitempty"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - LibrarySectionID *int `json:"librarySectionID,omitempty"` - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - ContentRating *string `json:"contentRating,omitempty"` - Summary *string `json:"summary,omitempty"` - Rating *float64 `json:"rating,omitempty"` - AudienceRating *float64 `json:"audienceRating,omitempty"` - Year *int `json:"year,omitempty"` - Tagline *string `json:"tagline,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Art *string `json:"art,omitempty"` - Duration *int `json:"duration,omitempty"` - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - HasPremiumExtras *string `json:"hasPremiumExtras,omitempty"` - HasPremiumPrimaryExtra *string `json:"hasPremiumPrimaryExtra,omitempty"` - RatingImage *string `json:"ratingImage,omitempty"` - Media []GetPlaylistContentsMedia `json:"Media,omitempty"` - Genre []GetPlaylistContentsGenre `json:"Genre,omitempty"` - Country []GetPlaylistContentsCountry `json:"Country,omitempty"` - Director []GetPlaylistContentsDirector `json:"Director,omitempty"` - Writer []GetPlaylistContentsWriter `json:"Writer,omitempty"` - Role []GetPlaylistContentsRole `json:"Role,omitempty"` -} - -func (g GetPlaylistContentsMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetPlaylistContentsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetPlaylistContentsMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetPlaylistContentsMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetPlaylistContentsMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetPlaylistContentsMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetPlaylistContentsMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetPlaylistContentsMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetPlaylistContentsMetadata) GetTitleSort() *string { - if g == nil { - return nil - } - return g.TitleSort -} - -func (g *GetPlaylistContentsMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetPlaylistContentsMetadata) GetLibrarySectionID() *int { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetPlaylistContentsMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetPlaylistContentsMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetPlaylistContentsMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetPlaylistContentsMetadata) GetRating() *float64 { - if g == nil { - return nil - } - return g.Rating -} - -func (g *GetPlaylistContentsMetadata) GetAudienceRating() *float64 { - if g == nil { - return nil - } - return g.AudienceRating -} - -func (g *GetPlaylistContentsMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetPlaylistContentsMetadata) GetTagline() *string { - if g == nil { - return nil - } - return g.Tagline -} - -func (g *GetPlaylistContentsMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetPlaylistContentsMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetPlaylistContentsMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetPlaylistContentsMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetPlaylistContentsMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetPlaylistContentsMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetPlaylistContentsMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetPlaylistContentsMetadata) GetHasPremiumExtras() *string { - if g == nil { - return nil - } - return g.HasPremiumExtras -} - -func (g *GetPlaylistContentsMetadata) GetHasPremiumPrimaryExtra() *string { - if g == nil { - return nil - } - return g.HasPremiumPrimaryExtra -} - -func (g *GetPlaylistContentsMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetPlaylistContentsMetadata) GetMedia() []GetPlaylistContentsMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetPlaylistContentsMetadata) GetGenre() []GetPlaylistContentsGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetPlaylistContentsMetadata) GetCountry() []GetPlaylistContentsCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetPlaylistContentsMetadata) GetDirector() []GetPlaylistContentsDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetPlaylistContentsMetadata) GetWriter() []GetPlaylistContentsWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetPlaylistContentsMetadata) GetRole() []GetPlaylistContentsRole { - if g == nil { - return nil - } - return g.Role -} - -type GetPlaylistContentsMediaContainer struct { - Size *int `json:"size,omitempty"` - Composite *string `json:"composite,omitempty"` - Duration *int `json:"duration,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - PlaylistType *string `json:"playlistType,omitempty"` - RatingKey *string `json:"ratingKey,omitempty"` - Smart *bool `json:"smart,omitempty"` - Title *string `json:"title,omitempty"` - Metadata []GetPlaylistContentsMetadata `json:"Metadata,omitempty"` -} - -func (g *GetPlaylistContentsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetPlaylistContentsMediaContainer) GetComposite() *string { - if g == nil { - return nil - } - return g.Composite -} - -func (g *GetPlaylistContentsMediaContainer) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetPlaylistContentsMediaContainer) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetPlaylistContentsMediaContainer) GetPlaylistType() *string { - if g == nil { - return nil - } - return g.PlaylistType -} - -func (g *GetPlaylistContentsMediaContainer) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetPlaylistContentsMediaContainer) GetSmart() *bool { - if g == nil { - return nil - } - return g.Smart -} - -func (g *GetPlaylistContentsMediaContainer) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetPlaylistContentsMediaContainer) GetMetadata() []GetPlaylistContentsMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetPlaylistContentsResponseBody - The playlist contents -type GetPlaylistContentsResponseBody struct { - MediaContainer *GetPlaylistContentsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetPlaylistContentsResponseBody) GetMediaContainer() *GetPlaylistContentsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // The playlist contents - Object *GetPlaylistContentsResponseBody -} - -func (g *GetPlaylistContentsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetPlaylistContentsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetPlaylistContentsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetPlaylistContentsResponse) GetObject() *GetPlaylistContentsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getplaylistgenerator.go b/models/operations/getplaylistgenerator.go new file mode 100644 index 0000000..690da6a --- /dev/null +++ b/models/operations/getplaylistgenerator.go @@ -0,0 +1,873 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPlaylistGeneratorGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPlaylistGeneratorGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGeneratorGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGeneratorGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGeneratorGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGeneratorGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGeneratorGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGeneratorGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGeneratorGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGeneratorGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGeneratorGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPlaylistGeneratorRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The generator item ID to delete. + GeneratorID int64 `pathParam:"style=simple,explode=false,name=generatorId"` +} + +func (g GetPlaylistGeneratorRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"playlistId", "generatorId"}); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGeneratorRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGeneratorRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGeneratorRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGeneratorRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGeneratorRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGeneratorRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGeneratorRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGeneratorRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGeneratorRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPlaylistGeneratorRequest) GetPlaylistID() int64 { + if g == nil { + return 0 + } + return g.PlaylistID +} + +func (g *GetPlaylistGeneratorRequest) GetGeneratorID() int64 { + if g == nil { + return 0 + } + return g.GeneratorID +} + +type GetPlaylistGeneratorDevice struct { + Profile *string `json:"profile,omitempty"` +} + +func (g *GetPlaylistGeneratorDevice) GetProfile() *string { + if g == nil { + return nil + } + return g.Profile +} + +type GetPlaylistGeneratorLocation struct { + LibrarySectionID *int64 `json:"librarySectionID,omitempty"` + URI *string `json:"uri,omitempty"` +} + +func (g *GetPlaylistGeneratorLocation) GetLibrarySectionID() *int64 { + if g == nil { + return nil + } + return g.LibrarySectionID +} + +func (g *GetPlaylistGeneratorLocation) GetURI() *string { + if g == nil { + return nil + } + return g.URI +} + +type AdvancedSubtitles string + +const ( + AdvancedSubtitlesAuto AdvancedSubtitles = "auto" + AdvancedSubtitlesBurn AdvancedSubtitles = "burn" + AdvancedSubtitlesNone AdvancedSubtitles = "none" + AdvancedSubtitlesSidecar AdvancedSubtitles = "sidecar" + AdvancedSubtitlesEmbedded AdvancedSubtitles = "embedded" + AdvancedSubtitlesSegmented AdvancedSubtitles = "segmented" +) + +func (e AdvancedSubtitles) ToPointer() *AdvancedSubtitles { + return &e +} +func (e *AdvancedSubtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + fallthrough + case "burn": + fallthrough + case "none": + fallthrough + case "sidecar": + fallthrough + case "embedded": + fallthrough + case "segmented": + *e = AdvancedSubtitles(v) + return nil + default: + return fmt.Errorf("invalid value for AdvancedSubtitles: %v", v) + } +} + +type GetPlaylistGeneratorSubtitles string + +const ( + GetPlaylistGeneratorSubtitlesAuto GetPlaylistGeneratorSubtitles = "auto" + GetPlaylistGeneratorSubtitlesBurn GetPlaylistGeneratorSubtitles = "burn" + GetPlaylistGeneratorSubtitlesNone GetPlaylistGeneratorSubtitles = "none" + GetPlaylistGeneratorSubtitlesSidecar GetPlaylistGeneratorSubtitles = "sidecar" + GetPlaylistGeneratorSubtitlesEmbedded GetPlaylistGeneratorSubtitles = "embedded" + GetPlaylistGeneratorSubtitlesSegmented GetPlaylistGeneratorSubtitles = "segmented" +) + +func (e GetPlaylistGeneratorSubtitles) ToPointer() *GetPlaylistGeneratorSubtitles { + return &e +} +func (e *GetPlaylistGeneratorSubtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + fallthrough + case "burn": + fallthrough + case "none": + fallthrough + case "sidecar": + fallthrough + case "embedded": + fallthrough + case "segmented": + *e = GetPlaylistGeneratorSubtitles(v) + return nil + default: + return fmt.Errorf("invalid value for GetPlaylistGeneratorSubtitles: %v", v) + } +} + +type MediaSettings struct { + AdvancedSubtitles *AdvancedSubtitles `json:"advancedSubtitles,omitempty"` + AudioBoost *int64 `json:"audioBoost,omitempty"` + AudioChannelCount *int64 `json:"audioChannelCount,omitempty"` + AutoAdjustQuality *bool `json:"autoAdjustQuality,omitempty"` + AutoAdjustSubtitle *bool `json:"autoAdjustSubtitle,omitempty"` + DirectPlay *bool `json:"directPlay,omitempty"` + DirectStream *bool `json:"directStream,omitempty"` + DirectStreamAudio *bool `json:"directStreamAudio,omitempty"` + DisableResolutionRotation *bool `json:"disableResolutionRotation,omitempty"` + MaxVideoBitrate *int64 `json:"maxVideoBitrate,omitempty"` + MusicBitrate *int64 `json:"musicBitrate,omitempty"` + PeakBitrate *int64 `json:"peakBitrate,omitempty"` + PhotoQuality *int64 `json:"photoQuality,omitempty"` + PhotoResolution *string `json:"photoResolution,omitempty"` + SecondsPerSegment *int64 `json:"secondsPerSegment,omitempty"` + Subtitles *GetPlaylistGeneratorSubtitles `json:"subtitles,omitempty"` + SubtitleSize *int64 `json:"subtitleSize,omitempty"` + VideoBitrate *int64 `json:"videoBitrate,omitempty"` + VideoQuality *int64 `json:"videoQuality,omitempty"` + VideoResolution *string `json:"videoResolution,omitempty"` +} + +func (m *MediaSettings) GetAdvancedSubtitles() *AdvancedSubtitles { + if m == nil { + return nil + } + return m.AdvancedSubtitles +} + +func (m *MediaSettings) GetAudioBoost() *int64 { + if m == nil { + return nil + } + return m.AudioBoost +} + +func (m *MediaSettings) GetAudioChannelCount() *int64 { + if m == nil { + return nil + } + return m.AudioChannelCount +} + +func (m *MediaSettings) GetAutoAdjustQuality() *bool { + if m == nil { + return nil + } + return m.AutoAdjustQuality +} + +func (m *MediaSettings) GetAutoAdjustSubtitle() *bool { + if m == nil { + return nil + } + return m.AutoAdjustSubtitle +} + +func (m *MediaSettings) GetDirectPlay() *bool { + if m == nil { + return nil + } + return m.DirectPlay +} + +func (m *MediaSettings) GetDirectStream() *bool { + if m == nil { + return nil + } + return m.DirectStream +} + +func (m *MediaSettings) GetDirectStreamAudio() *bool { + if m == nil { + return nil + } + return m.DirectStreamAudio +} + +func (m *MediaSettings) GetDisableResolutionRotation() *bool { + if m == nil { + return nil + } + return m.DisableResolutionRotation +} + +func (m *MediaSettings) GetMaxVideoBitrate() *int64 { + if m == nil { + return nil + } + return m.MaxVideoBitrate +} + +func (m *MediaSettings) GetMusicBitrate() *int64 { + if m == nil { + return nil + } + return m.MusicBitrate +} + +func (m *MediaSettings) GetPeakBitrate() *int64 { + if m == nil { + return nil + } + return m.PeakBitrate +} + +func (m *MediaSettings) GetPhotoQuality() *int64 { + if m == nil { + return nil + } + return m.PhotoQuality +} + +func (m *MediaSettings) GetPhotoResolution() *string { + if m == nil { + return nil + } + return m.PhotoResolution +} + +func (m *MediaSettings) GetSecondsPerSegment() *int64 { + if m == nil { + return nil + } + return m.SecondsPerSegment +} + +func (m *MediaSettings) GetSubtitles() *GetPlaylistGeneratorSubtitles { + if m == nil { + return nil + } + return m.Subtitles +} + +func (m *MediaSettings) GetSubtitleSize() *int64 { + if m == nil { + return nil + } + return m.SubtitleSize +} + +func (m *MediaSettings) GetVideoBitrate() *int64 { + if m == nil { + return nil + } + return m.VideoBitrate +} + +func (m *MediaSettings) GetVideoQuality() *int64 { + if m == nil { + return nil + } + return m.VideoQuality +} + +func (m *MediaSettings) GetVideoResolution() *string { + if m == nil { + return nil + } + return m.VideoResolution +} + +type GetPlaylistGeneratorScope string + +const ( + GetPlaylistGeneratorScopeAll GetPlaylistGeneratorScope = "all" + GetPlaylistGeneratorScopeCount GetPlaylistGeneratorScope = "count" +) + +func (e GetPlaylistGeneratorScope) ToPointer() *GetPlaylistGeneratorScope { + return &e +} +func (e *GetPlaylistGeneratorScope) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + fallthrough + case "count": + *e = GetPlaylistGeneratorScope(v) + return nil + default: + return fmt.Errorf("invalid value for GetPlaylistGeneratorScope: %v", v) + } +} + +type GetPlaylistGeneratorPolicy struct { + Scope *GetPlaylistGeneratorScope `json:"scope,omitempty"` + // True if only unwatched items are optimized + Unwatched *bool `json:"unwatched,omitempty"` + // If the scope is count, the number of items to optimize + Value *int64 `json:"value,omitempty"` +} + +func (g *GetPlaylistGeneratorPolicy) GetScope() *GetPlaylistGeneratorScope { + if g == nil { + return nil + } + return g.Scope +} + +func (g *GetPlaylistGeneratorPolicy) GetUnwatched() *bool { + if g == nil { + return nil + } + return g.Unwatched +} + +func (g *GetPlaylistGeneratorPolicy) GetValue() *int64 { + if g == nil { + return nil + } + return g.Value +} + +type GetPlaylistGeneratorState string + +const ( + GetPlaylistGeneratorStatePending GetPlaylistGeneratorState = "pending" + GetPlaylistGeneratorStateComplete GetPlaylistGeneratorState = "complete" + GetPlaylistGeneratorStateFailed GetPlaylistGeneratorState = "failed" +) + +func (e GetPlaylistGeneratorState) ToPointer() *GetPlaylistGeneratorState { + return &e +} +func (e *GetPlaylistGeneratorState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "pending": + fallthrough + case "complete": + fallthrough + case "failed": + *e = GetPlaylistGeneratorState(v) + return nil + default: + return fmt.Errorf("invalid value for GetPlaylistGeneratorState: %v", v) + } +} + +type GetPlaylistGeneratorStatus struct { + ItemsCompleteCount *int64 `json:"itemsCompleteCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ItemsSuccessfulCount *int64 `json:"itemsSuccessfulCount,omitempty"` + State *GetPlaylistGeneratorState `json:"state,omitempty"` + TotalSize *int64 `json:"totalSize,omitempty"` +} + +func (g *GetPlaylistGeneratorStatus) GetItemsCompleteCount() *int64 { + if g == nil { + return nil + } + return g.ItemsCompleteCount +} + +func (g *GetPlaylistGeneratorStatus) GetItemsCount() *int64 { + if g == nil { + return nil + } + return g.ItemsCount +} + +func (g *GetPlaylistGeneratorStatus) GetItemsSuccessfulCount() *int64 { + if g == nil { + return nil + } + return g.ItemsSuccessfulCount +} + +func (g *GetPlaylistGeneratorStatus) GetState() *GetPlaylistGeneratorState { + if g == nil { + return nil + } + return g.State +} + +func (g *GetPlaylistGeneratorStatus) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +// GetPlaylistGeneratorType - The type of this generator +type GetPlaylistGeneratorType int64 + +const ( + GetPlaylistGeneratorTypeMinus1 GetPlaylistGeneratorType = -1 + GetPlaylistGeneratorTypeFortyTwo GetPlaylistGeneratorType = 42 +) + +func (e GetPlaylistGeneratorType) ToPointer() *GetPlaylistGeneratorType { + return &e +} +func (e *GetPlaylistGeneratorType) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case -1: + fallthrough + case 42: + *e = GetPlaylistGeneratorType(v) + return nil + default: + return fmt.Errorf("invalid value for GetPlaylistGeneratorType: %v", v) + } +} + +type GetPlaylistGeneratorItem struct { + // The composite thumbnail image path + Composite *string `json:"composite,omitempty"` + Device *GetPlaylistGeneratorDevice `json:"Device,omitempty"` + ID *int64 `json:"id,omitempty"` + Location *GetPlaylistGeneratorLocation `json:"Location,omitempty"` + MediaSettings *MediaSettings `json:"MediaSettings,omitempty"` + Policy *GetPlaylistGeneratorPolicy `json:"Policy,omitempty"` + Status *GetPlaylistGeneratorStatus `json:"Status,omitempty"` + Target *string `json:"target,omitempty"` + // The tag of this generator's settings + TargetTagID *int64 `json:"targetTagID,omitempty"` + Title *string `json:"title,omitempty"` + // The type of this generator + Type *GetPlaylistGeneratorType `json:"type,omitempty"` +} + +func (g *GetPlaylistGeneratorItem) GetComposite() *string { + if g == nil { + return nil + } + return g.Composite +} + +func (g *GetPlaylistGeneratorItem) GetDevice() *GetPlaylistGeneratorDevice { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorItem) GetID() *int64 { + if g == nil { + return nil + } + return g.ID +} + +func (g *GetPlaylistGeneratorItem) GetLocation() *GetPlaylistGeneratorLocation { + if g == nil { + return nil + } + return g.Location +} + +func (g *GetPlaylistGeneratorItem) GetMediaSettings() *MediaSettings { + if g == nil { + return nil + } + return g.MediaSettings +} + +func (g *GetPlaylistGeneratorItem) GetPolicy() *GetPlaylistGeneratorPolicy { + if g == nil { + return nil + } + return g.Policy +} + +func (g *GetPlaylistGeneratorItem) GetStatus() *GetPlaylistGeneratorStatus { + if g == nil { + return nil + } + return g.Status +} + +func (g *GetPlaylistGeneratorItem) GetTarget() *string { + if g == nil { + return nil + } + return g.Target +} + +func (g *GetPlaylistGeneratorItem) GetTargetTagID() *int64 { + if g == nil { + return nil + } + return g.TargetTagID +} + +func (g *GetPlaylistGeneratorItem) GetTitle() *string { + if g == nil { + return nil + } + return g.Title +} + +func (g *GetPlaylistGeneratorItem) GetType() *GetPlaylistGeneratorType { + if g == nil { + return nil + } + return g.Type +} + +// GetPlaylistGeneratorMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetPlaylistGeneratorMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Item []GetPlaylistGeneratorItem `json:"Item,omitempty"` +} + +func (g *GetPlaylistGeneratorMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetPlaylistGeneratorMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetPlaylistGeneratorMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetPlaylistGeneratorMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetPlaylistGeneratorMediaContainer) GetItem() []GetPlaylistGeneratorItem { + if g == nil { + return nil + } + return g.Item +} + +// GetPlaylistGeneratorResponseBody - OK +type GetPlaylistGeneratorResponseBody struct { + MediaContainer *GetPlaylistGeneratorMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetPlaylistGeneratorResponseBody) GetMediaContainer() *GetPlaylistGeneratorMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetPlaylistGeneratorResponse 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 + // OK + Object *GetPlaylistGeneratorResponseBody +} + +func (g *GetPlaylistGeneratorResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPlaylistGeneratorResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPlaylistGeneratorResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPlaylistGeneratorResponse) GetObject() *GetPlaylistGeneratorResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getplaylistgeneratoritems.go b/models/operations/getplaylistgeneratoritems.go new file mode 100644 index 0000000..3d8a3d7 --- /dev/null +++ b/models/operations/getplaylistgeneratoritems.go @@ -0,0 +1,1090 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPlaylistGeneratorItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPlaylistGeneratorItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGeneratorItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPlaylistGeneratorItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The generator item ID to delete. + GeneratorID int64 `pathParam:"style=simple,explode=false,name=generatorId"` +} + +func (g GetPlaylistGeneratorItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"playlistId", "generatorId"}); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorItemsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGeneratorItemsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGeneratorItemsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGeneratorItemsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGeneratorItemsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGeneratorItemsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGeneratorItemsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorItemsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGeneratorItemsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGeneratorItemsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGeneratorItemsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPlaylistGeneratorItemsRequest) GetPlaylistID() int64 { + if g == nil { + return 0 + } + return g.PlaylistID +} + +func (g *GetPlaylistGeneratorItemsRequest) GetGeneratorID() int64 { + if g == nil { + return 0 + } + return g.GeneratorID +} + +// ProcessingState - The state of processing if this generator is part of an optimizer playlist +type ProcessingState string + +const ( + ProcessingStateProcessed ProcessingState = "processed" + ProcessingStateCompleted ProcessingState = "completed" + ProcessingStateTombstoned ProcessingState = "tombstoned" + ProcessingStateDisabled ProcessingState = "disabled" + ProcessingStateError ProcessingState = "error" + ProcessingStatePending ProcessingState = "pending" +) + +func (e ProcessingState) ToPointer() *ProcessingState { + return &e +} +func (e *ProcessingState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "processed": + fallthrough + case "completed": + fallthrough + case "tombstoned": + fallthrough + case "disabled": + fallthrough + case "error": + fallthrough + case "pending": + *e = ProcessingState(v) + return nil + default: + return fmt.Errorf("invalid value for ProcessingState: %v", v) + } +} + +// ProcessingStateContext - The error which could have occurred (or `good`) +type ProcessingStateContext string + +const ( + ProcessingStateContextGood ProcessingStateContext = "good" + ProcessingStateContextSourceFileUnavailable ProcessingStateContext = "sourceFileUnavailable" + ProcessingStateContextSourceFileMetadataError ProcessingStateContext = "sourceFileMetadataError" + ProcessingStateContextClientProfileError ProcessingStateContext = "clientProfileError" + ProcessingStateContextIoError ProcessingStateContext = "ioError" + ProcessingStateContextTranscoderError ProcessingStateContext = "transcoderError" + ProcessingStateContextUnknownError ProcessingStateContext = "unknownError" + ProcessingStateContextMediaAnalysisError ProcessingStateContext = "mediaAnalysisError" + ProcessingStateContextDownloadFailed ProcessingStateContext = "downloadFailed" + ProcessingStateContextAccessDenied ProcessingStateContext = "accessDenied" + ProcessingStateContextCannotTranscode ProcessingStateContext = "cannotTranscode" + ProcessingStateContextCodecInstallError ProcessingStateContext = "codecInstallError" +) + +func (e ProcessingStateContext) ToPointer() *ProcessingStateContext { + return &e +} +func (e *ProcessingStateContext) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "good": + fallthrough + case "sourceFileUnavailable": + fallthrough + case "sourceFileMetadataError": + fallthrough + case "clientProfileError": + fallthrough + case "ioError": + fallthrough + case "transcoderError": + fallthrough + case "unknownError": + fallthrough + case "mediaAnalysisError": + fallthrough + case "downloadFailed": + fallthrough + case "accessDenied": + fallthrough + case "cannotTranscode": + fallthrough + case "codecInstallError": + *e = ProcessingStateContext(v) + return nil + default: + return fmt.Errorf("invalid value for ProcessingStateContext: %v", v) + } +} + +// GetPlaylistGeneratorItemsMetadata - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type GetPlaylistGeneratorItemsMetadata struct { + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []components.Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []components.Tag `json:"Country,omitempty"` + Director []components.Tag `json:"Director,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []components.Filter `json:"Filter,omitempty"` + Genre []components.Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []components.Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []components.Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + Media []components.Media `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []components.Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []components.Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []components.Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []components.Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + // The state of processing if this generator is part of an optimizer playlist + ProcessingState *ProcessingState `json:"processingState,omitempty"` + // The error which could have occurred (or `good`) + ProcessingStateContext *ProcessingStateContext `json:"processingStateContext,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (g GetPlaylistGeneratorItemsMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorItemsMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetTitle() any { + if g == nil { + return nil + } + return g.Title +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetType() any { + if g == nil { + return nil + } + return g.Type +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetAbsoluteIndex() *int64 { + if g == nil { + return nil + } + return g.AbsoluteIndex +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetAddedAt() *int64 { + if g == nil { + return nil + } + return g.AddedAt +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetArt() any { + if g == nil { + return nil + } + return g.Art +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetAudienceRating() *float64 { + if g == nil { + return nil + } + return g.AudienceRating +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetAudienceRatingImage() any { + if g == nil { + return nil + } + return g.AudienceRatingImage +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetAutotag() []components.Tag { + if g == nil { + return nil + } + return g.Autotag +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetBanner() any { + if g == nil { + return nil + } + return g.Banner +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetChapterSource() any { + if g == nil { + return nil + } + return g.ChapterSource +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetComposite() any { + if g == nil { + return nil + } + return g.Composite +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetContentRating() any { + if g == nil { + return nil + } + return g.ContentRating +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetCountry() []components.Tag { + if g == nil { + return nil + } + return g.Country +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetDirector() []components.Tag { + if g == nil { + return nil + } + return g.Director +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetDuration() *int64 { + if g == nil { + return nil + } + return g.Duration +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetFilter() []components.Filter { + if g == nil { + return nil + } + return g.Filter +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGenre() []components.Tag { + if g == nil { + return nil + } + return g.Genre +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentArt() *string { + if g == nil { + return nil + } + return g.GrandparentArt +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentHero() *string { + if g == nil { + return nil + } + return g.GrandparentHero +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentKey() *string { + if g == nil { + return nil + } + return g.GrandparentKey +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentRatingKey() *string { + if g == nil { + return nil + } + return g.GrandparentRatingKey +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentTheme() *string { + if g == nil { + return nil + } + return g.GrandparentTheme +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentThumb() *string { + if g == nil { + return nil + } + return g.GrandparentThumb +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGrandparentTitle() *string { + if g == nil { + return nil + } + return g.GrandparentTitle +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetGUID() []components.Tag { + if g == nil { + return nil + } + return g.GUID +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetHero() any { + if g == nil { + return nil + } + return g.Hero +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetImage() []components.Image { + if g == nil { + return nil + } + return g.Image +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetIndex() *int64 { + if g == nil { + return nil + } + return g.Index +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetKey() any { + if g == nil { + return nil + } + return g.Key +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetLastViewedAt() *int64 { + if g == nil { + return nil + } + return g.LastViewedAt +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetLeafCount() *int64 { + if g == nil { + return nil + } + return g.LeafCount +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetMedia() []components.Media { + if g == nil { + return nil + } + return g.Media +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetOriginallyAvailableAt() any { + if g == nil { + return nil + } + return g.OriginallyAvailableAt +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetOriginalTitle() any { + if g == nil { + return nil + } + return g.OriginalTitle +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetParentHero() *string { + if g == nil { + return nil + } + return g.ParentHero +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetParentIndex() *int64 { + if g == nil { + return nil + } + return g.ParentIndex +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetParentKey() *string { + if g == nil { + return nil + } + return g.ParentKey +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetParentRatingKey() *string { + if g == nil { + return nil + } + return g.ParentRatingKey +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetParentThumb() *string { + if g == nil { + return nil + } + return g.ParentThumb +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetParentTitle() *string { + if g == nil { + return nil + } + return g.ParentTitle +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetPrimaryExtraKey() any { + if g == nil { + return nil + } + return g.PrimaryExtraKey +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetPrompt() *string { + if g == nil { + return nil + } + return g.Prompt +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetRating() *float64 { + if g == nil { + return nil + } + return g.Rating +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetRatingArray() []components.Tag { + if g == nil { + return nil + } + return g.RatingArray +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetRatingCount() *int64 { + if g == nil { + return nil + } + return g.RatingCount +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetRatingImage() any { + if g == nil { + return nil + } + return g.RatingImage +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetRatingKey() any { + if g == nil { + return nil + } + return g.RatingKey +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetRole() []components.Tag { + if g == nil { + return nil + } + return g.Role +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSearch() *bool { + if g == nil { + return nil + } + return g.Search +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSecondary() *bool { + if g == nil { + return nil + } + return g.Secondary +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSkipChildren() *bool { + if g == nil { + return nil + } + return g.SkipChildren +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSkipParent() *bool { + if g == nil { + return nil + } + return g.SkipParent +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSort() []components.Sort { + if g == nil { + return nil + } + return g.Sort +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetStudio() any { + if g == nil { + return nil + } + return g.Studio +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSubtype() any { + if g == nil { + return nil + } + return g.Subtype +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetSummary() any { + if g == nil { + return nil + } + return g.Summary +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetTagline() any { + if g == nil { + return nil + } + return g.Tagline +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetTheme() any { + if g == nil { + return nil + } + return g.Theme +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetThumb() any { + if g == nil { + return nil + } + return g.Thumb +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetTitleSort() any { + if g == nil { + return nil + } + return g.TitleSort +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetUpdatedAt() *int64 { + if g == nil { + return nil + } + return g.UpdatedAt +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetUserRating() *float64 { + if g == nil { + return nil + } + return g.UserRating +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetViewCount() *int64 { + if g == nil { + return nil + } + return g.ViewCount +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetViewedLeafCount() *int64 { + if g == nil { + return nil + } + return g.ViewedLeafCount +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetViewOffset() *int64 { + if g == nil { + return nil + } + return g.ViewOffset +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetWriter() []components.Tag { + if g == nil { + return nil + } + return g.Writer +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetYear() *int64 { + if g == nil { + return nil + } + return g.Year +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetProcessingState() *ProcessingState { + if g == nil { + return nil + } + return g.ProcessingState +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetProcessingStateContext() *ProcessingStateContext { + if g == nil { + return nil + } + return g.ProcessingStateContext +} + +func (g *GetPlaylistGeneratorItemsMetadata) GetAdditionalProperties() map[string]any { + if g == nil { + return nil + } + return g.AdditionalProperties +} + +// GetPlaylistGeneratorItemsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetPlaylistGeneratorItemsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata *GetPlaylistGeneratorItemsMetadata `json:"Metadata,omitempty"` +} + +func (g *GetPlaylistGeneratorItemsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetPlaylistGeneratorItemsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetPlaylistGeneratorItemsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetPlaylistGeneratorItemsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetPlaylistGeneratorItemsMediaContainer) GetMetadata() *GetPlaylistGeneratorItemsMetadata { + if g == nil { + return nil + } + return g.Metadata +} + +// GetPlaylistGeneratorItemsResponseBody - OK +type GetPlaylistGeneratorItemsResponseBody struct { + MediaContainer *GetPlaylistGeneratorItemsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetPlaylistGeneratorItemsResponseBody) GetMediaContainer() *GetPlaylistGeneratorItemsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetPlaylistGeneratorItemsResponse 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 + // OK + Object *GetPlaylistGeneratorItemsResponseBody +} + +func (g *GetPlaylistGeneratorItemsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPlaylistGeneratorItemsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPlaylistGeneratorItemsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPlaylistGeneratorItemsResponse) GetObject() *GetPlaylistGeneratorItemsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getplaylistgenerators.go b/models/operations/getplaylistgenerators.go new file mode 100644 index 0000000..8ee2cbe --- /dev/null +++ b/models/operations/getplaylistgenerators.go @@ -0,0 +1,442 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPlaylistGeneratorsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPlaylistGeneratorsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGeneratorsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGeneratorsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGeneratorsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGeneratorsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGeneratorsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGeneratorsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGeneratorsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGeneratorsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGeneratorsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPlaylistGeneratorsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` +} + +func (g GetPlaylistGeneratorsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistGeneratorsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistGeneratorsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistGeneratorsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistGeneratorsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistGeneratorsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistGeneratorsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistGeneratorsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistGeneratorsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistGeneratorsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistGeneratorsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistGeneratorsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistGeneratorsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPlaylistGeneratorsRequest) GetPlaylistID() int64 { + if g == nil { + return 0 + } + return g.PlaylistID +} + +// GetPlaylistGeneratorsType - The type of playlist generator. +// +// - -1: A smart playlist generator +// - 42: A optimized version generator +type GetPlaylistGeneratorsType int64 + +const ( + GetPlaylistGeneratorsTypeMinus1 GetPlaylistGeneratorsType = -1 + GetPlaylistGeneratorsTypeFortyTwo GetPlaylistGeneratorsType = 42 +) + +func (e GetPlaylistGeneratorsType) ToPointer() *GetPlaylistGeneratorsType { + return &e +} +func (e *GetPlaylistGeneratorsType) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case -1: + fallthrough + case 42: + *e = GetPlaylistGeneratorsType(v) + return nil + default: + return fmt.Errorf("invalid value for GetPlaylistGeneratorsType: %v", v) + } +} + +type PlayQueueGenerator struct { + ChangedAt *int64 `json:"changedAt,omitempty"` + CreatedAt *int64 `json:"createdAt,omitempty"` + ID *int64 `json:"id,omitempty"` + PlaylistID *int64 `json:"playlistID,omitempty"` + // The type of playlist generator. + // + // - -1: A smart playlist generator + // - 42: A optimized version generator + // + Type *GetPlaylistGeneratorsType `json:"type,omitempty"` + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // The URI indicating the search for this generator + URI *string `json:"uri,omitempty"` +} + +func (p *PlayQueueGenerator) GetChangedAt() *int64 { + if p == nil { + return nil + } + return p.ChangedAt +} + +func (p *PlayQueueGenerator) GetCreatedAt() *int64 { + if p == nil { + return nil + } + return p.CreatedAt +} + +func (p *PlayQueueGenerator) GetID() *int64 { + if p == nil { + return nil + } + return p.ID +} + +func (p *PlayQueueGenerator) GetPlaylistID() *int64 { + if p == nil { + return nil + } + return p.PlaylistID +} + +func (p *PlayQueueGenerator) GetType() *GetPlaylistGeneratorsType { + if p == nil { + return nil + } + return p.Type +} + +func (p *PlayQueueGenerator) GetUpdatedAt() *int64 { + if p == nil { + return nil + } + return p.UpdatedAt +} + +func (p *PlayQueueGenerator) GetURI() *string { + if p == nil { + return nil + } + return p.URI +} + +// GetPlaylistGeneratorsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetPlaylistGeneratorsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + PlayQueueGenerator []PlayQueueGenerator `json:"PlayQueueGenerator,omitempty"` +} + +func (g *GetPlaylistGeneratorsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetPlaylistGeneratorsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetPlaylistGeneratorsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetPlaylistGeneratorsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetPlaylistGeneratorsMediaContainer) GetPlayQueueGenerator() []PlayQueueGenerator { + if g == nil { + return nil + } + return g.PlayQueueGenerator +} + +// GetPlaylistGeneratorsResponseBody - OK +type GetPlaylistGeneratorsResponseBody struct { + MediaContainer *GetPlaylistGeneratorsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetPlaylistGeneratorsResponseBody) GetMediaContainer() *GetPlaylistGeneratorsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetPlaylistGeneratorsResponse 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 + // OK + Object *GetPlaylistGeneratorsResponseBody +} + +func (g *GetPlaylistGeneratorsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPlaylistGeneratorsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPlaylistGeneratorsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPlaylistGeneratorsResponse) GetObject() *GetPlaylistGeneratorsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getplaylistitems.go b/models/operations/getplaylistitems.go new file mode 100644 index 0000000..14fe49d --- /dev/null +++ b/models/operations/getplaylistitems.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPlaylistItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPlaylistItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistItemsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPlaylistItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The metadata types of the item to return. Values past the first are only used in fetching items from the background processing playlist. + Type []int64 `queryParam:"style=form,explode=false,name=type"` +} + +func (g GetPlaylistItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlaylistItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (g *GetPlaylistItemsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlaylistItemsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlaylistItemsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlaylistItemsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlaylistItemsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlaylistItemsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlaylistItemsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlaylistItemsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlaylistItemsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlaylistItemsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlaylistItemsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPlaylistItemsRequest) GetPlaylistID() int64 { + if g == nil { + return 0 + } + return g.PlaylistID +} + +func (g *GetPlaylistItemsRequest) GetType() []int64 { + if g == nil { + return nil + } + return g.Type +} + +type GetPlaylistItemsResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (g *GetPlaylistItemsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPlaylistItemsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPlaylistItemsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPlaylistItemsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} + +func (g *GetPlaylistItemsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getplaylists.go b/models/operations/getplaylists.go deleted file mode 100644 index 0973163..0000000 --- a/models/operations/getplaylists.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "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 -} - -// 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 -} - -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 (g *GetPlaylistsRequest) GetPlaylistType() *PlaylistType { - if g == nil { - return nil - } - return g.PlaylistType -} - -func (g *GetPlaylistsRequest) GetSmart() *QueryParamSmart { - if g == nil { - return nil - } - return g.Smart -} - -type GetPlaylistsMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - GUID *string `json:"guid,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - Summary *string `json:"summary,omitempty"` - Smart *bool `json:"smart,omitempty"` - PlaylistType *string `json:"playlistType,omitempty"` - Composite *string `json:"composite,omitempty"` - Icon *string `json:"icon,omitempty"` - ViewCount *int `json:"viewCount,omitempty"` - LastViewedAt *int `json:"lastViewedAt,omitempty"` - Duration *int `json:"duration,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` -} - -func (g *GetPlaylistsMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetPlaylistsMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetPlaylistsMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetPlaylistsMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetPlaylistsMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetPlaylistsMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetPlaylistsMetadata) GetSmart() *bool { - if g == nil { - return nil - } - return g.Smart -} - -func (g *GetPlaylistsMetadata) GetPlaylistType() *string { - if g == nil { - return nil - } - return g.PlaylistType -} - -func (g *GetPlaylistsMetadata) GetComposite() *string { - if g == nil { - return nil - } - return g.Composite -} - -func (g *GetPlaylistsMetadata) GetIcon() *string { - if g == nil { - return nil - } - return g.Icon -} - -func (g *GetPlaylistsMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetPlaylistsMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetPlaylistsMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetPlaylistsMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetPlaylistsMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetPlaylistsMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -type GetPlaylistsMediaContainer struct { - Size *int `json:"size,omitempty"` - Metadata []GetPlaylistsMetadata `json:"Metadata,omitempty"` -} - -func (g *GetPlaylistsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetPlaylistsMediaContainer) GetMetadata() []GetPlaylistsMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetPlaylistsResponseBody - returns all playlists -type GetPlaylistsResponseBody struct { - MediaContainer *GetPlaylistsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetPlaylistsResponseBody) GetMediaContainer() *GetPlaylistsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // returns all playlists - Object *GetPlaylistsResponseBody -} - -func (g *GetPlaylistsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetPlaylistsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetPlaylistsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetPlaylistsResponse) GetObject() *GetPlaylistsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getplayqueue.go b/models/operations/getplayqueue.go new file mode 100644 index 0000000..e9e340f --- /dev/null +++ b/models/operations/getplayqueue.go @@ -0,0 +1,328 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPlayQueueGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPlayQueueGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlayQueueGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPlayQueueGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlayQueueGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlayQueueGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlayQueueGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlayQueueGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlayQueueGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlayQueueGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlayQueueGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlayQueueGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlayQueueGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlayQueueGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPlayQueueRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` + // If the server should transfer ownership to the requesting client (used in remote control scenarios). + Own *components.BoolInt `queryParam:"style=form,explode=true,name=own"` + // The play queue item ID for the center of the window - this doesn't change the current selected item. + Center *string `queryParam:"style=form,explode=true,name=center"` + // How many items on each side of the center of the window + Window *int64 `queryParam:"style=form,explode=true,name=window"` + // Whether to include the items before the center (if 0, center is not included either), defaults to 1. + IncludeBefore *components.BoolInt `queryParam:"style=form,explode=true,name=includeBefore"` + // Whether to include the items after the center (if 0, center is not included either), defaults to 1. + IncludeAfter *components.BoolInt `queryParam:"style=form,explode=true,name=includeAfter"` +} + +func (g GetPlayQueueRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPlayQueueRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"playQueueId"}); err != nil { + return err + } + return nil +} + +func (g *GetPlayQueueRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPlayQueueRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPlayQueueRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPlayQueueRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPlayQueueRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPlayQueueRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPlayQueueRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPlayQueueRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPlayQueueRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPlayQueueRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPlayQueueRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPlayQueueRequest) GetPlayQueueID() int64 { + if g == nil { + return 0 + } + return g.PlayQueueID +} + +func (g *GetPlayQueueRequest) GetOwn() *components.BoolInt { + if g == nil { + return nil + } + return g.Own +} + +func (g *GetPlayQueueRequest) GetCenter() *string { + if g == nil { + return nil + } + return g.Center +} + +func (g *GetPlayQueueRequest) GetWindow() *int64 { + if g == nil { + return nil + } + return g.Window +} + +func (g *GetPlayQueueRequest) GetIncludeBefore() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeBefore +} + +func (g *GetPlayQueueRequest) GetIncludeAfter() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeAfter +} + +type GetPlayQueueResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (g *GetPlayQueueResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPlayQueueResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPlayQueueResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPlayQueueResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/getpostplayhubs.go b/models/operations/getpostplayhubs.go new file mode 100644 index 0000000..af2fff7 --- /dev/null +++ b/models/operations/getpostplayhubs.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPostplayHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPostplayHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPostplayHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPostplayHubsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPostplayHubsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPostplayHubsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPostplayHubsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPostplayHubsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPostplayHubsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPostplayHubsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPostplayHubsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPostplayHubsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPostplayHubsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPostplayHubsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPostplayHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The metadata ID for the hubs to fetch + MetadataID int64 `pathParam:"style=simple,explode=false,name=metadataId"` + // Limit results to count items + Count *int64 `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 *components.BoolInt `queryParam:"style=form,explode=true,name=onlyTransient"` +} + +func (g GetPostplayHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPostplayHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"metadataId"}); err != nil { + return err + } + return nil +} + +func (g *GetPostplayHubsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPostplayHubsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPostplayHubsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPostplayHubsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPostplayHubsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPostplayHubsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPostplayHubsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPostplayHubsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPostplayHubsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPostplayHubsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPostplayHubsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPostplayHubsRequest) GetMetadataID() int64 { + if g == nil { + return 0 + } + return g.MetadataID +} + +func (g *GetPostplayHubsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetPostplayHubsRequest) GetOnlyTransient() *components.BoolInt { + if g == nil { + return nil + } + return g.OnlyTransient +} + +type GetPostplayHubsResponse 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 + // OK + MediaContainerWithHubs *components.MediaContainerWithHubs + Headers map[string][]string +} + +func (g *GetPostplayHubsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPostplayHubsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPostplayHubsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPostplayHubsResponse) GetMediaContainerWithHubs() *components.MediaContainerWithHubs { + if g == nil { + return nil + } + return g.MediaContainerWithHubs +} + +func (g *GetPostplayHubsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getpreference.go b/models/operations/getpreference.go new file mode 100644 index 0000000..b5bf3c8 --- /dev/null +++ b/models/operations/getpreference.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPreferenceGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPreferenceGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPreferenceGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPreferenceGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPreferenceGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPreferenceGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPreferenceGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPreferenceGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPreferenceGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPreferenceGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPreferenceGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPreferenceGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPreferenceGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPreferenceGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPreferenceRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The preference to fetch + ID *string `queryParam:"style=form,explode=true,name=id"` +} + +func (g GetPreferenceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPreferenceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPreferenceRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPreferenceRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPreferenceRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPreferenceRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPreferenceRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPreferenceRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPreferenceRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPreferenceRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPreferenceRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPreferenceRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPreferenceRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPreferenceRequest) GetID() *string { + if g == nil { + return nil + } + return g.ID +} + +type GetPreferenceResponse 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 + // OK + MediaContainerWithSettings *components.MediaContainerWithSettings +} + +func (g *GetPreferenceResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPreferenceResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPreferenceResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPreferenceResponse) GetMediaContainerWithSettings() *components.MediaContainerWithSettings { + if g == nil { + return nil + } + return g.MediaContainerWithSettings +} diff --git a/models/operations/getpromotedhubs.go b/models/operations/getpromotedhubs.go new file mode 100644 index 0000000..a989cd7 --- /dev/null +++ b/models/operations/getpromotedhubs.go @@ -0,0 +1,353 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetPromotedHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetPromotedHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPromotedHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPromotedHubsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPromotedHubsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPromotedHubsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPromotedHubsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPromotedHubsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPromotedHubsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPromotedHubsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPromotedHubsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPromotedHubsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPromotedHubsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPromotedHubsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetPromotedHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Limit results to count items + Count *int64 `queryParam:"style=form,explode=true,name=count"` +} + +func (g GetPromotedHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetPromotedHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetPromotedHubsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetPromotedHubsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetPromotedHubsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetPromotedHubsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetPromotedHubsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetPromotedHubsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetPromotedHubsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetPromotedHubsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetPromotedHubsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetPromotedHubsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetPromotedHubsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetPromotedHubsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +// GetPromotedHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetPromotedHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (g *GetPromotedHubsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetPromotedHubsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetPromotedHubsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetPromotedHubsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetPromotedHubsMediaContainer) GetHub() []components.Hub { + if g == nil { + return nil + } + return g.Hub +} + +// GetPromotedHubsResponseBody - OK +type GetPromotedHubsResponseBody struct { + MediaContainer *GetPromotedHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetPromotedHubsResponseBody) GetMediaContainer() *GetPromotedHubsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetPromotedHubsResponse 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 + // OK + Object *GetPromotedHubsResponseBody + Headers map[string][]string +} + +func (g *GetPromotedHubsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetPromotedHubsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetPromotedHubsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetPromotedHubsResponse) GetObject() *GetPromotedHubsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetPromotedHubsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getrandomartwork.go b/models/operations/getrandomartwork.go new file mode 100644 index 0000000..890e30a --- /dev/null +++ b/models/operations/getrandomartwork.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetRandomArtworkGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetRandomArtworkGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetRandomArtworkGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetRandomArtworkGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetRandomArtworkGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetRandomArtworkGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetRandomArtworkGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetRandomArtworkGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetRandomArtworkGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetRandomArtworkGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetRandomArtworkGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetRandomArtworkGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetRandomArtworkGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetRandomArtworkGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetRandomArtworkRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The sections for which to fetch artwork. + Sections []int64 `queryParam:"style=form,explode=false,name=sections"` +} + +func (g GetRandomArtworkRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetRandomArtworkRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetRandomArtworkRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetRandomArtworkRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetRandomArtworkRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetRandomArtworkRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetRandomArtworkRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetRandomArtworkRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetRandomArtworkRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetRandomArtworkRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetRandomArtworkRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetRandomArtworkRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetRandomArtworkRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetRandomArtworkRequest) GetSections() []int64 { + if g == nil { + return nil + } + return g.Sections +} + +type GetRandomArtworkResponse 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 + // OK + MediaContainerWithArtwork *components.MediaContainerWithArtwork +} + +func (g *GetRandomArtworkResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetRandomArtworkResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetRandomArtworkResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetRandomArtworkResponse) GetMediaContainerWithArtwork() *components.MediaContainerWithArtwork { + if g == nil { + return nil + } + return g.MediaContainerWithArtwork +} diff --git a/models/operations/getrecentlyadded.go b/models/operations/getrecentlyadded.go deleted file mode 100644 index 8535df9..0000000 --- a/models/operations/getrecentlyadded.go +++ /dev/null @@ -1,2755 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -// Type - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type Type int64 - -const ( - TypeMovie Type = 1 - TypeTvShow Type = 2 - TypeSeason Type = 3 - TypeEpisode Type = 4 - TypeArtist Type = 5 - TypeAlbum Type = 6 - TypeTrack Type = 7 - TypePhotoAlbum Type = 8 - TypePhoto Type = 9 -) - -func (e Type) ToPointer() *Type { - return &e -} - -// IncludeMeta - Adds the Meta object to the response -type IncludeMeta int - -const ( - IncludeMetaDisable IncludeMeta = 0 - IncludeMetaEnable IncludeMeta = 1 -) - -func (e IncludeMeta) ToPointer() *IncludeMeta { - return &e -} -func (e *IncludeMeta) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeMeta(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeMeta: %v", v) - } -} - -type GetRecentlyAddedRequest struct { - // The content directory ID. - ContentDirectoryID int64 `queryParam:"style=form,explode=true,name=contentDirectoryID"` - // Comma-separated list of pinned content directory IDs. - PinnedContentDirectoryID *string `queryParam:"style=form,explode=true,name=pinnedContentDirectoryID"` - // The library section ID for filtering content. - SectionID *int64 `queryParam:"style=form,explode=true,name=sectionID"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type Type `queryParam:"style=form,explode=true,name=type"` - // Adds the Meta object to the response - // - IncludeMeta *IncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"` - // The index of the first item to return. If not specified, the first item will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 0 - // - XPlexContainerStart *int `default:"0" queryParam:"style=form,explode=true,name=X-Plex-Container-Start"` - // The number of items to return. If not specified, all items will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 50 - // - XPlexContainerSize *int `default:"50" queryParam:"style=form,explode=true,name=X-Plex-Container-Size"` -} - -func (g GetRecentlyAddedRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetRecentlyAddedRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"contentDirectoryID", "type"}); err != nil { - return err - } - return nil -} - -func (g *GetRecentlyAddedRequest) GetContentDirectoryID() int64 { - if g == nil { - return 0 - } - return g.ContentDirectoryID -} - -func (g *GetRecentlyAddedRequest) GetPinnedContentDirectoryID() *string { - if g == nil { - return nil - } - return g.PinnedContentDirectoryID -} - -func (g *GetRecentlyAddedRequest) GetSectionID() *int64 { - if g == nil { - return nil - } - return g.SectionID -} - -func (g *GetRecentlyAddedRequest) GetType() Type { - if g == nil { - return Type(0) - } - return g.Type -} - -func (g *GetRecentlyAddedRequest) GetIncludeMeta() *IncludeMeta { - if g == nil { - return nil - } - return g.IncludeMeta -} - -func (g *GetRecentlyAddedRequest) GetXPlexContainerStart() *int { - if g == nil { - return nil - } - return g.XPlexContainerStart -} - -func (g *GetRecentlyAddedRequest) GetXPlexContainerSize() *int { - if g == nil { - return nil - } - return g.XPlexContainerSize -} - -type GetRecentlyAddedFilter struct { - Filter string `json:"filter"` - FilterType string `json:"filterType"` - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - Advanced *bool `json:"advanced,omitempty"` -} - -func (g *GetRecentlyAddedFilter) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetRecentlyAddedFilter) GetFilterType() string { - if g == nil { - return "" - } - return g.FilterType -} - -func (g *GetRecentlyAddedFilter) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedFilter) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetRecentlyAddedFilter) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetRecentlyAddedFilter) GetAdvanced() *bool { - if g == nil { - return nil - } - return g.Advanced -} - -// GetRecentlyAddedActiveDirection - The direction of the sort. Can be either `asc` or `desc`. -type GetRecentlyAddedActiveDirection string - -const ( - GetRecentlyAddedActiveDirectionAscending GetRecentlyAddedActiveDirection = "asc" - GetRecentlyAddedActiveDirectionDescending GetRecentlyAddedActiveDirection = "desc" -) - -func (e GetRecentlyAddedActiveDirection) ToPointer() *GetRecentlyAddedActiveDirection { - return &e -} -func (e *GetRecentlyAddedActiveDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = GetRecentlyAddedActiveDirection(v) - return nil - default: - return fmt.Errorf("invalid value for GetRecentlyAddedActiveDirection: %v", v) - } -} - -// GetRecentlyAddedDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. -type GetRecentlyAddedDefaultDirection string - -const ( - GetRecentlyAddedDefaultDirectionAscending GetRecentlyAddedDefaultDirection = "asc" - GetRecentlyAddedDefaultDirectionDescending GetRecentlyAddedDefaultDirection = "desc" -) - -func (e GetRecentlyAddedDefaultDirection) ToPointer() *GetRecentlyAddedDefaultDirection { - return &e -} -func (e *GetRecentlyAddedDefaultDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = GetRecentlyAddedDefaultDirection(v) - return nil - default: - return fmt.Errorf("invalid value for GetRecentlyAddedDefaultDirection: %v", v) - } -} - -type GetRecentlyAddedSort struct { - Default *string `json:"default,omitempty"` - Active *bool `json:"active,omitempty"` - // The direction of the sort. Can be either `asc` or `desc`. - // - ActiveDirection *GetRecentlyAddedActiveDirection `default:"asc" json:"activeDirection"` - // The direction of the sort. Can be either `asc` or `desc`. - // - DefaultDirection *GetRecentlyAddedDefaultDirection `default:"asc" json:"defaultDirection"` - DescKey *string `json:"descKey,omitempty"` - FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` - Key string `json:"key"` - Title string `json:"title"` -} - -func (g GetRecentlyAddedSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetRecentlyAddedSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { - return err - } - return nil -} - -func (g *GetRecentlyAddedSort) GetDefault() *string { - if g == nil { - return nil - } - return g.Default -} - -func (g *GetRecentlyAddedSort) GetActive() *bool { - if g == nil { - return nil - } - return g.Active -} - -func (g *GetRecentlyAddedSort) GetActiveDirection() *GetRecentlyAddedActiveDirection { - if g == nil { - return nil - } - return g.ActiveDirection -} - -func (g *GetRecentlyAddedSort) GetDefaultDirection() *GetRecentlyAddedDefaultDirection { - if g == nil { - return nil - } - return g.DefaultDirection -} - -func (g *GetRecentlyAddedSort) GetDescKey() *string { - if g == nil { - return nil - } - return g.DescKey -} - -func (g *GetRecentlyAddedSort) GetFirstCharacterKey() *string { - if g == nil { - return nil - } - return g.FirstCharacterKey -} - -func (g *GetRecentlyAddedSort) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedSort) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetRecentlyAddedField struct { - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - SubType *string `json:"subType,omitempty"` -} - -func (g *GetRecentlyAddedField) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedField) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetRecentlyAddedField) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetRecentlyAddedField) GetSubType() *string { - if g == nil { - return nil - } - return g.SubType -} - -type GetRecentlyAddedType struct { - Key string `json:"key"` - Type string `json:"type"` - Subtype *string `json:"subtype,omitempty"` - Title string `json:"title"` - Active bool `json:"active"` - Filter []GetRecentlyAddedFilter `json:"Filter,omitempty"` - Sort []GetRecentlyAddedSort `json:"Sort,omitempty"` - Field []GetRecentlyAddedField `json:"Field,omitempty"` -} - -func (g *GetRecentlyAddedType) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetRecentlyAddedType) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetRecentlyAddedType) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetRecentlyAddedType) GetActive() bool { - if g == nil { - return false - } - return g.Active -} - -func (g *GetRecentlyAddedType) GetFilter() []GetRecentlyAddedFilter { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetRecentlyAddedType) GetSort() []GetRecentlyAddedSort { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetRecentlyAddedType) GetField() []GetRecentlyAddedField { - if g == nil { - return nil - } - return g.Field -} - -type GetRecentlyAddedOperator struct { - Key string `json:"key"` - Title string `json:"title"` -} - -func (g *GetRecentlyAddedOperator) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedOperator) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -type GetRecentlyAddedFieldType struct { - Type string `json:"type"` - Operator []GetRecentlyAddedOperator `json:"Operator"` -} - -func (g *GetRecentlyAddedFieldType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetRecentlyAddedFieldType) GetOperator() []GetRecentlyAddedOperator { - if g == nil { - return []GetRecentlyAddedOperator{} - } - return g.Operator -} - -// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. -type Meta struct { - Type []GetRecentlyAddedType `json:"Type,omitempty"` - FieldType []GetRecentlyAddedFieldType `json:"FieldType,omitempty"` -} - -func (m *Meta) GetType() []GetRecentlyAddedType { - if m == nil { - return nil - } - return m.Type -} - -func (m *Meta) GetFieldType() []GetRecentlyAddedFieldType { - if m == nil { - return nil - } - return m.FieldType -} - -// GetRecentlyAddedHubsType - The type of media content in the Plex library. This can represent videos, music, or photos. -type GetRecentlyAddedHubsType string - -const ( - GetRecentlyAddedHubsTypeMovie GetRecentlyAddedHubsType = "movie" - GetRecentlyAddedHubsTypeTvShow GetRecentlyAddedHubsType = "show" - GetRecentlyAddedHubsTypeSeason GetRecentlyAddedHubsType = "season" - GetRecentlyAddedHubsTypeEpisode GetRecentlyAddedHubsType = "episode" - GetRecentlyAddedHubsTypeArtist GetRecentlyAddedHubsType = "artist" - GetRecentlyAddedHubsTypeAlbum GetRecentlyAddedHubsType = "album" - GetRecentlyAddedHubsTypeTrack GetRecentlyAddedHubsType = "track" - GetRecentlyAddedHubsTypePhotoAlbum GetRecentlyAddedHubsType = "photoalbum" - GetRecentlyAddedHubsTypePhoto GetRecentlyAddedHubsType = "photo" - GetRecentlyAddedHubsTypeCollection GetRecentlyAddedHubsType = "collection" -) - -func (e GetRecentlyAddedHubsType) ToPointer() *GetRecentlyAddedHubsType { - return &e -} - -type GetRecentlyAddedHubsResponseType string - -const ( - GetRecentlyAddedHubsResponseTypeCoverPoster GetRecentlyAddedHubsResponseType = "coverPoster" - GetRecentlyAddedHubsResponseTypeBackground GetRecentlyAddedHubsResponseType = "background" - GetRecentlyAddedHubsResponseTypeSnapshot GetRecentlyAddedHubsResponseType = "snapshot" - GetRecentlyAddedHubsResponseTypeClearLogo GetRecentlyAddedHubsResponseType = "clearLogo" -) - -func (e GetRecentlyAddedHubsResponseType) ToPointer() *GetRecentlyAddedHubsResponseType { - return &e -} - -type GetRecentlyAddedImage struct { - Alt string `json:"alt"` - Type GetRecentlyAddedHubsResponseType `json:"type"` - URL string `json:"url"` -} - -func (g *GetRecentlyAddedImage) GetAlt() string { - if g == nil { - return "" - } - return g.Alt -} - -func (g *GetRecentlyAddedImage) GetType() GetRecentlyAddedHubsResponseType { - if g == nil { - return GetRecentlyAddedHubsResponseType("") - } - return g.Type -} - -func (g *GetRecentlyAddedImage) GetURL() string { - if g == nil { - return "" - } - return g.URL -} - -type UltraBlurColors struct { - TopLeft string `json:"topLeft"` - TopRight string `json:"topRight"` - BottomRight string `json:"bottomRight"` - BottomLeft string `json:"bottomLeft"` -} - -func (u *UltraBlurColors) GetTopLeft() string { - if u == nil { - return "" - } - return u.TopLeft -} - -func (u *UltraBlurColors) GetTopRight() string { - if u == nil { - return "" - } - return u.TopRight -} - -func (u *UltraBlurColors) GetBottomRight() string { - if u == nil { - return "" - } - return u.BottomRight -} - -func (u *UltraBlurColors) GetBottomLeft() string { - if u == nil { - return "" - } - return u.BottomLeft -} - -type Guids struct { - // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// - // - ID string `json:"id"` -} - -func (g *Guids) GetID() string { - if g == nil { - return "" - } - return g.ID -} - -type One int - -const ( - OneZero One = 0 - OneOne One = 1 -) - -func (e One) ToPointer() *One { - return &e -} -func (e *One) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = One(v) - return nil - default: - return fmt.Errorf("invalid value for One: %v", v) - } -} - -type OptimizedForStreamingType string - -const ( - OptimizedForStreamingTypeOne OptimizedForStreamingType = "1" - OptimizedForStreamingTypeBoolean OptimizedForStreamingType = "boolean" -) - -// OptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type OptimizedForStreaming struct { - One *One `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type OptimizedForStreamingType -} - -func CreateOptimizedForStreamingOne(one One) OptimizedForStreaming { - typ := OptimizedForStreamingTypeOne - - return OptimizedForStreaming{ - One: &one, - Type: typ, - } -} - -func CreateOptimizedForStreamingBoolean(boolean bool) OptimizedForStreaming { - typ := OptimizedForStreamingTypeBoolean - - return OptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *OptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var one One = One(0) - if err := utils.UnmarshalJSON(data, &one, "", true, nil); err == nil { - u.One = &one - u.Type = OptimizedForStreamingTypeOne - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = OptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for OptimizedForStreaming", string(data)) -} - -func (u OptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.One != nil { - return utils.MarshalJSON(u.One, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type OptimizedForStreaming: all fields are null") -} - -type GetRecentlyAddedOptimizedForStreaming1 int - -const ( - GetRecentlyAddedOptimizedForStreaming1Zero GetRecentlyAddedOptimizedForStreaming1 = 0 - GetRecentlyAddedOptimizedForStreaming1One GetRecentlyAddedOptimizedForStreaming1 = 1 -) - -func (e GetRecentlyAddedOptimizedForStreaming1) ToPointer() *GetRecentlyAddedOptimizedForStreaming1 { - return &e -} -func (e *GetRecentlyAddedOptimizedForStreaming1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetRecentlyAddedOptimizedForStreaming1(v) - return nil - default: - return fmt.Errorf("invalid value for GetRecentlyAddedOptimizedForStreaming1: %v", v) - } -} - -type GetRecentlyAddedOptimizedForStreamingType string - -const ( - GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreamingType = "get-recently-added_optimizedForStreaming_1" - GetRecentlyAddedOptimizedForStreamingTypeBoolean GetRecentlyAddedOptimizedForStreamingType = "boolean" -) - -// GetRecentlyAddedOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetRecentlyAddedOptimizedForStreaming struct { - GetRecentlyAddedOptimizedForStreaming1 *GetRecentlyAddedOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetRecentlyAddedOptimizedForStreamingType -} - -func CreateGetRecentlyAddedOptimizedForStreamingGetRecentlyAddedOptimizedForStreaming1(getRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreaming1) GetRecentlyAddedOptimizedForStreaming { - typ := GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1 - - return GetRecentlyAddedOptimizedForStreaming{ - GetRecentlyAddedOptimizedForStreaming1: &getRecentlyAddedOptimizedForStreaming1, - Type: typ, - } -} - -func CreateGetRecentlyAddedOptimizedForStreamingBoolean(boolean bool) GetRecentlyAddedOptimizedForStreaming { - typ := GetRecentlyAddedOptimizedForStreamingTypeBoolean - - return GetRecentlyAddedOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetRecentlyAddedOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreaming1 = GetRecentlyAddedOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getRecentlyAddedOptimizedForStreaming1, "", true, nil); err == nil { - u.GetRecentlyAddedOptimizedForStreaming1 = &getRecentlyAddedOptimizedForStreaming1 - u.Type = GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetRecentlyAddedOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetRecentlyAddedOptimizedForStreaming", string(data)) -} - -func (u GetRecentlyAddedOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetRecentlyAddedOptimizedForStreaming1 != nil { - return utils.MarshalJSON(u.GetRecentlyAddedOptimizedForStreaming1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetRecentlyAddedOptimizedForStreaming: all fields are null") -} - -// HasThumbnail - Indicates if the part has a thumbnail. -type HasThumbnail string - -const ( - HasThumbnailFalse HasThumbnail = "0" - HasThumbnailTrue HasThumbnail = "1" -) - -func (e HasThumbnail) ToPointer() *HasThumbnail { - return &e -} -func (e *HasThumbnail) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "0": - fallthrough - case "1": - *e = HasThumbnail(v) - return nil - default: - return fmt.Errorf("invalid value for HasThumbnail: %v", v) - } -} - -type Stream struct { - // Unique stream identifier. - ID int64 `json:"id"` - // Stream type: - // - VIDEO = 1 - // - AUDIO = 2 - // - SUBTITLE = 3 - // - streamType int64 `const:"1" json:"streamType"` - // Format of the stream (e.g., srt). - Format *string `json:"format,omitempty"` - // Indicates if this stream is default. - Default *bool `json:"default,omitempty"` - // Codec used by the stream. - Codec string `json:"codec"` - // Index of the stream. - Index *int `json:"index,omitempty"` - // Bitrate of the stream. - Bitrate *int `json:"bitrate,omitempty"` - // Language of the stream. - Language *string `json:"language,omitempty"` - // Language tag (e.g., en). - LanguageTag *string `json:"languageTag,omitempty"` - // ISO language code. - LanguageCode *string `json:"languageCode,omitempty"` - // Indicates whether header compression is enabled. - HeaderCompression *bool `json:"headerCompression,omitempty"` - // Dolby Vision BL compatibility ID. - DOVIBLCompatID *int `json:"DOVIBLCompatID,omitempty"` - // Indicates if Dolby Vision BL is present. - DOVIBLPresent *bool `json:"DOVIBLPresent,omitempty"` - // Indicates if Dolby Vision EL is present. - DOVIELPresent *bool `json:"DOVIELPresent,omitempty"` - // Dolby Vision level. - DOVILevel *int `json:"DOVILevel,omitempty"` - // Indicates if Dolby Vision is present. - DOVIPresent *bool `json:"DOVIPresent,omitempty"` - // Dolby Vision profile. - DOVIProfile *int `json:"DOVIProfile,omitempty"` - // Indicates if Dolby Vision RPU is present. - DOVIRPUPresent *bool `json:"DOVIRPUPresent,omitempty"` - // Dolby Vision version. - DOVIVersion *string `json:"DOVIVersion,omitempty"` - // Bit depth of the video stream. - BitDepth *int `json:"bitDepth,omitempty"` - // Chroma sample location. - ChromaLocation *string `json:"chromaLocation,omitempty"` - // Chroma subsampling format. - ChromaSubsampling *string `json:"chromaSubsampling,omitempty"` - // Coded video height. - CodedHeight *int `json:"codedHeight,omitempty"` - // Coded video width. - CodedWidth *int `json:"codedWidth,omitempty"` - ClosedCaptions *bool `json:"closedCaptions,omitempty"` - // Color primaries used. - ColorPrimaries *string `json:"colorPrimaries,omitempty"` - // Color range (e.g., tv). - ColorRange *string `json:"colorRange,omitempty"` - // Color space. - ColorSpace *string `json:"colorSpace,omitempty"` - // Color transfer characteristics. - ColorTrc *string `json:"colorTrc,omitempty"` - // Frame rate of the stream. - FrameRate *float32 `json:"frameRate,omitempty"` - // Key to access this stream part. - Key *string `json:"key,omitempty"` - // Height of the video stream. - Height *int `json:"height,omitempty"` - // Video level. - Level *int `json:"level,omitempty"` - // Indicates if this is the original stream. - Original *bool `json:"original,omitempty"` - HasScalingMatrix *bool `json:"hasScalingMatrix,omitempty"` - // Video profile. - Profile *string `json:"profile,omitempty"` - ScanType *string `json:"scanType,omitempty"` - EmbeddedInVideo *string `json:"embeddedInVideo,omitempty"` - // Number of reference frames. - RefFrames *int `json:"refFrames,omitempty"` - // Width of the video stream. - Width *int `json:"width,omitempty"` - // Display title for the stream. - DisplayTitle string `json:"displayTitle"` - // Extended display title for the stream. - ExtendedDisplayTitle string `json:"extendedDisplayTitle"` - // Indicates if this stream is selected (applicable for audio streams). - Selected *bool `json:"selected,omitempty"` - Forced *bool `json:"forced,omitempty"` - // Number of audio channels (for audio streams). - Channels *int `json:"channels,omitempty"` - // Audio channel layout. - AudioChannelLayout *string `json:"audioChannelLayout,omitempty"` - // Sampling rate for the audio stream. - SamplingRate *int `json:"samplingRate,omitempty"` - // Indicates if the stream can auto-sync. - CanAutoSync *bool `json:"canAutoSync,omitempty"` - // Indicates if the stream is for the hearing impaired. - HearingImpaired *bool `json:"hearingImpaired,omitempty"` - // Indicates if the stream is a dub. - Dub *bool `json:"dub,omitempty"` - // Optional title for the stream (e.g., language variant). - Title *string `json:"title,omitempty"` -} - -func (s Stream) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *Stream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, []string{"id", "streamType", "codec", "displayTitle", "extendedDisplayTitle"}); err != nil { - return err - } - return nil -} - -func (s *Stream) GetID() int64 { - if s == nil { - return 0 - } - return s.ID -} - -func (s *Stream) GetStreamType() int64 { - return 1 -} - -func (s *Stream) GetFormat() *string { - if s == nil { - return nil - } - return s.Format -} - -func (s *Stream) GetDefault() *bool { - if s == nil { - return nil - } - return s.Default -} - -func (s *Stream) GetCodec() string { - if s == nil { - return "" - } - return s.Codec -} - -func (s *Stream) GetIndex() *int { - if s == nil { - return nil - } - return s.Index -} - -func (s *Stream) GetBitrate() *int { - if s == nil { - return nil - } - return s.Bitrate -} - -func (s *Stream) GetLanguage() *string { - if s == nil { - return nil - } - return s.Language -} - -func (s *Stream) GetLanguageTag() *string { - if s == nil { - return nil - } - return s.LanguageTag -} - -func (s *Stream) GetLanguageCode() *string { - if s == nil { - return nil - } - return s.LanguageCode -} - -func (s *Stream) GetHeaderCompression() *bool { - if s == nil { - return nil - } - return s.HeaderCompression -} - -func (s *Stream) GetDOVIBLCompatID() *int { - if s == nil { - return nil - } - return s.DOVIBLCompatID -} - -func (s *Stream) GetDOVIBLPresent() *bool { - if s == nil { - return nil - } - return s.DOVIBLPresent -} - -func (s *Stream) GetDOVIELPresent() *bool { - if s == nil { - return nil - } - return s.DOVIELPresent -} - -func (s *Stream) GetDOVILevel() *int { - if s == nil { - return nil - } - return s.DOVILevel -} - -func (s *Stream) GetDOVIPresent() *bool { - if s == nil { - return nil - } - return s.DOVIPresent -} - -func (s *Stream) GetDOVIProfile() *int { - if s == nil { - return nil - } - return s.DOVIProfile -} - -func (s *Stream) GetDOVIRPUPresent() *bool { - if s == nil { - return nil - } - return s.DOVIRPUPresent -} - -func (s *Stream) GetDOVIVersion() *string { - if s == nil { - return nil - } - return s.DOVIVersion -} - -func (s *Stream) GetBitDepth() *int { - if s == nil { - return nil - } - return s.BitDepth -} - -func (s *Stream) GetChromaLocation() *string { - if s == nil { - return nil - } - return s.ChromaLocation -} - -func (s *Stream) GetChromaSubsampling() *string { - if s == nil { - return nil - } - return s.ChromaSubsampling -} - -func (s *Stream) GetCodedHeight() *int { - if s == nil { - return nil - } - return s.CodedHeight -} - -func (s *Stream) GetCodedWidth() *int { - if s == nil { - return nil - } - return s.CodedWidth -} - -func (s *Stream) GetClosedCaptions() *bool { - if s == nil { - return nil - } - return s.ClosedCaptions -} - -func (s *Stream) GetColorPrimaries() *string { - if s == nil { - return nil - } - return s.ColorPrimaries -} - -func (s *Stream) GetColorRange() *string { - if s == nil { - return nil - } - return s.ColorRange -} - -func (s *Stream) GetColorSpace() *string { - if s == nil { - return nil - } - return s.ColorSpace -} - -func (s *Stream) GetColorTrc() *string { - if s == nil { - return nil - } - return s.ColorTrc -} - -func (s *Stream) GetFrameRate() *float32 { - if s == nil { - return nil - } - return s.FrameRate -} - -func (s *Stream) GetKey() *string { - if s == nil { - return nil - } - return s.Key -} - -func (s *Stream) GetHeight() *int { - if s == nil { - return nil - } - return s.Height -} - -func (s *Stream) GetLevel() *int { - if s == nil { - return nil - } - return s.Level -} - -func (s *Stream) GetOriginal() *bool { - if s == nil { - return nil - } - return s.Original -} - -func (s *Stream) GetHasScalingMatrix() *bool { - if s == nil { - return nil - } - return s.HasScalingMatrix -} - -func (s *Stream) GetProfile() *string { - if s == nil { - return nil - } - return s.Profile -} - -func (s *Stream) GetScanType() *string { - if s == nil { - return nil - } - return s.ScanType -} - -func (s *Stream) GetEmbeddedInVideo() *string { - if s == nil { - return nil - } - return s.EmbeddedInVideo -} - -func (s *Stream) GetRefFrames() *int { - if s == nil { - return nil - } - return s.RefFrames -} - -func (s *Stream) GetWidth() *int { - if s == nil { - return nil - } - return s.Width -} - -func (s *Stream) GetDisplayTitle() string { - if s == nil { - return "" - } - return s.DisplayTitle -} - -func (s *Stream) GetExtendedDisplayTitle() string { - if s == nil { - return "" - } - return s.ExtendedDisplayTitle -} - -func (s *Stream) GetSelected() *bool { - if s == nil { - return nil - } - return s.Selected -} - -func (s *Stream) GetForced() *bool { - if s == nil { - return nil - } - return s.Forced -} - -func (s *Stream) GetChannels() *int { - if s == nil { - return nil - } - return s.Channels -} - -func (s *Stream) GetAudioChannelLayout() *string { - if s == nil { - return nil - } - return s.AudioChannelLayout -} - -func (s *Stream) GetSamplingRate() *int { - if s == nil { - return nil - } - return s.SamplingRate -} - -func (s *Stream) GetCanAutoSync() *bool { - if s == nil { - return nil - } - return s.CanAutoSync -} - -func (s *Stream) GetHearingImpaired() *bool { - if s == nil { - return nil - } - return s.HearingImpaired -} - -func (s *Stream) GetDub() *bool { - if s == nil { - return nil - } - return s.Dub -} - -func (s *Stream) GetTitle() *string { - if s == nil { - return nil - } - return s.Title -} - -type Part struct { - // Indicates if the part is accessible. - Accessible *bool `json:"accessible,omitempty"` - // Indicates if the part exists. - Exists *bool `json:"exists,omitempty"` - // Unique part identifier. - ID int64 `json:"id"` - // Key to access this part. - Key string `json:"key"` - Indexes *string `json:"indexes,omitempty"` - // Duration of the part in milliseconds. - Duration *int `json:"duration,omitempty"` - // File path for the part. - File string `json:"file"` - // File size in bytes. - Size int64 `json:"size"` - PacketLength *int `json:"packetLength,omitempty"` - // Container format of the part. - Container *string `json:"container,omitempty"` - // Video profile for the part. - VideoProfile *string `json:"videoProfile,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *GetRecentlyAddedOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - HasThumbnail *HasThumbnail `default:"0" json:"hasThumbnail"` - // An array of streams for this part. - Stream []Stream `json:"Stream,omitempty"` -} - -func (p Part) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Part) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"id", "key", "file", "size"}); err != nil { - return err - } - return nil -} - -func (p *Part) GetAccessible() *bool { - if p == nil { - return nil - } - return p.Accessible -} - -func (p *Part) GetExists() *bool { - if p == nil { - return nil - } - return p.Exists -} - -func (p *Part) GetID() int64 { - if p == nil { - return 0 - } - return p.ID -} - -func (p *Part) GetKey() string { - if p == nil { - return "" - } - return p.Key -} - -func (p *Part) GetIndexes() *string { - if p == nil { - return nil - } - return p.Indexes -} - -func (p *Part) GetDuration() *int { - if p == nil { - return nil - } - return p.Duration -} - -func (p *Part) GetFile() string { - if p == nil { - return "" - } - return p.File -} - -func (p *Part) GetSize() int64 { - if p == nil { - return 0 - } - return p.Size -} - -func (p *Part) GetPacketLength() *int { - if p == nil { - return nil - } - return p.PacketLength -} - -func (p *Part) GetContainer() *string { - if p == nil { - return nil - } - return p.Container -} - -func (p *Part) GetVideoProfile() *string { - if p == nil { - return nil - } - return p.VideoProfile -} - -func (p *Part) GetAudioProfile() *string { - if p == nil { - return nil - } - return p.AudioProfile -} - -func (p *Part) GetHas64bitOffsets() *bool { - if p == nil { - return nil - } - return p.Has64bitOffsets -} - -func (p *Part) GetOptimizedForStreaming() *GetRecentlyAddedOptimizedForStreaming { - if p == nil { - return nil - } - return p.OptimizedForStreaming -} - -func (p *Part) GetHasThumbnail() *HasThumbnail { - if p == nil { - return nil - } - return p.HasThumbnail -} - -func (p *Part) GetStream() []Stream { - if p == nil { - return nil - } - return p.Stream -} - -type Media struct { - // Unique media identifier. - ID int64 `json:"id"` - // Duration of the media in milliseconds. - Duration *int `json:"duration,omitempty"` - // Bitrate in bits per second. - Bitrate *int `json:"bitrate,omitempty"` - // Video width in pixels. - Width *int `json:"width,omitempty"` - // Video height in pixels. - Height *int `json:"height,omitempty"` - // Aspect ratio of the video. - AspectRatio *float32 `json:"aspectRatio,omitempty"` - // Number of audio channels. - AudioChannels *int `json:"audioChannels,omitempty"` - DisplayOffset *int `json:"displayOffset,omitempty"` - // Audio codec used. - AudioCodec *string `json:"audioCodec,omitempty"` - // Video codec used. - VideoCodec *string `json:"videoCodec,omitempty"` - // Video resolution (e.g., 4k). - VideoResolution *string `json:"videoResolution,omitempty"` - // File container type. - Container *string `json:"container,omitempty"` - // Frame rate of the video. Values found include NTSC, PAL, 24p - // - VideoFrameRate *string `json:"videoFrameRate,omitempty"` - // Video profile (e.g., main 10). - VideoProfile *string `json:"videoProfile,omitempty"` - // Indicates whether voice activity is detected. - HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *OptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // An array of parts for this media item. - Part []Part `json:"Part,omitempty"` -} - -func (m *Media) GetID() int64 { - if m == nil { - return 0 - } - return m.ID -} - -func (m *Media) GetDuration() *int { - if m == nil { - return nil - } - return m.Duration -} - -func (m *Media) GetBitrate() *int { - if m == nil { - return nil - } - return m.Bitrate -} - -func (m *Media) GetWidth() *int { - if m == nil { - return nil - } - return m.Width -} - -func (m *Media) GetHeight() *int { - if m == nil { - return nil - } - return m.Height -} - -func (m *Media) GetAspectRatio() *float32 { - if m == nil { - return nil - } - return m.AspectRatio -} - -func (m *Media) GetAudioChannels() *int { - if m == nil { - return nil - } - return m.AudioChannels -} - -func (m *Media) GetDisplayOffset() *int { - if m == nil { - return nil - } - return m.DisplayOffset -} - -func (m *Media) GetAudioCodec() *string { - if m == nil { - return nil - } - return m.AudioCodec -} - -func (m *Media) GetVideoCodec() *string { - if m == nil { - return nil - } - return m.VideoCodec -} - -func (m *Media) GetVideoResolution() *string { - if m == nil { - return nil - } - return m.VideoResolution -} - -func (m *Media) GetContainer() *string { - if m == nil { - return nil - } - return m.Container -} - -func (m *Media) GetVideoFrameRate() *string { - if m == nil { - return nil - } - return m.VideoFrameRate -} - -func (m *Media) GetVideoProfile() *string { - if m == nil { - return nil - } - return m.VideoProfile -} - -func (m *Media) GetHasVoiceActivity() *bool { - if m == nil { - return nil - } - return m.HasVoiceActivity -} - -func (m *Media) GetAudioProfile() *string { - if m == nil { - return nil - } - return m.AudioProfile -} - -func (m *Media) GetOptimizedForStreaming() *OptimizedForStreaming { - if m == nil { - return nil - } - return m.OptimizedForStreaming -} - -func (m *Media) GetHas64bitOffsets() *bool { - if m == nil { - return nil - } - return m.Has64bitOffsets -} - -func (m *Media) GetPart() []Part { - if m == nil { - return nil - } - return m.Part -} - -// Genre - The filter query string for similar items. -type Genre struct { - // The unique identifier for the genre. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - Filter string `json:"filter"` - // The genre name of this media-item - // - Tag string `json:"tag"` -} - -func (g *Genre) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *Genre) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *Genre) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -// Country - The filter query string for country media items. -type Country struct { - // The unique identifier for the country. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The country of origin of this media item - Tag string `json:"tag"` - Filter string `json:"filter"` -} - -func (c *Country) GetID() int { - if c == nil { - return 0 - } - return c.ID -} - -func (c *Country) GetTag() string { - if c == nil { - return "" - } - return c.Tag -} - -func (c *Country) GetFilter() string { - if c == nil { - return "" - } - return c.Filter -} - -type Director struct { - // Unique identifier for the director. - ID int `json:"id"` - // The filter string used to query this director. - Filter string `json:"filter"` - // The role of Director - Tag string `json:"tag"` - // A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. - TagKey string `json:"tagKey"` - // The absolute URL of the thumbnail image for the director. - Thumb *string `json:"thumb,omitempty"` -} - -func (d *Director) GetID() int { - if d == nil { - return 0 - } - return d.ID -} - -func (d *Director) GetFilter() string { - if d == nil { - return "" - } - return d.Filter -} - -func (d *Director) GetTag() string { - if d == nil { - return "" - } - return d.Tag -} - -func (d *Director) GetTagKey() string { - if d == nil { - return "" - } - return d.TagKey -} - -func (d *Director) GetThumb() *string { - if d == nil { - return nil - } - return d.Thumb -} - -type Writer struct { - // Unique identifier for the writer. - ID int `json:"id"` - // The filter string used to query this writer. - Filter string `json:"filter"` - // The role of Writer - Tag string `json:"tag"` - // A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. - TagKey *string `json:"tagKey,omitempty"` - // The absolute URL of the thumbnail image for the writer. - Thumb *string `json:"thumb,omitempty"` -} - -func (w *Writer) GetID() int { - if w == nil { - return 0 - } - return w.ID -} - -func (w *Writer) GetFilter() string { - if w == nil { - return "" - } - return w.Filter -} - -func (w *Writer) GetTag() string { - if w == nil { - return "" - } - return w.Tag -} - -func (w *Writer) GetTagKey() *string { - if w == nil { - return nil - } - return w.TagKey -} - -func (w *Writer) GetThumb() *string { - if w == nil { - return nil - } - return w.Thumb -} - -type Role struct { - // The unique identifier for the role. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. - Filter string `json:"filter"` - // The display tag for the actor (typically the actor's name). - Tag string `json:"tag"` - // A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification. - // NOTE: This is globally unique across all Plex Servers. - // - TagKey string `json:"tagKey"` - // The role played by the actor in the media item. - Role *string `json:"role,omitempty"` - // The absolute URL of the thumbnail image for the actor. - Thumb *string `json:"thumb,omitempty"` -} - -func (r *Role) GetID() int { - if r == nil { - return 0 - } - return r.ID -} - -func (r *Role) GetFilter() string { - if r == nil { - return "" - } - return r.Filter -} - -func (r *Role) GetTag() string { - if r == nil { - return "" - } - return r.Tag -} - -func (r *Role) GetTagKey() string { - if r == nil { - return "" - } - return r.TagKey -} - -func (r *Role) GetRole() *string { - if r == nil { - return nil - } - return r.Role -} - -func (r *Role) GetThumb() *string { - if r == nil { - return nil - } - return r.Thumb -} - -type Producer struct { - // Unique identifier for the producer. - ID int `json:"id"` - // The filter string used to query this producer. - Filter string `json:"filter"` - // The name of the producer - Tag string `json:"tag"` - // A 24-character hexadecimal unique key associated with the producer's tag, used for internal identification. - // - TagKey string `json:"tagKey"` - // The absolute URL of the thumbnail image for the producer. - Thumb *string `json:"thumb,omitempty"` -} - -func (p *Producer) GetID() int { - if p == nil { - return 0 - } - return p.ID -} - -func (p *Producer) GetFilter() string { - if p == nil { - return "" - } - return p.Filter -} - -func (p *Producer) GetTag() string { - if p == nil { - return "" - } - return p.Tag -} - -func (p *Producer) GetTagKey() string { - if p == nil { - return "" - } - return p.TagKey -} - -func (p *Producer) GetThumb() *string { - if p == nil { - return nil - } - return p.Thumb -} - -// Rating - The type of rating, for example 'audience' or 'critic'. -type Rating struct { - // The URL for the rating image, for example from IMDb. - Image string `json:"image"` - Value float32 `json:"value"` - Type string `json:"type"` -} - -func (r *Rating) GetImage() string { - if r == nil { - return "" - } - return r.Image -} - -func (r *Rating) GetValue() float32 { - if r == nil { - return 0.0 - } - return r.Value -} - -func (r *Rating) GetType() string { - if r == nil { - return "" - } - return r.Type -} - -// Similar - The display tag for the similar item, typically the title. -type Similar struct { - ID int `json:"id"` - Filter string `json:"filter"` - Tag string `json:"tag"` -} - -func (s *Similar) GetID() int { - if s == nil { - return 0 - } - return s.ID -} - -func (s *Similar) GetFilter() string { - if s == nil { - return "" - } - return s.Filter -} - -func (s *Similar) GetTag() string { - if s == nil { - return "" - } - return s.Tag -} - -// Location - The folder path for the media item. -type Location struct { - Path string `json:"path"` -} - -func (l *Location) GetPath() string { - if l == nil { - return "" - } - return l.Path -} - -type Collection struct { - // The user-made collection this media item belongs to - Tag string `json:"tag"` -} - -func (c *Collection) GetTag() string { - if c == nil { - return "" - } - return c.Tag -} - -// GetRecentlyAddedMetadata - Unknown -type GetRecentlyAddedMetadata struct { - AddedAt int64 `json:"addedAt"` - // The art image URL for the media item. - Art string `json:"art"` - // The URL for the audience rating image. - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - // The audience rating for the media item. - AudienceRating float64 `json:"audienceRating"` - // The source from which chapter data is derived. - ChapterSource *string `json:"chapterSource,omitempty"` - // The number of child items associated with this media item. - ChildCount int `json:"childCount"` - // The content rating for the media item. - ContentRating *string `json:"contentRating,omitempty"` - // The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). - CreatedAtAccuracy *string `json:"createdAtAccuracy,omitempty"` - // The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. - CreatedAtTZOffset *string `json:"createdAtTZOffset,omitempty"` - // The duration of the media item in milliseconds. - Duration int `json:"duration"` - // The art URL for the grandparent media item. - GrandparentArt *string `json:"grandparentArt,omitempty"` - // The GUID of the grandparent media item. - GrandparentGUID *string `json:"grandparentGuid,omitempty"` - // The key of the grandparent media item. - GrandparentKey *string `json:"grandparentKey,omitempty"` - // The rating key of the grandparent media item. - GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` - // The slug for the grandparent media item. - GrandparentSlug *string `json:"grandparentSlug,omitempty"` - // The theme URL for the grandparent media item. - GrandparentTheme *string `json:"grandparentTheme,omitempty"` - // The thumbnail URL for the grandparent media item. - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - // The title of the grandparent media item. - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - // The globally unique identifier for the media item. - GUID string `json:"guid"` - // The index position of the media item. - Index int `json:"index"` - // The unique key for the media item. - Key string `json:"key"` - // The Unix timestamp representing the last time the item was rated. - LastRatedAt *int64 `json:"lastRatedAt,omitempty"` - // Unix timestamp for when the media item was last viewed. - LastViewedAt *int `json:"lastViewedAt,omitempty"` - // The number of leaf items (end nodes) under this media item. - LeafCount *int `json:"leafCount,omitempty"` - // The identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The key corresponding to the library section. - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The original title of the media item (if different). - OriginalTitle *string `json:"originalTitle,omitempty"` - // The original release date of the media item. - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - // The GUID of the parent media item. - ParentGUID *string `json:"parentGuid,omitempty"` - // The index position of the parent media item. - ParentIndex *int `json:"parentIndex,omitempty"` - // The key of the parent media item. - ParentKey *string `json:"parentKey,omitempty"` - // The rating key of the parent media item. - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - // The slug for the parent media item. - ParentSlug *string `json:"parentSlug,omitempty"` - // The studio of the parent media item. - ParentStudio string `json:"parentStudio"` - // The theme URL for the parent media item. - ParentTheme string `json:"parentTheme"` - // The thumbnail URL for the parent media item. - ParentThumb *string `json:"parentThumb,omitempty"` - // The title of the parent media item. - ParentTitle *string `json:"parentTitle,omitempty"` - // The release year of the parent media item. - ParentYear *int `json:"parentYear,omitempty"` - // The primary extra key associated with this media item. - PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` - // The URL for the rating image. - RatingImage *string `json:"ratingImage,omitempty"` - // The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. - RatingKey string `json:"ratingKey"` - // The critic rating for the media item. - Rating float32 `json:"rating"` - // The total number of seasons (for TV shows). - SeasonCount int `json:"seasonCount"` - // The number of times this media item has been skipped. - SkipCount *int `json:"skipCount,omitempty"` - // A URL‐friendly version of the media title. - Slug string `json:"slug"` - // The studio that produced the media item. - Studio *string `json:"studio,omitempty"` - // A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. - Subtype *string `json:"subtype,omitempty"` - // A synopsis of the media item. - Summary string `json:"summary"` - // A brief tagline for the media item. - Tagline string `json:"tagline"` - // The theme URL for the media item. - Theme string `json:"theme"` - // The thumbnail image URL for the media item. - Thumb string `json:"thumb"` - // The sort title used for ordering media items. - TitleSort string `json:"titleSort"` - // The title of the media item. - Title string `json:"title"` - Type GetRecentlyAddedHubsType `json:"type"` - // Unix epoch datetime in seconds - UpdatedAt *int64 `json:"updatedAt,omitempty"` - // The rating provided by a user for the item. This value is expressed as a decimal number. - UserRating *float32 `json:"userRating,omitempty"` - // The number of times this media item has been viewed. - ViewCount *int `json:"viewCount,omitempty"` - // The current playback offset (in milliseconds). - ViewOffset *int `json:"viewOffset,omitempty"` - // The number of leaf items that have been viewed. - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - // The release year of the media item. - Year *int `json:"year,omitempty"` - Image []GetRecentlyAddedImage `json:"Image,omitempty"` - UltraBlurColors *UltraBlurColors `json:"UltraBlurColors,omitempty"` - Guids []Guids `json:"Guid,omitempty"` - Media []Media `json:"Media,omitempty"` - Genre []Genre `json:"Genre,omitempty"` - Country []Country `json:"Country,omitempty"` - Director []Director `json:"Director,omitempty"` - Writer []Writer `json:"Writer,omitempty"` - Role []Role `json:"Role,omitempty"` - Producer []Producer `json:"Producer,omitempty"` - Rating1 []Rating `json:"Rating,omitempty"` - Similar []Similar `json:"Similar,omitempty"` - Location []Location `json:"Location,omitempty"` - Collection []Collection `json:"Collection,omitempty"` -} - -func (g GetRecentlyAddedMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetRecentlyAddedMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"addedAt", "art", "audienceRating", "childCount", "duration", "guid", "index", "key", "parentStudio", "parentTheme", "ratingKey", "rating", "seasonCount", "slug", "summary", "tagline", "theme", "thumb", "titleSort", "title", "type"}); err != nil { - return err - } - return nil -} - -func (g *GetRecentlyAddedMetadata) GetAddedAt() int64 { - if g == nil { - return 0 - } - return g.AddedAt -} - -func (g *GetRecentlyAddedMetadata) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetRecentlyAddedMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetRecentlyAddedMetadata) GetAudienceRating() float64 { - if g == nil { - return 0.0 - } - return g.AudienceRating -} - -func (g *GetRecentlyAddedMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetRecentlyAddedMetadata) GetChildCount() int { - if g == nil { - return 0 - } - return g.ChildCount -} - -func (g *GetRecentlyAddedMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetRecentlyAddedMetadata) GetCreatedAtAccuracy() *string { - if g == nil { - return nil - } - return g.CreatedAtAccuracy -} - -func (g *GetRecentlyAddedMetadata) GetCreatedAtTZOffset() *string { - if g == nil { - return nil - } - return g.CreatedAtTZOffset -} - -func (g *GetRecentlyAddedMetadata) GetDuration() int { - if g == nil { - return 0 - } - return g.Duration -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentGUID() *string { - if g == nil { - return nil - } - return g.GrandparentGUID -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentRatingKey() *string { - if g == nil { - return nil - } - return g.GrandparentRatingKey -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentSlug() *string { - if g == nil { - return nil - } - return g.GrandparentSlug -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentTheme() *string { - if g == nil { - return nil - } - return g.GrandparentTheme -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetRecentlyAddedMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetRecentlyAddedMetadata) GetGUID() string { - if g == nil { - return "" - } - return g.GUID -} - -func (g *GetRecentlyAddedMetadata) GetIndex() int { - if g == nil { - return 0 - } - return g.Index -} - -func (g *GetRecentlyAddedMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedMetadata) GetLastRatedAt() *int64 { - if g == nil { - return nil - } - return g.LastRatedAt -} - -func (g *GetRecentlyAddedMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetRecentlyAddedMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetRecentlyAddedMetadata) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetRecentlyAddedMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetRecentlyAddedMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetRecentlyAddedMetadata) GetOriginalTitle() *string { - if g == nil { - return nil - } - return g.OriginalTitle -} - -func (g *GetRecentlyAddedMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetRecentlyAddedMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetRecentlyAddedMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetRecentlyAddedMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetRecentlyAddedMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetRecentlyAddedMetadata) GetParentSlug() *string { - if g == nil { - return nil - } - return g.ParentSlug -} - -func (g *GetRecentlyAddedMetadata) GetParentStudio() string { - if g == nil { - return "" - } - return g.ParentStudio -} - -func (g *GetRecentlyAddedMetadata) GetParentTheme() string { - if g == nil { - return "" - } - return g.ParentTheme -} - -func (g *GetRecentlyAddedMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetRecentlyAddedMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetRecentlyAddedMetadata) GetParentYear() *int { - if g == nil { - return nil - } - return g.ParentYear -} - -func (g *GetRecentlyAddedMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetRecentlyAddedMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetRecentlyAddedMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetRecentlyAddedMetadata) GetRating() float32 { - if g == nil { - return 0.0 - } - return g.Rating -} - -func (g *GetRecentlyAddedMetadata) GetSeasonCount() int { - if g == nil { - return 0 - } - return g.SeasonCount -} - -func (g *GetRecentlyAddedMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetRecentlyAddedMetadata) GetSlug() string { - if g == nil { - return "" - } - return g.Slug -} - -func (g *GetRecentlyAddedMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetRecentlyAddedMetadata) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetRecentlyAddedMetadata) GetSummary() string { - if g == nil { - return "" - } - return g.Summary -} - -func (g *GetRecentlyAddedMetadata) GetTagline() string { - if g == nil { - return "" - } - return g.Tagline -} - -func (g *GetRecentlyAddedMetadata) GetTheme() string { - if g == nil { - return "" - } - return g.Theme -} - -func (g *GetRecentlyAddedMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetRecentlyAddedMetadata) GetTitleSort() string { - if g == nil { - return "" - } - return g.TitleSort -} - -func (g *GetRecentlyAddedMetadata) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetRecentlyAddedMetadata) GetType() GetRecentlyAddedHubsType { - if g == nil { - return GetRecentlyAddedHubsType("") - } - return g.Type -} - -func (g *GetRecentlyAddedMetadata) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetRecentlyAddedMetadata) GetUserRating() *float32 { - if g == nil { - return nil - } - return g.UserRating -} - -func (g *GetRecentlyAddedMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetRecentlyAddedMetadata) GetViewOffset() *int { - if g == nil { - return nil - } - return g.ViewOffset -} - -func (g *GetRecentlyAddedMetadata) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetRecentlyAddedMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetRecentlyAddedMetadata) GetImage() []GetRecentlyAddedImage { - if g == nil { - return nil - } - return g.Image -} - -func (g *GetRecentlyAddedMetadata) GetUltraBlurColors() *UltraBlurColors { - if g == nil { - return nil - } - return g.UltraBlurColors -} - -func (g *GetRecentlyAddedMetadata) GetGuids() []Guids { - if g == nil { - return nil - } - return g.Guids -} - -func (g *GetRecentlyAddedMetadata) GetMedia() []Media { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetRecentlyAddedMetadata) GetGenre() []Genre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetRecentlyAddedMetadata) GetCountry() []Country { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetRecentlyAddedMetadata) GetDirector() []Director { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetRecentlyAddedMetadata) GetWriter() []Writer { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetRecentlyAddedMetadata) GetRole() []Role { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetRecentlyAddedMetadata) GetProducer() []Producer { - if g == nil { - return nil - } - return g.Producer -} - -func (g *GetRecentlyAddedMetadata) GetRating1() []Rating { - if g == nil { - return nil - } - return g.Rating1 -} - -func (g *GetRecentlyAddedMetadata) GetSimilar() []Similar { - if g == nil { - return nil - } - return g.Similar -} - -func (g *GetRecentlyAddedMetadata) GetLocation() []Location { - if g == nil { - return nil - } - return g.Location -} - -func (g *GetRecentlyAddedMetadata) GetCollection() []Collection { - if g == nil { - return nil - } - return g.Collection -} - -type GetRecentlyAddedMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Total number of media items in the library. - TotalSize int `json:"totalSize"` - // Offset value for pagination. - Offset int64 `json:"offset"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. - // - Meta *Meta `json:"Meta,omitempty"` - // An array of metadata items. - Metadata []GetRecentlyAddedMetadata `json:"Metadata,omitempty"` -} - -func (g *GetRecentlyAddedMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetRecentlyAddedMediaContainer) GetTotalSize() int { - if g == nil { - return 0 - } - return g.TotalSize -} - -func (g *GetRecentlyAddedMediaContainer) GetOffset() int64 { - if g == nil { - return 0 - } - return g.Offset -} - -func (g *GetRecentlyAddedMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetRecentlyAddedMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetRecentlyAddedMediaContainer) GetMeta() *Meta { - if g == nil { - return nil - } - return g.Meta -} - -func (g *GetRecentlyAddedMediaContainer) GetMetadata() []GetRecentlyAddedMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetRecentlyAddedResponseBody - A successful response with recently added content. -type GetRecentlyAddedResponseBody struct { - MediaContainer *GetRecentlyAddedMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetRecentlyAddedResponseBody) GetMediaContainer() *GetRecentlyAddedMediaContainer { - if g == nil { - return nil - } - return g.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 - // A successful response with recently added content. - Object *GetRecentlyAddedResponseBody -} - -func (g *GetRecentlyAddedResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetRecentlyAddedResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetRecentlyAddedResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetRecentlyAddedResponse) GetObject() *GetRecentlyAddedResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getrecentlyaddedlibrary.go b/models/operations/getrecentlyaddedlibrary.go deleted file mode 100644 index f24434f..0000000 --- a/models/operations/getrecentlyaddedlibrary.go +++ /dev/null @@ -1,1143 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" - "time" -) - -// QueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type QueryParamType int64 - -const ( - QueryParamTypeMovie QueryParamType = 1 - QueryParamTypeTvShow QueryParamType = 2 - QueryParamTypeSeason QueryParamType = 3 - QueryParamTypeEpisode QueryParamType = 4 - QueryParamTypeArtist QueryParamType = 5 - QueryParamTypeAlbum QueryParamType = 6 - QueryParamTypeTrack QueryParamType = 7 - QueryParamTypePhotoAlbum QueryParamType = 8 - QueryParamTypePhoto QueryParamType = 9 -) - -func (e QueryParamType) ToPointer() *QueryParamType { - return &e -} - -// QueryParamIncludeMeta - Adds the Meta object to the response -type QueryParamIncludeMeta int - -const ( - QueryParamIncludeMetaDisable QueryParamIncludeMeta = 0 - QueryParamIncludeMetaEnable QueryParamIncludeMeta = 1 -) - -func (e QueryParamIncludeMeta) ToPointer() *QueryParamIncludeMeta { - return &e -} -func (e *QueryParamIncludeMeta) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = QueryParamIncludeMeta(v) - return nil - default: - return fmt.Errorf("invalid value for QueryParamIncludeMeta: %v", v) - } -} - -type GetRecentlyAddedLibraryRequest struct { - ContentDirectoryID *int64 `queryParam:"style=form,explode=true,name=contentDirectoryID"` - PinnedContentDirectoryID []int64 `queryParam:"style=form,explode=true,name=pinnedContentDirectoryID"` - // The library section ID for filtering content. - SectionID *int64 `queryParam:"style=form,explode=true,name=sectionID"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type QueryParamType `queryParam:"style=form,explode=true,name=type"` - // Adds the Meta object to the response - // - IncludeMeta *QueryParamIncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"` - // The index of the first item to return. If not specified, the first item will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 0 - // - XPlexContainerStart *int `default:"0" queryParam:"style=form,explode=true,name=X-Plex-Container-Start"` - // The number of items to return. If not specified, all items will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 50 - // - XPlexContainerSize *int `default:"50" queryParam:"style=form,explode=true,name=X-Plex-Container-Size"` -} - -func (g GetRecentlyAddedLibraryRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetRecentlyAddedLibraryRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type"}); err != nil { - return err - } - return nil -} - -func (g *GetRecentlyAddedLibraryRequest) GetContentDirectoryID() *int64 { - if g == nil { - return nil - } - return g.ContentDirectoryID -} - -func (g *GetRecentlyAddedLibraryRequest) GetPinnedContentDirectoryID() []int64 { - if g == nil { - return nil - } - return g.PinnedContentDirectoryID -} - -func (g *GetRecentlyAddedLibraryRequest) GetSectionID() *int64 { - if g == nil { - return nil - } - return g.SectionID -} - -func (g *GetRecentlyAddedLibraryRequest) GetType() QueryParamType { - if g == nil { - return QueryParamType(0) - } - return g.Type -} - -func (g *GetRecentlyAddedLibraryRequest) GetIncludeMeta() *QueryParamIncludeMeta { - if g == nil { - return nil - } - return g.IncludeMeta -} - -func (g *GetRecentlyAddedLibraryRequest) GetXPlexContainerStart() *int { - if g == nil { - return nil - } - return g.XPlexContainerStart -} - -func (g *GetRecentlyAddedLibraryRequest) GetXPlexContainerSize() *int { - if g == nil { - return nil - } - return g.XPlexContainerSize -} - -type GetRecentlyAddedLibraryFilter struct { - Filter string `json:"filter"` - FilterType string `json:"filterType"` - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - Advanced *bool `json:"advanced,omitempty"` -} - -func (g *GetRecentlyAddedLibraryFilter) GetFilter() string { - if g == nil { - return "" - } - return g.Filter -} - -func (g *GetRecentlyAddedLibraryFilter) GetFilterType() string { - if g == nil { - return "" - } - return g.FilterType -} - -func (g *GetRecentlyAddedLibraryFilter) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedLibraryFilter) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetRecentlyAddedLibraryFilter) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetRecentlyAddedLibraryFilter) GetAdvanced() *bool { - if g == nil { - return nil - } - return g.Advanced -} - -// ActiveDirection - The direction of the sort. Can be either `asc` or `desc`. -type ActiveDirection string - -const ( - ActiveDirectionAscending ActiveDirection = "asc" - ActiveDirectionDescending ActiveDirection = "desc" -) - -func (e ActiveDirection) ToPointer() *ActiveDirection { - return &e -} -func (e *ActiveDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = ActiveDirection(v) - return nil - default: - return fmt.Errorf("invalid value for ActiveDirection: %v", v) - } -} - -// DefaultDirection - The direction of the sort. Can be either `asc` or `desc`. -type DefaultDirection string - -const ( - DefaultDirectionAscending DefaultDirection = "asc" - DefaultDirectionDescending DefaultDirection = "desc" -) - -func (e DefaultDirection) ToPointer() *DefaultDirection { - return &e -} -func (e *DefaultDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = DefaultDirection(v) - return nil - default: - return fmt.Errorf("invalid value for DefaultDirection: %v", v) - } -} - -type Sort struct { - Default *string `json:"default,omitempty"` - Active *bool `json:"active,omitempty"` - // The direction of the sort. Can be either `asc` or `desc`. - // - ActiveDirection *ActiveDirection `default:"asc" json:"activeDirection"` - // The direction of the sort. Can be either `asc` or `desc`. - // - DefaultDirection *DefaultDirection `default:"asc" json:"defaultDirection"` - DescKey *string `json:"descKey,omitempty"` - FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` - Key string `json:"key"` - Title string `json:"title"` -} - -func (s Sort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *Sort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, []string{"key", "title"}); err != nil { - return err - } - return nil -} - -func (s *Sort) GetDefault() *string { - if s == nil { - return nil - } - return s.Default -} - -func (s *Sort) GetActive() *bool { - if s == nil { - return nil - } - return s.Active -} - -func (s *Sort) GetActiveDirection() *ActiveDirection { - if s == nil { - return nil - } - return s.ActiveDirection -} - -func (s *Sort) GetDefaultDirection() *DefaultDirection { - if s == nil { - return nil - } - return s.DefaultDirection -} - -func (s *Sort) GetDescKey() *string { - if s == nil { - return nil - } - return s.DescKey -} - -func (s *Sort) GetFirstCharacterKey() *string { - if s == nil { - return nil - } - return s.FirstCharacterKey -} - -func (s *Sort) GetKey() string { - if s == nil { - return "" - } - return s.Key -} - -func (s *Sort) GetTitle() string { - if s == nil { - return "" - } - return s.Title -} - -type Field struct { - Key string `json:"key"` - Title string `json:"title"` - Type string `json:"type"` - SubType *string `json:"subType,omitempty"` -} - -func (f *Field) GetKey() string { - if f == nil { - return "" - } - return f.Key -} - -func (f *Field) GetTitle() string { - if f == nil { - return "" - } - return f.Title -} - -func (f *Field) GetType() string { - if f == nil { - return "" - } - return f.Type -} - -func (f *Field) GetSubType() *string { - if f == nil { - return nil - } - return f.SubType -} - -type GetRecentlyAddedLibraryType struct { - Key string `json:"key"` - Type string `json:"type"` - Subtype *string `json:"subtype,omitempty"` - Title string `json:"title"` - Active bool `json:"active"` - Filter []GetRecentlyAddedLibraryFilter `json:"Filter,omitempty"` - Sort []Sort `json:"Sort,omitempty"` - Field []Field `json:"Field,omitempty"` -} - -func (g *GetRecentlyAddedLibraryType) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetRecentlyAddedLibraryType) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetRecentlyAddedLibraryType) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetRecentlyAddedLibraryType) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetRecentlyAddedLibraryType) GetActive() bool { - if g == nil { - return false - } - return g.Active -} - -func (g *GetRecentlyAddedLibraryType) GetFilter() []GetRecentlyAddedLibraryFilter { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetRecentlyAddedLibraryType) GetSort() []Sort { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetRecentlyAddedLibraryType) GetField() []Field { - if g == nil { - return nil - } - return g.Field -} - -type Operator struct { - Key string `json:"key"` - Title string `json:"title"` -} - -func (o *Operator) GetKey() string { - if o == nil { - return "" - } - return o.Key -} - -func (o *Operator) GetTitle() string { - if o == nil { - return "" - } - return o.Title -} - -type FieldType struct { - Type string `json:"type"` - Operator []Operator `json:"Operator"` -} - -func (f *FieldType) GetType() string { - if f == nil { - return "" - } - return f.Type -} - -func (f *FieldType) GetOperator() []Operator { - if f == nil { - return []Operator{} - } - return f.Operator -} - -type GetRecentlyAddedLibraryPart 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 (g *GetRecentlyAddedLibraryPart) GetID() *float64 { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetRecentlyAddedLibraryPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetRecentlyAddedLibraryPart) GetDuration() *float64 { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetRecentlyAddedLibraryPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetRecentlyAddedLibraryPart) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetRecentlyAddedLibraryPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetRecentlyAddedLibraryPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetRecentlyAddedLibraryPart) GetHasThumbnail() *float64 { - if g == nil { - return nil - } - return g.HasThumbnail -} - -func (g *GetRecentlyAddedLibraryPart) GetOptimizedForStreaming() *bool { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetRecentlyAddedLibraryPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -type GetRecentlyAddedLibraryMedia 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 []GetRecentlyAddedLibraryPart `json:"Part,omitempty"` -} - -func (g *GetRecentlyAddedLibraryMedia) GetID() *float64 { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetRecentlyAddedLibraryMedia) GetDuration() *float64 { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetRecentlyAddedLibraryMedia) GetBitrate() *float64 { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetRecentlyAddedLibraryMedia) GetWidth() *float64 { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetRecentlyAddedLibraryMedia) GetHeight() *float64 { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetRecentlyAddedLibraryMedia) GetAspectRatio() *float64 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetRecentlyAddedLibraryMedia) GetAudioChannels() *float64 { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetRecentlyAddedLibraryMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetRecentlyAddedLibraryMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetRecentlyAddedLibraryMedia) GetVideoResolution() *float64 { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetRecentlyAddedLibraryMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetRecentlyAddedLibraryMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetRecentlyAddedLibraryMedia) GetOptimizedForStreaming() *float64 { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetRecentlyAddedLibraryMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetRecentlyAddedLibraryMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetRecentlyAddedLibraryMedia) GetPart() []GetRecentlyAddedLibraryPart { - if g == nil { - return nil - } - return g.Part -} - -type GetRecentlyAddedLibraryGenre struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetRecentlyAddedLibraryGenre) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetRecentlyAddedLibraryDirector struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetRecentlyAddedLibraryDirector) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetRecentlyAddedLibraryWriter struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetRecentlyAddedLibraryWriter) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetRecentlyAddedLibraryCountry struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetRecentlyAddedLibraryCountry) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetRecentlyAddedLibraryRole struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetRecentlyAddedLibraryRole) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetRecentlyAddedLibraryMetadata 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 []GetRecentlyAddedLibraryMedia `json:"Media,omitempty"` - Genre []GetRecentlyAddedLibraryGenre `json:"Genre,omitempty"` - Director []GetRecentlyAddedLibraryDirector `json:"Director,omitempty"` - Writer []GetRecentlyAddedLibraryWriter `json:"Writer,omitempty"` - Country []GetRecentlyAddedLibraryCountry `json:"Country,omitempty"` - Role []GetRecentlyAddedLibraryRole `json:"Role,omitempty"` -} - -func (g GetRecentlyAddedLibraryMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetRecentlyAddedLibraryMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetRecentlyAddedLibraryMetadata) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetRecentlyAddedLibraryMetadata) GetLibrarySectionID() *float64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetRecentlyAddedLibraryMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetRecentlyAddedLibraryMetadata) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetRecentlyAddedLibraryMetadata) GetRatingKey() *float64 { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetRecentlyAddedLibraryMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetRecentlyAddedLibraryMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetRecentlyAddedLibraryMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetRecentlyAddedLibraryMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetRecentlyAddedLibraryMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetRecentlyAddedLibraryMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetRecentlyAddedLibraryMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetRecentlyAddedLibraryMetadata) GetRating() *float64 { - if g == nil { - return nil - } - return g.Rating -} - -func (g *GetRecentlyAddedLibraryMetadata) GetAudienceRating() *float64 { - if g == nil { - return nil - } - return g.AudienceRating -} - -func (g *GetRecentlyAddedLibraryMetadata) GetYear() *float64 { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetRecentlyAddedLibraryMetadata) GetTagline() *string { - if g == nil { - return nil - } - return g.Tagline -} - -func (g *GetRecentlyAddedLibraryMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetRecentlyAddedLibraryMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetRecentlyAddedLibraryMetadata) GetDuration() *float64 { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetRecentlyAddedLibraryMetadata) GetOriginallyAvailableAt() *time.Time { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetRecentlyAddedLibraryMetadata) GetAddedAt() *float64 { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetRecentlyAddedLibraryMetadata) GetUpdatedAt() *float64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetRecentlyAddedLibraryMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetRecentlyAddedLibraryMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetRecentlyAddedLibraryMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetRecentlyAddedLibraryMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetRecentlyAddedLibraryMetadata) GetMedia() []GetRecentlyAddedLibraryMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetRecentlyAddedLibraryMetadata) GetGenre() []GetRecentlyAddedLibraryGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetRecentlyAddedLibraryMetadata) GetDirector() []GetRecentlyAddedLibraryDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetRecentlyAddedLibraryMetadata) GetWriter() []GetRecentlyAddedLibraryWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetRecentlyAddedLibraryMetadata) GetCountry() []GetRecentlyAddedLibraryCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetRecentlyAddedLibraryMetadata) GetRole() []GetRecentlyAddedLibraryRole { - if g == nil { - return nil - } - return g.Role -} - -// GetRecentlyAddedLibraryMediaContainer - The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. -type GetRecentlyAddedLibraryMediaContainer struct { - Type []GetRecentlyAddedLibraryType `json:"Type,omitempty"` - FieldType []FieldType `json:"FieldType,omitempty"` - 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 []GetRecentlyAddedLibraryMetadata `json:"Metadata,omitempty"` -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetType() []GetRecentlyAddedLibraryType { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetFieldType() []FieldType { - if g == nil { - return nil - } - return g.FieldType -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetMediaTagPrefix() *string { - if g == nil { - return nil - } - return g.MediaTagPrefix -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetMediaTagVersion() *float64 { - if g == nil { - return nil - } - return g.MediaTagVersion -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetMixedParents() *bool { - if g == nil { - return nil - } - return g.MixedParents -} - -func (g *GetRecentlyAddedLibraryMediaContainer) GetMetadata() []GetRecentlyAddedLibraryMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetRecentlyAddedLibraryResponseBody - The recently added content -type GetRecentlyAddedLibraryResponseBody struct { - MediaContainer *GetRecentlyAddedLibraryMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetRecentlyAddedLibraryResponseBody) GetMediaContainer() *GetRecentlyAddedLibraryMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetRecentlyAddedLibraryResponse 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 *GetRecentlyAddedLibraryResponseBody -} - -func (g *GetRecentlyAddedLibraryResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetRecentlyAddedLibraryResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetRecentlyAddedLibraryResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetRecentlyAddedLibraryResponse) GetObject() *GetRecentlyAddedLibraryResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getrefreshlibrarymetadata.go b/models/operations/getrefreshlibrarymetadata.go deleted file mode 100644 index 8e94ba6..0000000 --- a/models/operations/getrefreshlibrarymetadata.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// Force the refresh even if the library is already being refreshed. -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 GetRefreshLibraryMetadataRequest struct { - // Force the refresh even if the library is already being refreshed. - Force *Force `queryParam:"style=form,explode=true,name=force"` - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` -} - -func (g *GetRefreshLibraryMetadataRequest) GetForce() *Force { - if g == nil { - return nil - } - return g.Force -} - -func (g *GetRefreshLibraryMetadataRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -type GetRefreshLibraryMetadataResponse 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 (g *GetRefreshLibraryMetadataResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetRefreshLibraryMetadataResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetRefreshLibraryMetadataResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} diff --git a/models/operations/getrelatedhubs.go b/models/operations/getrelatedhubs.go new file mode 100644 index 0000000..4e623e2 --- /dev/null +++ b/models/operations/getrelatedhubs.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetRelatedHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetRelatedHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetRelatedHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetRelatedHubsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetRelatedHubsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetRelatedHubsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetRelatedHubsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetRelatedHubsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetRelatedHubsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetRelatedHubsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetRelatedHubsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetRelatedHubsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetRelatedHubsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetRelatedHubsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetRelatedHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The metadata ID for the hubs to fetch + MetadataID int64 `pathParam:"style=simple,explode=false,name=metadataId"` + // Limit results to count items + Count *int64 `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 *components.BoolInt `queryParam:"style=form,explode=true,name=onlyTransient"` +} + +func (g GetRelatedHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetRelatedHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"metadataId"}); err != nil { + return err + } + return nil +} + +func (g *GetRelatedHubsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetRelatedHubsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetRelatedHubsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetRelatedHubsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetRelatedHubsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetRelatedHubsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetRelatedHubsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetRelatedHubsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetRelatedHubsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetRelatedHubsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetRelatedHubsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetRelatedHubsRequest) GetMetadataID() int64 { + if g == nil { + return 0 + } + return g.MetadataID +} + +func (g *GetRelatedHubsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetRelatedHubsRequest) GetOnlyTransient() *components.BoolInt { + if g == nil { + return nil + } + return g.OnlyTransient +} + +type GetRelatedHubsResponse 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 + // OK + MediaContainerWithHubs *components.MediaContainerWithHubs + Headers map[string][]string +} + +func (g *GetRelatedHubsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetRelatedHubsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetRelatedHubsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetRelatedHubsResponse) GetMediaContainerWithHubs() *components.MediaContainerWithHubs { + if g == nil { + return nil + } + return g.MediaContainerWithHubs +} + +func (g *GetRelatedHubsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getrelateditems.go b/models/operations/getrelateditems.go new file mode 100644 index 0000000..454eb2a --- /dev/null +++ b/models/operations/getrelateditems.go @@ -0,0 +1,344 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetRelatedItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetRelatedItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetRelatedItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetRelatedItemsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetRelatedItemsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetRelatedItemsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetRelatedItemsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetRelatedItemsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetRelatedItemsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetRelatedItemsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetRelatedItemsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetRelatedItemsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetRelatedItemsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetRelatedItemsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetRelatedItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (g GetRelatedItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetRelatedItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (g *GetRelatedItemsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetRelatedItemsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetRelatedItemsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetRelatedItemsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetRelatedItemsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetRelatedItemsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetRelatedItemsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetRelatedItemsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetRelatedItemsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetRelatedItemsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetRelatedItemsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetRelatedItemsRequest) GetIds() string { + if g == nil { + return "" + } + return g.Ids +} + +// GetRelatedItemsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetRelatedItemsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (g *GetRelatedItemsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetRelatedItemsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetRelatedItemsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetRelatedItemsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetRelatedItemsMediaContainer) GetHub() []components.Hub { + if g == nil { + return nil + } + return g.Hub +} + +// GetRelatedItemsResponseBody - OK +type GetRelatedItemsResponseBody struct { + MediaContainer *GetRelatedItemsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetRelatedItemsResponseBody) GetMediaContainer() *GetRelatedItemsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetRelatedItemsResponse 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 + // OK + Object *GetRelatedItemsResponseBody +} + +func (g *GetRelatedItemsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetRelatedItemsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetRelatedItemsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetRelatedItemsResponse) GetObject() *GetRelatedItemsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getresizedphoto.go b/models/operations/getresizedphoto.go deleted file mode 100644 index f66be39..0000000 --- a/models/operations/getresizedphoto.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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, []string{"width", "height", "opacity", "blur", "minSize", "upscale", "url"}); err != nil { - return err - } - return nil -} - -func (g *GetResizedPhotoRequest) GetWidth() float64 { - if g == nil { - return 0.0 - } - return g.Width -} - -func (g *GetResizedPhotoRequest) GetHeight() float64 { - if g == nil { - return 0.0 - } - return g.Height -} - -func (g *GetResizedPhotoRequest) GetOpacity() int64 { - if g == nil { - return 0 - } - return g.Opacity -} - -func (g *GetResizedPhotoRequest) GetBlur() float64 { - if g == nil { - return 0.0 - } - return g.Blur -} - -func (g *GetResizedPhotoRequest) GetMinSize() MinSize { - if g == nil { - return MinSize(0) - } - return g.MinSize -} - -func (g *GetResizedPhotoRequest) GetUpscale() Upscale { - if g == nil { - return Upscale(0) - } - return g.Upscale -} - -func (g *GetResizedPhotoRequest) GetURL() string { - if g == nil { - return "" - } - return g.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 (g *GetResizedPhotoResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetResizedPhotoResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetResizedPhotoResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} diff --git a/models/operations/getresourcesstatistics.go b/models/operations/getresourcesstatistics.go deleted file mode 100644 index 8372de3..0000000 --- a/models/operations/getresourcesstatistics.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type GetResourcesStatisticsRequest struct { - // The timespan to retrieve statistics for - // the exact meaning of this parameter is not known - // - Timespan *int64 `queryParam:"style=form,explode=true,name=timespan"` -} - -func (g *GetResourcesStatisticsRequest) GetTimespan() *int64 { - if g == nil { - return nil - } - return g.Timespan -} - -type StatisticsResources struct { - Timespan *int64 `json:"timespan,omitempty"` - At *int64 `json:"at,omitempty"` - HostCPUUtilization *float32 `json:"hostCpuUtilization,omitempty"` - ProcessCPUUtilization *float32 `json:"processCpuUtilization,omitempty"` - HostMemoryUtilization *float32 `json:"hostMemoryUtilization,omitempty"` - ProcessMemoryUtilization *float32 `json:"processMemoryUtilization,omitempty"` -} - -func (s *StatisticsResources) GetTimespan() *int64 { - if s == nil { - return nil - } - return s.Timespan -} - -func (s *StatisticsResources) GetAt() *int64 { - if s == nil { - return nil - } - return s.At -} - -func (s *StatisticsResources) GetHostCPUUtilization() *float32 { - if s == nil { - return nil - } - return s.HostCPUUtilization -} - -func (s *StatisticsResources) GetProcessCPUUtilization() *float32 { - if s == nil { - return nil - } - return s.ProcessCPUUtilization -} - -func (s *StatisticsResources) GetHostMemoryUtilization() *float32 { - if s == nil { - return nil - } - return s.HostMemoryUtilization -} - -func (s *StatisticsResources) GetProcessMemoryUtilization() *float32 { - if s == nil { - return nil - } - return s.ProcessMemoryUtilization -} - -type GetResourcesStatisticsMediaContainer struct { - Size *int `json:"size,omitempty"` - StatisticsResources []StatisticsResources `json:"StatisticsResources,omitempty"` -} - -func (g *GetResourcesStatisticsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetResourcesStatisticsMediaContainer) GetStatisticsResources() []StatisticsResources { - if g == nil { - return nil - } - return g.StatisticsResources -} - -// GetResourcesStatisticsResponseBody - Resource Statistics -type GetResourcesStatisticsResponseBody struct { - MediaContainer *GetResourcesStatisticsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetResourcesStatisticsResponseBody) GetMediaContainer() *GetResourcesStatisticsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetResourcesStatisticsResponse 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 - // Resource Statistics - Object *GetResourcesStatisticsResponseBody -} - -func (g *GetResourcesStatisticsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetResourcesStatisticsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetResourcesStatisticsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetResourcesStatisticsResponse) GetObject() *GetResourcesStatisticsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getscheduledrecordings.go b/models/operations/getscheduledrecordings.go new file mode 100644 index 0000000..173fe17 --- /dev/null +++ b/models/operations/getscheduledrecordings.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +// GetScheduledRecordingsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetScheduledRecordingsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + MediaGrabOperation []components.MediaGrabOperation `json:"MediaGrabOperation,omitempty"` +} + +func (g *GetScheduledRecordingsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetScheduledRecordingsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetScheduledRecordingsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetScheduledRecordingsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetScheduledRecordingsMediaContainer) GetMediaGrabOperation() []components.MediaGrabOperation { + if g == nil { + return nil + } + return g.MediaGrabOperation +} + +// GetScheduledRecordingsResponseBody - OK +type GetScheduledRecordingsResponseBody struct { + MediaContainer *GetScheduledRecordingsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetScheduledRecordingsResponseBody) GetMediaContainer() *GetScheduledRecordingsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetScheduledRecordingsResponse 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 + // OK + Object *GetScheduledRecordingsResponseBody + Headers map[string][]string +} + +func (g *GetScheduledRecordingsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetScheduledRecordingsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetScheduledRecordingsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetScheduledRecordingsResponse) GetObject() *GetScheduledRecordingsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetScheduledRecordingsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getsearchalllibraries.go b/models/operations/getsearchalllibraries.go deleted file mode 100644 index 7edb20d..0000000 --- a/models/operations/getsearchalllibraries.go +++ /dev/null @@ -1,1922 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -type SearchTypes string - -const ( - SearchTypesMovies SearchTypes = "movies" - SearchTypesMusic SearchTypes = "music" - SearchTypesOtherVideos SearchTypes = "otherVideos" - SearchTypesPeople SearchTypes = "people" - SearchTypesTv SearchTypes = "tv" -) - -func (e SearchTypes) ToPointer() *SearchTypes { - return &e -} - -// GetSearchAllLibrariesQueryParamIncludeCollections - Whether to include collections in the search results. -type GetSearchAllLibrariesQueryParamIncludeCollections int - -const ( - GetSearchAllLibrariesQueryParamIncludeCollectionsDisable GetSearchAllLibrariesQueryParamIncludeCollections = 0 - GetSearchAllLibrariesQueryParamIncludeCollectionsEnable GetSearchAllLibrariesQueryParamIncludeCollections = 1 -) - -func (e GetSearchAllLibrariesQueryParamIncludeCollections) ToPointer() *GetSearchAllLibrariesQueryParamIncludeCollections { - return &e -} -func (e *GetSearchAllLibrariesQueryParamIncludeCollections) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetSearchAllLibrariesQueryParamIncludeCollections(v) - return nil - default: - return fmt.Errorf("invalid value for GetSearchAllLibrariesQueryParamIncludeCollections: %v", v) - } -} - -// GetSearchAllLibrariesQueryParamIncludeExternalMedia - Whether to include external media in the search results. -type GetSearchAllLibrariesQueryParamIncludeExternalMedia int - -const ( - GetSearchAllLibrariesQueryParamIncludeExternalMediaDisable GetSearchAllLibrariesQueryParamIncludeExternalMedia = 0 - GetSearchAllLibrariesQueryParamIncludeExternalMediaEnable GetSearchAllLibrariesQueryParamIncludeExternalMedia = 1 -) - -func (e GetSearchAllLibrariesQueryParamIncludeExternalMedia) ToPointer() *GetSearchAllLibrariesQueryParamIncludeExternalMedia { - return &e -} -func (e *GetSearchAllLibrariesQueryParamIncludeExternalMedia) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetSearchAllLibrariesQueryParamIncludeExternalMedia(v) - return nil - default: - return fmt.Errorf("invalid value for GetSearchAllLibrariesQueryParamIncludeExternalMedia: %v", v) - } -} - -type GetSearchAllLibrariesRequest struct { - // The search query term. - Query string `queryParam:"style=form,explode=true,name=query"` - // An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` - // Limit the number of results returned. - Limit *int64 `queryParam:"style=form,explode=true,name=limit"` - // A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. - // - SearchTypes []SearchTypes `queryParam:"style=form,explode=false,name=searchTypes"` - // Whether to include collections in the search results. - IncludeCollections *GetSearchAllLibrariesQueryParamIncludeCollections `default:"0" queryParam:"style=form,explode=true,name=includeCollections"` - // Whether to include external media in the search results. - IncludeExternalMedia *GetSearchAllLibrariesQueryParamIncludeExternalMedia `default:"0" queryParam:"style=form,explode=true,name=includeExternalMedia"` -} - -func (g GetSearchAllLibrariesRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSearchAllLibrariesRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"query", "X-Plex-Client-Identifier"}); err != nil { - return err - } - return nil -} - -func (g *GetSearchAllLibrariesRequest) GetQuery() string { - if g == nil { - return "" - } - return g.Query -} - -func (g *GetSearchAllLibrariesRequest) GetClientID() string { - if g == nil { - return "" - } - return g.ClientID -} - -func (g *GetSearchAllLibrariesRequest) GetLimit() *int64 { - if g == nil { - return nil - } - return g.Limit -} - -func (g *GetSearchAllLibrariesRequest) GetSearchTypes() []SearchTypes { - if g == nil { - return nil - } - return g.SearchTypes -} - -func (g *GetSearchAllLibrariesRequest) GetIncludeCollections() *GetSearchAllLibrariesQueryParamIncludeCollections { - if g == nil { - return nil - } - return g.IncludeCollections -} - -func (g *GetSearchAllLibrariesRequest) GetIncludeExternalMedia() *GetSearchAllLibrariesQueryParamIncludeExternalMedia { - if g == nil { - return nil - } - return g.IncludeExternalMedia -} - -type GetSearchAllLibrariesDirectory struct { - // The unique identifier path for the search result item. - Key string `json:"key"` - // The identifier for the library section. - LibrarySectionID int64 `json:"librarySectionID"` - // The key corresponding to the library section. - LibrarySectionKey string `json:"librarySectionKey"` - // The title of the library section. - LibrarySectionTitle string `json:"librarySectionTitle"` - librarySectionType *int64 `const:"1" json:"librarySectionType,omitempty"` - // The type of the directory. - Type string `json:"type"` - ID int64 `json:"id"` - // The filter string used to query this specific item in the library. - Filter *string `json:"filter,omitempty"` - Tag string `json:"tag"` - // The type of tag associated with this search result (e.g., Director, Actor). - tagType *int64 `const:"4" json:"tagType,omitempty"` - // The unique identifier for the tag associated with this search result. - TagKey *string `json:"tagKey,omitempty"` - // The URL to the thumbnail image associated with this search result. - Thumb *string `json:"thumb,omitempty"` - // The number of items associated with this search result. - Count *int64 `json:"count,omitempty"` -} - -func (g GetSearchAllLibrariesDirectory) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSearchAllLibrariesDirectory) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "librarySectionID", "librarySectionKey", "librarySectionTitle", "type", "id", "tag"}); err != nil { - return err - } - return nil -} - -func (g *GetSearchAllLibrariesDirectory) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetSearchAllLibrariesDirectory) GetLibrarySectionID() int64 { - if g == nil { - return 0 - } - return g.LibrarySectionID -} - -func (g *GetSearchAllLibrariesDirectory) GetLibrarySectionKey() string { - if g == nil { - return "" - } - return g.LibrarySectionKey -} - -func (g *GetSearchAllLibrariesDirectory) GetLibrarySectionTitle() string { - if g == nil { - return "" - } - return g.LibrarySectionTitle -} - -func (g *GetSearchAllLibrariesDirectory) GetLibrarySectionType() *int64 { - return types.Pointer[int64](1) -} - -func (g *GetSearchAllLibrariesDirectory) GetType() string { - if g == nil { - return "" - } - return g.Type -} - -func (g *GetSearchAllLibrariesDirectory) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesDirectory) GetFilter() *string { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetSearchAllLibrariesDirectory) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetSearchAllLibrariesDirectory) GetTagType() *int64 { - return types.Pointer[int64](4) -} - -func (g *GetSearchAllLibrariesDirectory) GetTagKey() *string { - if g == nil { - return nil - } - return g.TagKey -} - -func (g *GetSearchAllLibrariesDirectory) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSearchAllLibrariesDirectory) GetCount() *int64 { - if g == nil { - return nil - } - return g.Count -} - -// GetSearchAllLibrariesType - The type of media content in the Plex library. This can represent videos, music, or photos. -type GetSearchAllLibrariesType string - -const ( - GetSearchAllLibrariesTypeMovie GetSearchAllLibrariesType = "movie" - GetSearchAllLibrariesTypeTvShow GetSearchAllLibrariesType = "show" - GetSearchAllLibrariesTypeSeason GetSearchAllLibrariesType = "season" - GetSearchAllLibrariesTypeEpisode GetSearchAllLibrariesType = "episode" - GetSearchAllLibrariesTypeArtist GetSearchAllLibrariesType = "artist" - GetSearchAllLibrariesTypeAlbum GetSearchAllLibrariesType = "album" - GetSearchAllLibrariesTypeTrack GetSearchAllLibrariesType = "track" - GetSearchAllLibrariesTypePhotoAlbum GetSearchAllLibrariesType = "photoalbum" - GetSearchAllLibrariesTypePhoto GetSearchAllLibrariesType = "photo" - GetSearchAllLibrariesTypeCollection GetSearchAllLibrariesType = "collection" -) - -func (e GetSearchAllLibrariesType) ToPointer() *GetSearchAllLibrariesType { - return &e -} - -type GetSearchAllLibrariesLibraryType string - -const ( - GetSearchAllLibrariesLibraryTypeCoverPoster GetSearchAllLibrariesLibraryType = "coverPoster" - GetSearchAllLibrariesLibraryTypeBackground GetSearchAllLibrariesLibraryType = "background" - GetSearchAllLibrariesLibraryTypeSnapshot GetSearchAllLibrariesLibraryType = "snapshot" - GetSearchAllLibrariesLibraryTypeClearLogo GetSearchAllLibrariesLibraryType = "clearLogo" -) - -func (e GetSearchAllLibrariesLibraryType) ToPointer() *GetSearchAllLibrariesLibraryType { - return &e -} - -type GetSearchAllLibrariesImage struct { - Alt string `json:"alt"` - Type GetSearchAllLibrariesLibraryType `json:"type"` - URL string `json:"url"` -} - -func (g *GetSearchAllLibrariesImage) GetAlt() string { - if g == nil { - return "" - } - return g.Alt -} - -func (g *GetSearchAllLibrariesImage) GetType() GetSearchAllLibrariesLibraryType { - if g == nil { - return GetSearchAllLibrariesLibraryType("") - } - return g.Type -} - -func (g *GetSearchAllLibrariesImage) GetURL() string { - if g == nil { - return "" - } - return g.URL -} - -type GetSearchAllLibrariesUltraBlurColors struct { - TopLeft string `json:"topLeft"` - TopRight string `json:"topRight"` - BottomRight string `json:"bottomRight"` - BottomLeft string `json:"bottomLeft"` -} - -func (g *GetSearchAllLibrariesUltraBlurColors) GetTopLeft() string { - if g == nil { - return "" - } - return g.TopLeft -} - -func (g *GetSearchAllLibrariesUltraBlurColors) GetTopRight() string { - if g == nil { - return "" - } - return g.TopRight -} - -func (g *GetSearchAllLibrariesUltraBlurColors) GetBottomRight() string { - if g == nil { - return "" - } - return g.BottomRight -} - -func (g *GetSearchAllLibrariesUltraBlurColors) GetBottomLeft() string { - if g == nil { - return "" - } - return g.BottomLeft -} - -type GetSearchAllLibrariesGuids struct { - // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// - // - ID string `json:"id"` -} - -func (g *GetSearchAllLibrariesGuids) GetID() string { - if g == nil { - return "" - } - return g.ID -} - -// GetSearchAllLibrariesShowOrdering - Setting that indicates the episode ordering for the show. -// Options: -// - None = Library default -// - tmdbAiring = The Movie Database (Aired) -// - aired = TheTVDB (Aired) -// - dvd = TheTVDB (DVD) -// - absolute = TheTVDB (Absolute) -type GetSearchAllLibrariesShowOrdering string - -const ( - GetSearchAllLibrariesShowOrderingNone GetSearchAllLibrariesShowOrdering = "None" - GetSearchAllLibrariesShowOrderingTmdbAiring GetSearchAllLibrariesShowOrdering = "tmdbAiring" - GetSearchAllLibrariesShowOrderingTvdbAired GetSearchAllLibrariesShowOrdering = "aired" - GetSearchAllLibrariesShowOrderingTvdbDvd GetSearchAllLibrariesShowOrdering = "dvd" - GetSearchAllLibrariesShowOrderingTvdbAbsolute GetSearchAllLibrariesShowOrdering = "absolute" -) - -func (e GetSearchAllLibrariesShowOrdering) ToPointer() *GetSearchAllLibrariesShowOrdering { - return &e -} - -// GetSearchAllLibrariesFlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). -type GetSearchAllLibrariesFlattenSeasons string - -const ( - GetSearchAllLibrariesFlattenSeasonsLibraryDefault GetSearchAllLibrariesFlattenSeasons = "-1" - GetSearchAllLibrariesFlattenSeasonsHide GetSearchAllLibrariesFlattenSeasons = "0" - GetSearchAllLibrariesFlattenSeasonsShow GetSearchAllLibrariesFlattenSeasons = "1" -) - -func (e GetSearchAllLibrariesFlattenSeasons) ToPointer() *GetSearchAllLibrariesFlattenSeasons { - return &e -} - -type GetSearchAllLibrariesOptimizedForStreaming1 int - -const ( - GetSearchAllLibrariesOptimizedForStreaming1Zero GetSearchAllLibrariesOptimizedForStreaming1 = 0 - GetSearchAllLibrariesOptimizedForStreaming1One GetSearchAllLibrariesOptimizedForStreaming1 = 1 -) - -func (e GetSearchAllLibrariesOptimizedForStreaming1) ToPointer() *GetSearchAllLibrariesOptimizedForStreaming1 { - return &e -} -func (e *GetSearchAllLibrariesOptimizedForStreaming1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetSearchAllLibrariesOptimizedForStreaming1(v) - return nil - default: - return fmt.Errorf("invalid value for GetSearchAllLibrariesOptimizedForStreaming1: %v", v) - } -} - -type GetSearchAllLibrariesOptimizedForStreamingType string - -const ( - GetSearchAllLibrariesOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreaming1 GetSearchAllLibrariesOptimizedForStreamingType = "get-search-all-libraries_optimizedForStreaming_1" - GetSearchAllLibrariesOptimizedForStreamingTypeBoolean GetSearchAllLibrariesOptimizedForStreamingType = "boolean" -) - -// GetSearchAllLibrariesOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetSearchAllLibrariesOptimizedForStreaming struct { - GetSearchAllLibrariesOptimizedForStreaming1 *GetSearchAllLibrariesOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetSearchAllLibrariesOptimizedForStreamingType -} - -func CreateGetSearchAllLibrariesOptimizedForStreamingGetSearchAllLibrariesOptimizedForStreaming1(getSearchAllLibrariesOptimizedForStreaming1 GetSearchAllLibrariesOptimizedForStreaming1) GetSearchAllLibrariesOptimizedForStreaming { - typ := GetSearchAllLibrariesOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreaming1 - - return GetSearchAllLibrariesOptimizedForStreaming{ - GetSearchAllLibrariesOptimizedForStreaming1: &getSearchAllLibrariesOptimizedForStreaming1, - Type: typ, - } -} - -func CreateGetSearchAllLibrariesOptimizedForStreamingBoolean(boolean bool) GetSearchAllLibrariesOptimizedForStreaming { - typ := GetSearchAllLibrariesOptimizedForStreamingTypeBoolean - - return GetSearchAllLibrariesOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetSearchAllLibrariesOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getSearchAllLibrariesOptimizedForStreaming1 GetSearchAllLibrariesOptimizedForStreaming1 = GetSearchAllLibrariesOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getSearchAllLibrariesOptimizedForStreaming1, "", true, nil); err == nil { - u.GetSearchAllLibrariesOptimizedForStreaming1 = &getSearchAllLibrariesOptimizedForStreaming1 - u.Type = GetSearchAllLibrariesOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreaming1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetSearchAllLibrariesOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetSearchAllLibrariesOptimizedForStreaming", string(data)) -} - -func (u GetSearchAllLibrariesOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetSearchAllLibrariesOptimizedForStreaming1 != nil { - return utils.MarshalJSON(u.GetSearchAllLibrariesOptimizedForStreaming1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetSearchAllLibrariesOptimizedForStreaming: all fields are null") -} - -type GetSearchAllLibrariesOptimizedForStreamingLibrary1 int - -const ( - GetSearchAllLibrariesOptimizedForStreamingLibrary1Zero GetSearchAllLibrariesOptimizedForStreamingLibrary1 = 0 - GetSearchAllLibrariesOptimizedForStreamingLibrary1One GetSearchAllLibrariesOptimizedForStreamingLibrary1 = 1 -) - -func (e GetSearchAllLibrariesOptimizedForStreamingLibrary1) ToPointer() *GetSearchAllLibrariesOptimizedForStreamingLibrary1 { - return &e -} -func (e *GetSearchAllLibrariesOptimizedForStreamingLibrary1) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetSearchAllLibrariesOptimizedForStreamingLibrary1(v) - return nil - default: - return fmt.Errorf("invalid value for GetSearchAllLibrariesOptimizedForStreamingLibrary1: %v", v) - } -} - -type GetSearchAllLibrariesLibraryOptimizedForStreamingType string - -const ( - GetSearchAllLibrariesLibraryOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreamingLibrary1 GetSearchAllLibrariesLibraryOptimizedForStreamingType = "get-search-all-libraries_optimizedForStreaming_Library_1" - GetSearchAllLibrariesLibraryOptimizedForStreamingTypeBoolean GetSearchAllLibrariesLibraryOptimizedForStreamingType = "boolean" -) - -// GetSearchAllLibrariesLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true -type GetSearchAllLibrariesLibraryOptimizedForStreaming struct { - GetSearchAllLibrariesOptimizedForStreamingLibrary1 *GetSearchAllLibrariesOptimizedForStreamingLibrary1 `queryParam:"inline,name=optimizedForStreaming"` - Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` - - Type GetSearchAllLibrariesLibraryOptimizedForStreamingType -} - -func CreateGetSearchAllLibrariesLibraryOptimizedForStreamingGetSearchAllLibrariesOptimizedForStreamingLibrary1(getSearchAllLibrariesOptimizedForStreamingLibrary1 GetSearchAllLibrariesOptimizedForStreamingLibrary1) GetSearchAllLibrariesLibraryOptimizedForStreaming { - typ := GetSearchAllLibrariesLibraryOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreamingLibrary1 - - return GetSearchAllLibrariesLibraryOptimizedForStreaming{ - GetSearchAllLibrariesOptimizedForStreamingLibrary1: &getSearchAllLibrariesOptimizedForStreamingLibrary1, - Type: typ, - } -} - -func CreateGetSearchAllLibrariesLibraryOptimizedForStreamingBoolean(boolean bool) GetSearchAllLibrariesLibraryOptimizedForStreaming { - typ := GetSearchAllLibrariesLibraryOptimizedForStreamingTypeBoolean - - return GetSearchAllLibrariesLibraryOptimizedForStreaming{ - Boolean: &boolean, - Type: typ, - } -} - -func (u *GetSearchAllLibrariesLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { - - var getSearchAllLibrariesOptimizedForStreamingLibrary1 GetSearchAllLibrariesOptimizedForStreamingLibrary1 = GetSearchAllLibrariesOptimizedForStreamingLibrary1(0) - if err := utils.UnmarshalJSON(data, &getSearchAllLibrariesOptimizedForStreamingLibrary1, "", true, nil); err == nil { - u.GetSearchAllLibrariesOptimizedForStreamingLibrary1 = &getSearchAllLibrariesOptimizedForStreamingLibrary1 - u.Type = GetSearchAllLibrariesLibraryOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreamingLibrary1 - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { - u.Boolean = &boolean - u.Type = GetSearchAllLibrariesLibraryOptimizedForStreamingTypeBoolean - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetSearchAllLibrariesLibraryOptimizedForStreaming", string(data)) -} - -func (u GetSearchAllLibrariesLibraryOptimizedForStreaming) MarshalJSON() ([]byte, error) { - if u.GetSearchAllLibrariesOptimizedForStreamingLibrary1 != nil { - return utils.MarshalJSON(u.GetSearchAllLibrariesOptimizedForStreamingLibrary1, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - return nil, errors.New("could not marshal union type GetSearchAllLibrariesLibraryOptimizedForStreaming: all fields are null") -} - -// GetSearchAllLibrariesHasThumbnail - Indicates if the part has a thumbnail. -type GetSearchAllLibrariesHasThumbnail string - -const ( - GetSearchAllLibrariesHasThumbnailFalse GetSearchAllLibrariesHasThumbnail = "0" - GetSearchAllLibrariesHasThumbnailTrue GetSearchAllLibrariesHasThumbnail = "1" -) - -func (e GetSearchAllLibrariesHasThumbnail) ToPointer() *GetSearchAllLibrariesHasThumbnail { - return &e -} -func (e *GetSearchAllLibrariesHasThumbnail) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "0": - fallthrough - case "1": - *e = GetSearchAllLibrariesHasThumbnail(v) - return nil - default: - return fmt.Errorf("invalid value for GetSearchAllLibrariesHasThumbnail: %v", v) - } -} - -type GetSearchAllLibrariesPart struct { - // Indicates if the part is accessible. - Accessible *bool `json:"accessible,omitempty"` - // Indicates if the part exists. - Exists *bool `json:"exists,omitempty"` - // Unique part identifier. - ID int64 `json:"id"` - // Key to access this part. - Key *string `json:"key,omitempty"` - Indexes *string `json:"indexes,omitempty"` - // Duration of the part in milliseconds. - Duration *int `json:"duration,omitempty"` - // File path for the part. - File *string `json:"file,omitempty"` - // File size in bytes. - Size *int64 `json:"size,omitempty"` - PacketLength *int `json:"packetLength,omitempty"` - // Container format of the part. - Container *string `json:"container,omitempty"` - // Video profile for the part. - VideoProfile *string `json:"videoProfile,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - // - OptimizedForStreaming *GetSearchAllLibrariesLibraryOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - HasThumbnail *GetSearchAllLibrariesHasThumbnail `default:"0" json:"hasThumbnail"` -} - -func (g GetSearchAllLibrariesPart) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSearchAllLibrariesPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id"}); err != nil { - return err - } - return nil -} - -func (g *GetSearchAllLibrariesPart) GetAccessible() *bool { - if g == nil { - return nil - } - return g.Accessible -} - -func (g *GetSearchAllLibrariesPart) GetExists() *bool { - if g == nil { - return nil - } - return g.Exists -} - -func (g *GetSearchAllLibrariesPart) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSearchAllLibrariesPart) GetIndexes() *string { - if g == nil { - return nil - } - return g.Indexes -} - -func (g *GetSearchAllLibrariesPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSearchAllLibrariesPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetSearchAllLibrariesPart) GetSize() *int64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSearchAllLibrariesPart) GetPacketLength() *int { - if g == nil { - return nil - } - return g.PacketLength -} - -func (g *GetSearchAllLibrariesPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetSearchAllLibrariesPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetSearchAllLibrariesPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetSearchAllLibrariesPart) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetSearchAllLibrariesPart) GetOptimizedForStreaming() *GetSearchAllLibrariesLibraryOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetSearchAllLibrariesPart) GetHasThumbnail() *GetSearchAllLibrariesHasThumbnail { - if g == nil { - return nil - } - return g.HasThumbnail -} - -type GetSearchAllLibrariesMedia struct { - // Unique media identifier. - ID int64 `json:"id"` - // Duration of the media in milliseconds. - Duration *int `json:"duration,omitempty"` - // Bitrate in bits per second. - Bitrate *int `json:"bitrate,omitempty"` - // Video width in pixels. - Width *int `json:"width,omitempty"` - // Video height in pixels. - Height *int `json:"height,omitempty"` - // Aspect ratio of the video. - AspectRatio *float32 `json:"aspectRatio,omitempty"` - // Number of audio channels. - AudioChannels *int `json:"audioChannels,omitempty"` - DisplayOffset *int `json:"displayOffset,omitempty"` - // Audio codec used. - AudioCodec *string `json:"audioCodec,omitempty"` - // Video codec used. - VideoCodec *string `json:"videoCodec,omitempty"` - // Video resolution (e.g., 4k). - VideoResolution *string `json:"videoResolution,omitempty"` - // Container format of the media. - Container *string `json:"container,omitempty"` - // Frame rate of the video. Values found include NTSC, PAL, 24p - // - VideoFrameRate *string `json:"videoFrameRate,omitempty"` - // Video profile (e.g., main 10). - VideoProfile *string `json:"videoProfile,omitempty"` - // Indicates whether voice activity is detected. - HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` - // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). - AudioProfile *string `json:"audioProfile,omitempty"` - // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true - OptimizedForStreaming *GetSearchAllLibrariesOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` - // Indicates whether the media has 64-bit offsets. - // This is relevant for media files that may require larger offsets than what 32-bit integers can provide. - // - Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` - Part []GetSearchAllLibrariesPart `json:"Part,omitempty"` -} - -func (g *GetSearchAllLibrariesMedia) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSearchAllLibrariesMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetSearchAllLibrariesMedia) GetWidth() *int { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetSearchAllLibrariesMedia) GetHeight() *int { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetSearchAllLibrariesMedia) GetAspectRatio() *float32 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetSearchAllLibrariesMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetSearchAllLibrariesMedia) GetDisplayOffset() *int { - if g == nil { - return nil - } - return g.DisplayOffset -} - -func (g *GetSearchAllLibrariesMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetSearchAllLibrariesMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetSearchAllLibrariesMedia) GetVideoResolution() *string { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetSearchAllLibrariesMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetSearchAllLibrariesMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetSearchAllLibrariesMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetSearchAllLibrariesMedia) GetHasVoiceActivity() *bool { - if g == nil { - return nil - } - return g.HasVoiceActivity -} - -func (g *GetSearchAllLibrariesMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetSearchAllLibrariesMedia) GetOptimizedForStreaming() *GetSearchAllLibrariesOptimizedForStreaming { - if g == nil { - return nil - } - return g.OptimizedForStreaming -} - -func (g *GetSearchAllLibrariesMedia) GetHas64bitOffsets() *bool { - if g == nil { - return nil - } - return g.Has64bitOffsets -} - -func (g *GetSearchAllLibrariesMedia) GetPart() []GetSearchAllLibrariesPart { - if g == nil { - return nil - } - return g.Part -} - -type GetSearchAllLibrariesGenre struct { - // The unique identifier for the genre. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The genre name of this media-item - // - Tag string `json:"tag"` -} - -func (g *GetSearchAllLibrariesGenre) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesGenre) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetSearchAllLibrariesCountry struct { - // The unique identifier for the country. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The country of origin of this media item - Tag string `json:"tag"` -} - -func (g *GetSearchAllLibrariesCountry) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesCountry) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -type GetSearchAllLibrariesDirector struct { - // Unique identifier for the director. - ID int `json:"id"` - // The role of Director - Tag string `json:"tag"` - // The absolute URL of the thumbnail image for the director. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetSearchAllLibrariesDirector) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesDirector) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetSearchAllLibrariesDirector) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetSearchAllLibrariesWriter struct { - // Unique identifier for the writer. - ID int `json:"id"` - // The role of Writer - Tag string `json:"tag"` - // The absolute URL of the thumbnail image for the writer. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetSearchAllLibrariesWriter) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesWriter) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetSearchAllLibrariesWriter) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetSearchAllLibrariesRole struct { - // The unique identifier for the role. - // NOTE: This is different for each Plex server and is not globally unique. - // - ID int `json:"id"` - // The display tag for the actor (typically the actor's name). - Tag string `json:"tag"` - // The role played by the actor in the media item. - Role *string `json:"role,omitempty"` - // The absolute URL of the thumbnail image for the actor. - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetSearchAllLibrariesRole) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetSearchAllLibrariesRole) GetTag() string { - if g == nil { - return "" - } - return g.Tag -} - -func (g *GetSearchAllLibrariesRole) GetRole() *string { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetSearchAllLibrariesRole) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -// GetSearchAllLibrariesLocation - The folder path for the media item. -type GetSearchAllLibrariesLocation struct { - Path string `json:"path"` -} - -func (g *GetSearchAllLibrariesLocation) GetPath() string { - if g == nil { - return "" - } - return g.Path -} - -// GetSearchAllLibrariesMetadata - Unknown -type GetSearchAllLibrariesMetadata struct { - // The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. - RatingKey string `json:"ratingKey"` - // The unique key for the media item. - Key string `json:"key"` - // The globally unique identifier for the media item. - GUID string `json:"guid"` - // A URL‐friendly version of the media title. - Slug string `json:"slug"` - // The studio that produced the media item. - Studio *string `json:"studio,omitempty"` - Type GetSearchAllLibrariesType `json:"type"` - // The title of the media item. - Title string `json:"title"` - // The banner image URL for the media item. - Banner string `json:"banner"` - // The sort title used for ordering media items. - TitleSort string `json:"titleSort"` - // The content rating for the media item. - ContentRating *string `json:"contentRating,omitempty"` - // A synopsis of the media item. - Summary string `json:"summary"` - // The critic rating for the media item. - Rating float32 `json:"rating"` - // The audience rating for the media item. - AudienceRating float64 `json:"audienceRating"` - // The release year of the media item. - Year *int `json:"year,omitempty"` - // A brief tagline for the media item. - Tagline string `json:"tagline"` - // The thumbnail image URL for the media item. - Thumb string `json:"thumb"` - // The art image URL for the media item. - Art string `json:"art"` - // The theme URL for the media item. - Theme string `json:"theme"` - // The index position of the media item. - Index int `json:"index"` - // The number of leaf items (end nodes) under this media item. - LeafCount *int `json:"leafCount,omitempty"` - // The number of leaf items that have been viewed. - ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` - // The number of child items associated with this media item. - ChildCount int `json:"childCount"` - // The total number of seasons (for TV shows). - SeasonCount int `json:"seasonCount"` - // The duration of the media item in milliseconds. - Duration int `json:"duration"` - // The original release date of the media item. - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - AddedAt int64 `json:"addedAt"` - // Unix epoch datetime in seconds - UpdatedAt *int64 `json:"updatedAt,omitempty"` - // The release year of the parent media item. - ParentYear *int `json:"parentYear,omitempty"` - // The URL for the audience rating image. - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - // The source from which chapter data is derived. - ChapterSource *string `json:"chapterSource,omitempty"` - // The primary extra key associated with this media item. - PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` - // The original title of the media item (if different). - OriginalTitle *string `json:"originalTitle,omitempty"` - // The rating key of the parent media item. - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - // The rating key of the grandparent media item. - GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` - // The GUID of the parent media item. - ParentGUID *string `json:"parentGuid,omitempty"` - // The GUID of the grandparent media item. - GrandparentGUID *string `json:"grandparentGuid,omitempty"` - // The slug for the grandparent media item. - GrandparentSlug *string `json:"grandparentSlug,omitempty"` - // The key of the grandparent media item. - GrandparentKey *string `json:"grandparentKey,omitempty"` - // The key of the parent media item. - ParentKey *string `json:"parentKey,omitempty"` - // The title of the grandparent media item. - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - // The thumbnail URL for the grandparent media item. - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - // The theme URL for the grandparent media item. - GrandparentTheme *string `json:"grandparentTheme,omitempty"` - // The art URL for the grandparent media item. - GrandparentArt *string `json:"grandparentArt,omitempty"` - // The title of the parent media item. - ParentTitle *string `json:"parentTitle,omitempty"` - // The index position of the parent media item. - ParentIndex *int `json:"parentIndex,omitempty"` - // The thumbnail URL for the parent media item. - ParentThumb *string `json:"parentThumb,omitempty"` - // The URL for the rating image. - RatingImage *string `json:"ratingImage,omitempty"` - // The number of times this media item has been viewed. - ViewCount *int `json:"viewCount,omitempty"` - // The current playback offset (in milliseconds). - ViewOffset *int `json:"viewOffset,omitempty"` - // The number of times this media item has been skipped. - SkipCount *int `json:"skipCount,omitempty"` - // A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. - Subtype *string `json:"subtype,omitempty"` - // The Unix timestamp representing the last time the item was rated. - LastRatedAt *int64 `json:"lastRatedAt,omitempty"` - // The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). - CreatedAtAccuracy *string `json:"createdAtAccuracy,omitempty"` - // The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. - CreatedAtTZOffset *string `json:"createdAtTZOffset,omitempty"` - // Unix timestamp for when the media item was last viewed. - LastViewedAt *int `json:"lastViewedAt,omitempty"` - // The rating provided by a user for the item. This value is expressed as a decimal number. - UserRating *float32 `json:"userRating,omitempty"` - Image []GetSearchAllLibrariesImage `json:"Image,omitempty"` - UltraBlurColors *GetSearchAllLibrariesUltraBlurColors `json:"UltraBlurColors,omitempty"` - Guids []GetSearchAllLibrariesGuids `json:"Guid,omitempty"` - // The identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The key corresponding to the library section. - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - // Setting that indicates the episode ordering for the show. - // Options: - // - None = Library default - // - tmdbAiring = The Movie Database (Aired) - // - aired = TheTVDB (Aired) - // - dvd = TheTVDB (DVD) - // - absolute = TheTVDB (Absolute) - // - ShowOrdering *GetSearchAllLibrariesShowOrdering `json:"showOrdering,omitempty"` - // Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). - // - FlattenSeasons *GetSearchAllLibrariesFlattenSeasons `json:"flattenSeasons,omitempty"` - // Indicates whether child items should be skipped. - SkipChildren *bool `json:"skipChildren,omitempty"` - Media []GetSearchAllLibrariesMedia `json:"Media,omitempty"` - Genre []GetSearchAllLibrariesGenre `json:"Genre,omitempty"` - Country []GetSearchAllLibrariesCountry `json:"Country,omitempty"` - Director []GetSearchAllLibrariesDirector `json:"Director,omitempty"` - Writer []GetSearchAllLibrariesWriter `json:"Writer,omitempty"` - Role []GetSearchAllLibrariesRole `json:"Role,omitempty"` - Location []GetSearchAllLibrariesLocation `json:"Location,omitempty"` -} - -func (g GetSearchAllLibrariesMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSearchAllLibrariesMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "banner", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { - return err - } - return nil -} - -func (g *GetSearchAllLibrariesMetadata) GetRatingKey() string { - if g == nil { - return "" - } - return g.RatingKey -} - -func (g *GetSearchAllLibrariesMetadata) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetSearchAllLibrariesMetadata) GetGUID() string { - if g == nil { - return "" - } - return g.GUID -} - -func (g *GetSearchAllLibrariesMetadata) GetSlug() string { - if g == nil { - return "" - } - return g.Slug -} - -func (g *GetSearchAllLibrariesMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetSearchAllLibrariesMetadata) GetType() GetSearchAllLibrariesType { - if g == nil { - return GetSearchAllLibrariesType("") - } - return g.Type -} - -func (g *GetSearchAllLibrariesMetadata) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetSearchAllLibrariesMetadata) GetBanner() string { - if g == nil { - return "" - } - return g.Banner -} - -func (g *GetSearchAllLibrariesMetadata) GetTitleSort() string { - if g == nil { - return "" - } - return g.TitleSort -} - -func (g *GetSearchAllLibrariesMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetSearchAllLibrariesMetadata) GetSummary() string { - if g == nil { - return "" - } - return g.Summary -} - -func (g *GetSearchAllLibrariesMetadata) GetRating() float32 { - if g == nil { - return 0.0 - } - return g.Rating -} - -func (g *GetSearchAllLibrariesMetadata) GetAudienceRating() float64 { - if g == nil { - return 0.0 - } - return g.AudienceRating -} - -func (g *GetSearchAllLibrariesMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetSearchAllLibrariesMetadata) GetTagline() string { - if g == nil { - return "" - } - return g.Tagline -} - -func (g *GetSearchAllLibrariesMetadata) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetSearchAllLibrariesMetadata) GetArt() string { - if g == nil { - return "" - } - return g.Art -} - -func (g *GetSearchAllLibrariesMetadata) GetTheme() string { - if g == nil { - return "" - } - return g.Theme -} - -func (g *GetSearchAllLibrariesMetadata) GetIndex() int { - if g == nil { - return 0 - } - return g.Index -} - -func (g *GetSearchAllLibrariesMetadata) GetLeafCount() *int { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetSearchAllLibrariesMetadata) GetViewedLeafCount() *int { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetSearchAllLibrariesMetadata) GetChildCount() int { - if g == nil { - return 0 - } - return g.ChildCount -} - -func (g *GetSearchAllLibrariesMetadata) GetSeasonCount() int { - if g == nil { - return 0 - } - return g.SeasonCount -} - -func (g *GetSearchAllLibrariesMetadata) GetDuration() int { - if g == nil { - return 0 - } - return g.Duration -} - -func (g *GetSearchAllLibrariesMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetSearchAllLibrariesMetadata) GetAddedAt() int64 { - if g == nil { - return 0 - } - return g.AddedAt -} - -func (g *GetSearchAllLibrariesMetadata) GetUpdatedAt() *int64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetSearchAllLibrariesMetadata) GetParentYear() *int { - if g == nil { - return nil - } - return g.ParentYear -} - -func (g *GetSearchAllLibrariesMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetSearchAllLibrariesMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetSearchAllLibrariesMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetSearchAllLibrariesMetadata) GetOriginalTitle() *string { - if g == nil { - return nil - } - return g.OriginalTitle -} - -func (g *GetSearchAllLibrariesMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentRatingKey() *string { - if g == nil { - return nil - } - return g.GrandparentRatingKey -} - -func (g *GetSearchAllLibrariesMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentGUID() *string { - if g == nil { - return nil - } - return g.GrandparentGUID -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentSlug() *string { - if g == nil { - return nil - } - return g.GrandparentSlug -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetSearchAllLibrariesMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentTheme() *string { - if g == nil { - return nil - } - return g.GrandparentTheme -} - -func (g *GetSearchAllLibrariesMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetSearchAllLibrariesMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetSearchAllLibrariesMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetSearchAllLibrariesMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetSearchAllLibrariesMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetSearchAllLibrariesMetadata) GetViewCount() *int { - if g == nil { - return nil - } - return g.ViewCount -} - -func (g *GetSearchAllLibrariesMetadata) GetViewOffset() *int { - if g == nil { - return nil - } - return g.ViewOffset -} - -func (g *GetSearchAllLibrariesMetadata) GetSkipCount() *int { - if g == nil { - return nil - } - return g.SkipCount -} - -func (g *GetSearchAllLibrariesMetadata) GetSubtype() *string { - if g == nil { - return nil - } - return g.Subtype -} - -func (g *GetSearchAllLibrariesMetadata) GetLastRatedAt() *int64 { - if g == nil { - return nil - } - return g.LastRatedAt -} - -func (g *GetSearchAllLibrariesMetadata) GetCreatedAtAccuracy() *string { - if g == nil { - return nil - } - return g.CreatedAtAccuracy -} - -func (g *GetSearchAllLibrariesMetadata) GetCreatedAtTZOffset() *string { - if g == nil { - return nil - } - return g.CreatedAtTZOffset -} - -func (g *GetSearchAllLibrariesMetadata) GetLastViewedAt() *int { - if g == nil { - return nil - } - return g.LastViewedAt -} - -func (g *GetSearchAllLibrariesMetadata) GetUserRating() *float32 { - if g == nil { - return nil - } - return g.UserRating -} - -func (g *GetSearchAllLibrariesMetadata) GetImage() []GetSearchAllLibrariesImage { - if g == nil { - return nil - } - return g.Image -} - -func (g *GetSearchAllLibrariesMetadata) GetUltraBlurColors() *GetSearchAllLibrariesUltraBlurColors { - if g == nil { - return nil - } - return g.UltraBlurColors -} - -func (g *GetSearchAllLibrariesMetadata) GetGuids() []GetSearchAllLibrariesGuids { - if g == nil { - return nil - } - return g.Guids -} - -func (g *GetSearchAllLibrariesMetadata) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetSearchAllLibrariesMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetSearchAllLibrariesMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetSearchAllLibrariesMetadata) GetShowOrdering() *GetSearchAllLibrariesShowOrdering { - if g == nil { - return nil - } - return g.ShowOrdering -} - -func (g *GetSearchAllLibrariesMetadata) GetFlattenSeasons() *GetSearchAllLibrariesFlattenSeasons { - if g == nil { - return nil - } - return g.FlattenSeasons -} - -func (g *GetSearchAllLibrariesMetadata) GetSkipChildren() *bool { - if g == nil { - return nil - } - return g.SkipChildren -} - -func (g *GetSearchAllLibrariesMetadata) GetMedia() []GetSearchAllLibrariesMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetSearchAllLibrariesMetadata) GetGenre() []GetSearchAllLibrariesGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetSearchAllLibrariesMetadata) GetCountry() []GetSearchAllLibrariesCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetSearchAllLibrariesMetadata) GetDirector() []GetSearchAllLibrariesDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetSearchAllLibrariesMetadata) GetWriter() []GetSearchAllLibrariesWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetSearchAllLibrariesMetadata) GetRole() []GetSearchAllLibrariesRole { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetSearchAllLibrariesMetadata) GetLocation() []GetSearchAllLibrariesLocation { - if g == nil { - return nil - } - return g.Location -} - -type SearchResult struct { - // The score of the search result, typically a float value between 0 and 1. - Score float32 `json:"score"` - Directory *GetSearchAllLibrariesDirectory `json:"Directory,omitempty"` - Metadata *GetSearchAllLibrariesMetadata `json:"Metadata,omitempty"` -} - -func (s *SearchResult) GetScore() float32 { - if s == nil { - return 0.0 - } - return s.Score -} - -func (s *SearchResult) GetDirectory() *GetSearchAllLibrariesDirectory { - if s == nil { - return nil - } - return s.Directory -} - -func (s *SearchResult) GetMetadata() *GetSearchAllLibrariesMetadata { - if s == nil { - return nil - } - return s.Metadata -} - -type GetSearchAllLibrariesMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The unique identifier for the library section. - LibrarySectionID *int64 `json:"librarySectionID,omitempty"` - // The title of the library section. - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - // The universally unique identifier for the library section. - LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - SearchResult []SearchResult `json:"SearchResult"` -} - -func (g *GetSearchAllLibrariesMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetSearchAllLibrariesMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetSearchAllLibrariesMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetSearchAllLibrariesMediaContainer) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetSearchAllLibrariesMediaContainer) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetSearchAllLibrariesMediaContainer) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetSearchAllLibrariesMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetSearchAllLibrariesMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetSearchAllLibrariesMediaContainer) GetSearchResult() []SearchResult { - if g == nil { - return []SearchResult{} - } - return g.SearchResult -} - -// GetSearchAllLibrariesResponseBody - The libraries available on the Server -type GetSearchAllLibrariesResponseBody struct { - MediaContainer GetSearchAllLibrariesMediaContainer `json:"MediaContainer"` -} - -func (g *GetSearchAllLibrariesResponseBody) GetMediaContainer() GetSearchAllLibrariesMediaContainer { - if g == nil { - return GetSearchAllLibrariesMediaContainer{} - } - return g.MediaContainer -} - -type GetSearchAllLibrariesResponse 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 libraries available on the Server - Object *GetSearchAllLibrariesResponseBody -} - -func (g *GetSearchAllLibrariesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetSearchAllLibrariesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetSearchAllLibrariesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetSearchAllLibrariesResponse) GetObject() *GetSearchAllLibrariesResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getsearchlibrary.go b/models/operations/getsearchlibrary.go deleted file mode 100644 index 888d324..0000000 --- a/models/operations/getsearchlibrary.go +++ /dev/null @@ -1,381 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -// GetSearchLibraryQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetSearchLibraryQueryParamType int64 - -const ( - GetSearchLibraryQueryParamTypeMovie GetSearchLibraryQueryParamType = 1 - GetSearchLibraryQueryParamTypeTvShow GetSearchLibraryQueryParamType = 2 - GetSearchLibraryQueryParamTypeSeason GetSearchLibraryQueryParamType = 3 - GetSearchLibraryQueryParamTypeEpisode GetSearchLibraryQueryParamType = 4 - GetSearchLibraryQueryParamTypeArtist GetSearchLibraryQueryParamType = 5 - GetSearchLibraryQueryParamTypeAlbum GetSearchLibraryQueryParamType = 6 - GetSearchLibraryQueryParamTypeTrack GetSearchLibraryQueryParamType = 7 - GetSearchLibraryQueryParamTypePhotoAlbum GetSearchLibraryQueryParamType = 8 - GetSearchLibraryQueryParamTypePhoto GetSearchLibraryQueryParamType = 9 -) - -func (e GetSearchLibraryQueryParamType) ToPointer() *GetSearchLibraryQueryParamType { - return &e -} - -type GetSearchLibraryRequest struct { - // The unique key of the Plex library. - // Note: This is unique in the context of the Plex server. - // - SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"` - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetSearchLibraryQueryParamType `queryParam:"style=form,explode=true,name=type"` -} - -func (g *GetSearchLibraryRequest) GetSectionKey() int { - if g == nil { - return 0 - } - return g.SectionKey -} - -func (g *GetSearchLibraryRequest) GetType() GetSearchLibraryQueryParamType { - if g == nil { - return GetSearchLibraryQueryParamType(0) - } - return g.Type -} - -type GetSearchLibraryMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - GUID *string `json:"guid,omitempty"` - ParentGUID *string `json:"parentGuid,omitempty"` - ParentStudio *string `json:"parentStudio,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - ParentKey *string `json:"parentKey,omitempty"` - ParentTitle *string `json:"parentTitle,omitempty"` - Summary *string `json:"summary,omitempty"` - Index *int `json:"index,omitempty"` - ParentIndex *int `json:"parentIndex,omitempty"` - ParentYear *int `json:"parentYear,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Art *string `json:"art,omitempty"` - ParentThumb *string `json:"parentThumb,omitempty"` - ParentTheme *string `json:"parentTheme,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` -} - -func (g *GetSearchLibraryMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetSearchLibraryMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSearchLibraryMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetSearchLibraryMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetSearchLibraryMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetSearchLibraryMetadata) GetParentStudio() *string { - if g == nil { - return nil - } - return g.ParentStudio -} - -func (g *GetSearchLibraryMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetSearchLibraryMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetSearchLibraryMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetSearchLibraryMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetSearchLibraryMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetSearchLibraryMetadata) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetSearchLibraryMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetSearchLibraryMetadata) GetParentYear() *int { - if g == nil { - return nil - } - return g.ParentYear -} - -func (g *GetSearchLibraryMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSearchLibraryMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetSearchLibraryMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetSearchLibraryMetadata) GetParentTheme() *string { - if g == nil { - return nil - } - return g.ParentTheme -} - -func (g *GetSearchLibraryMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetSearchLibraryMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -type GetSearchLibraryMediaContainer struct { - Size *int `json:"size,omitempty"` - AllowSync *bool `json:"allowSync,omitempty"` - Art *string `json:"art,omitempty"` - Identifier *string `json:"identifier,omitempty"` - MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` - MediaTagVersion *int `json:"mediaTagVersion,omitempty"` - Nocache *bool `json:"nocache,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Title1 *string `json:"title1,omitempty"` - Title2 *string `json:"title2,omitempty"` - ViewGroup *string `json:"viewGroup,omitempty"` - ViewMode *int `json:"viewMode,omitempty"` - Metadata []GetSearchLibraryMetadata `json:"Metadata,omitempty"` -} - -func (g *GetSearchLibraryMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSearchLibraryMediaContainer) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetSearchLibraryMediaContainer) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetSearchLibraryMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetSearchLibraryMediaContainer) GetMediaTagPrefix() *string { - if g == nil { - return nil - } - return g.MediaTagPrefix -} - -func (g *GetSearchLibraryMediaContainer) GetMediaTagVersion() *int { - if g == nil { - return nil - } - return g.MediaTagVersion -} - -func (g *GetSearchLibraryMediaContainer) GetNocache() *bool { - if g == nil { - return nil - } - return g.Nocache -} - -func (g *GetSearchLibraryMediaContainer) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSearchLibraryMediaContainer) GetTitle1() *string { - if g == nil { - return nil - } - return g.Title1 -} - -func (g *GetSearchLibraryMediaContainer) GetTitle2() *string { - if g == nil { - return nil - } - return g.Title2 -} - -func (g *GetSearchLibraryMediaContainer) GetViewGroup() *string { - if g == nil { - return nil - } - return g.ViewGroup -} - -func (g *GetSearchLibraryMediaContainer) GetViewMode() *int { - if g == nil { - return nil - } - return g.ViewMode -} - -func (g *GetSearchLibraryMediaContainer) GetMetadata() []GetSearchLibraryMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetSearchLibraryResponseBody - The contents of the library by section and type -type GetSearchLibraryResponseBody struct { - MediaContainer *GetSearchLibraryMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetSearchLibraryResponseBody) GetMediaContainer() *GetSearchLibraryMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetSearchLibraryResponse 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 contents of the library by section and type - Object *GetSearchLibraryResponseBody -} - -func (g *GetSearchLibraryResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetSearchLibraryResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetSearchLibraryResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetSearchLibraryResponse) GetObject() *GetSearchLibraryResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getsearchresults.go b/models/operations/getsearchresults.go deleted file mode 100644 index 1f9209c..0000000 --- a/models/operations/getsearchresults.go +++ /dev/null @@ -1,681 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (g *GetSearchResultsRequest) GetQuery() string { - if g == nil { - return "" - } - return g.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 (g *GetSearchResultsPart) GetID() *float64 { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetSearchResultsPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSearchResultsPart) GetDuration() *float64 { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSearchResultsPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetSearchResultsPart) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSearchResultsPart) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetSearchResultsPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetSearchResultsPart) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.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 (g *GetSearchResultsMedia) GetID() *float64 { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetSearchResultsMedia) GetDuration() *float64 { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSearchResultsMedia) GetBitrate() *float64 { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetSearchResultsMedia) GetWidth() *float64 { - if g == nil { - return nil - } - return g.Width -} - -func (g *GetSearchResultsMedia) GetHeight() *float64 { - if g == nil { - return nil - } - return g.Height -} - -func (g *GetSearchResultsMedia) GetAspectRatio() *float64 { - if g == nil { - return nil - } - return g.AspectRatio -} - -func (g *GetSearchResultsMedia) GetAudioChannels() *float64 { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetSearchResultsMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetSearchResultsMedia) GetVideoCodec() *string { - if g == nil { - return nil - } - return g.VideoCodec -} - -func (g *GetSearchResultsMedia) GetVideoResolution() *float64 { - if g == nil { - return nil - } - return g.VideoResolution -} - -func (g *GetSearchResultsMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetSearchResultsMedia) GetVideoFrameRate() *string { - if g == nil { - return nil - } - return g.VideoFrameRate -} - -func (g *GetSearchResultsMedia) GetAudioProfile() *string { - if g == nil { - return nil - } - return g.AudioProfile -} - -func (g *GetSearchResultsMedia) GetVideoProfile() *string { - if g == nil { - return nil - } - return g.VideoProfile -} - -func (g *GetSearchResultsMedia) GetPart() []GetSearchResultsPart { - if g == nil { - return nil - } - return g.Part -} - -type GetSearchResultsGenre struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetSearchResultsGenre) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetSearchResultsDirector struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetSearchResultsDirector) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetSearchResultsWriter struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetSearchResultsWriter) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetSearchResultsCountry struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetSearchResultsCountry) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetSearchResultsRole struct { - Tag *string `json:"tag,omitempty"` -} - -func (g *GetSearchResultsRole) GetTag() *string { - if g == nil { - return nil - } - return g.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, nil); err != nil { - return err - } - return nil -} - -func (g *GetSearchResultsMetadata) GetAllowSync() *bool { - if g == nil { - return nil - } - return g.AllowSync -} - -func (g *GetSearchResultsMetadata) GetLibrarySectionID() *float64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetSearchResultsMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetSearchResultsMetadata) GetLibrarySectionUUID() *string { - if g == nil { - return nil - } - return g.LibrarySectionUUID -} - -func (g *GetSearchResultsMetadata) GetPersonal() *bool { - if g == nil { - return nil - } - return g.Personal -} - -func (g *GetSearchResultsMetadata) GetSourceTitle() *string { - if g == nil { - return nil - } - return g.SourceTitle -} - -func (g *GetSearchResultsMetadata) GetRatingKey() *float64 { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetSearchResultsMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSearchResultsMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetSearchResultsMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetSearchResultsMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetSearchResultsMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetSearchResultsMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetSearchResultsMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetSearchResultsMetadata) GetRating() *float64 { - if g == nil { - return nil - } - return g.Rating -} - -func (g *GetSearchResultsMetadata) GetAudienceRating() *float64 { - if g == nil { - return nil - } - return g.AudienceRating -} - -func (g *GetSearchResultsMetadata) GetYear() *float64 { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetSearchResultsMetadata) GetTagline() *string { - if g == nil { - return nil - } - return g.Tagline -} - -func (g *GetSearchResultsMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSearchResultsMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetSearchResultsMetadata) GetDuration() *float64 { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSearchResultsMetadata) GetOriginallyAvailableAt() *time.Time { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetSearchResultsMetadata) GetAddedAt() *float64 { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetSearchResultsMetadata) GetUpdatedAt() *float64 { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetSearchResultsMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetSearchResultsMetadata) GetChapterSource() *string { - if g == nil { - return nil - } - return g.ChapterSource -} - -func (g *GetSearchResultsMetadata) GetPrimaryExtraKey() *string { - if g == nil { - return nil - } - return g.PrimaryExtraKey -} - -func (g *GetSearchResultsMetadata) GetRatingImage() *string { - if g == nil { - return nil - } - return g.RatingImage -} - -func (g *GetSearchResultsMetadata) GetMedia() []GetSearchResultsMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetSearchResultsMetadata) GetGenre() []GetSearchResultsGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetSearchResultsMetadata) GetDirector() []GetSearchResultsDirector { - if g == nil { - return nil - } - return g.Director -} - -func (g *GetSearchResultsMetadata) GetWriter() []GetSearchResultsWriter { - if g == nil { - return nil - } - return g.Writer -} - -func (g *GetSearchResultsMetadata) GetCountry() []GetSearchResultsCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetSearchResultsMetadata) GetRole() []GetSearchResultsRole { - if g == nil { - return nil - } - return g.Role -} - -type Provider struct { - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` -} - -func (p *Provider) GetKey() *string { - if p == nil { - return nil - } - return p.Key -} - -func (p *Provider) GetTitle() *string { - if p == nil { - return nil - } - return p.Title -} - -func (p *Provider) GetType() *string { - if p == nil { - return nil - } - return p.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 (g *GetSearchResultsMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSearchResultsMediaContainer) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetSearchResultsMediaContainer) GetMediaTagPrefix() *string { - if g == nil { - return nil - } - return g.MediaTagPrefix -} - -func (g *GetSearchResultsMediaContainer) GetMediaTagVersion() *float64 { - if g == nil { - return nil - } - return g.MediaTagVersion -} - -func (g *GetSearchResultsMediaContainer) GetMetadata() []GetSearchResultsMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -func (g *GetSearchResultsMediaContainer) GetProvider() []Provider { - if g == nil { - return nil - } - return g.Provider -} - -// GetSearchResultsResponseBody - Search Results -type GetSearchResultsResponseBody struct { - MediaContainer *GetSearchResultsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetSearchResultsResponseBody) GetMediaContainer() *GetSearchResultsMediaContainer { - if g == nil { - return nil - } - return g.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 (g *GetSearchResultsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetSearchResultsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetSearchResultsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetSearchResultsResponse) GetObject() *GetSearchResultsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getsectionfilters.go b/models/operations/getsectionfilters.go new file mode 100644 index 0000000..3e8860d --- /dev/null +++ b/models/operations/getsectionfilters.go @@ -0,0 +1,345 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSectionFiltersGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSectionFiltersGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionFiltersGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSectionFiltersGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionFiltersGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionFiltersGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionFiltersGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionFiltersGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionFiltersGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionFiltersGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionFiltersGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionFiltersGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionFiltersGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionFiltersGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSectionFiltersRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (g GetSectionFiltersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionFiltersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetSectionFiltersRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionFiltersRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionFiltersRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionFiltersRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionFiltersRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionFiltersRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionFiltersRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionFiltersRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionFiltersRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionFiltersRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionFiltersRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSectionFiltersRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +// GetSectionFiltersMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetSectionFiltersMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []components.Directory `json:"Directory,omitempty"` +} + +func (g *GetSectionFiltersMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetSectionFiltersMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetSectionFiltersMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetSectionFiltersMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetSectionFiltersMediaContainer) GetDirectory() []components.Directory { + if g == nil { + return nil + } + return g.Directory +} + +// GetSectionFiltersResponseBody - The filters on the section +type GetSectionFiltersResponseBody struct { + MediaContainer *GetSectionFiltersMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetSectionFiltersResponseBody) GetMediaContainer() *GetSectionFiltersMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetSectionFiltersResponse 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 filters on the section + Object *GetSectionFiltersResponseBody +} + +func (g *GetSectionFiltersResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSectionFiltersResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSectionFiltersResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSectionFiltersResponse) GetObject() *GetSectionFiltersResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getsectionhubs.go b/models/operations/getsectionhubs.go new file mode 100644 index 0000000..1ce7618 --- /dev/null +++ b/models/operations/getsectionhubs.go @@ -0,0 +1,371 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSectionHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSectionHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSectionHubsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionHubsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionHubsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionHubsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionHubsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionHubsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionHubsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionHubsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionHubsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionHubsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionHubsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSectionHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to fetch + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Limit results to count items + Count *int64 `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 *components.BoolInt `queryParam:"style=form,explode=true,name=onlyTransient"` +} + +func (g GetSectionHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetSectionHubsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionHubsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionHubsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionHubsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionHubsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionHubsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionHubsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionHubsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionHubsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionHubsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionHubsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSectionHubsRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetSectionHubsRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetSectionHubsRequest) GetOnlyTransient() *components.BoolInt { + if g == nil { + return nil + } + return g.OnlyTransient +} + +// GetSectionHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetSectionHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (g *GetSectionHubsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetSectionHubsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetSectionHubsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetSectionHubsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetSectionHubsMediaContainer) GetHub() []components.Hub { + if g == nil { + return nil + } + return g.Hub +} + +// GetSectionHubsResponseBody - OK +type GetSectionHubsResponseBody struct { + MediaContainer *GetSectionHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetSectionHubsResponseBody) GetMediaContainer() *GetSectionHubsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetSectionHubsResponse 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 + // OK + Object *GetSectionHubsResponseBody + Headers map[string][]string +} + +func (g *GetSectionHubsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSectionHubsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSectionHubsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSectionHubsResponse) GetObject() *GetSectionHubsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetSectionHubsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getsectionimage.go b/models/operations/getsectionimage.go new file mode 100644 index 0000000..e2c4c0c --- /dev/null +++ b/models/operations/getsectionimage.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSectionImageGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSectionImageGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionImageGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSectionImageGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionImageGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionImageGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionImageGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionImageGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionImageGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionImageGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionImageGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionImageGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionImageGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionImageGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSectionImageRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The update time of the image. Used for busting cache. + UpdatedAt int64 `pathParam:"style=simple,explode=false,name=updatedAt"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` + Composite *components.Composite `queryParam:"style=form,explode=true,name=composite"` +} + +func (g GetSectionImageRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionImageRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId", "updatedAt"}); err != nil { + return err + } + return nil +} + +func (g *GetSectionImageRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionImageRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionImageRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionImageRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionImageRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionImageRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionImageRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionImageRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionImageRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionImageRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionImageRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSectionImageRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetSectionImageRequest) GetUpdatedAt() int64 { + if g == nil { + return 0 + } + return g.UpdatedAt +} + +func (g *GetSectionImageRequest) GetMediaQuery() *components.MediaQuery { + if g == nil { + return nil + } + return g.MediaQuery +} + +func (g *GetSectionImageRequest) GetComposite() *components.Composite { + if g == nil { + return nil + } + return g.Composite +} + +type GetSectionImageResponse 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 (g *GetSectionImageResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSectionImageResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSectionImageResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getsectionpreferences.go b/models/operations/getsectionpreferences.go new file mode 100644 index 0000000..8714f46 --- /dev/null +++ b/models/operations/getsectionpreferences.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSectionPreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSectionPreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionPreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSectionPreferencesGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionPreferencesGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionPreferencesGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionPreferencesGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionPreferencesGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionPreferencesGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionPreferencesGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionPreferencesGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionPreferencesGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionPreferencesGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionPreferencesGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSectionPreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + Agent *string `queryParam:"style=form,explode=true,name=agent"` +} + +func (g GetSectionPreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionPreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (g *GetSectionPreferencesRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionPreferencesRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionPreferencesRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionPreferencesRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionPreferencesRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionPreferencesRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionPreferencesRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionPreferencesRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionPreferencesRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionPreferencesRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionPreferencesRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSectionPreferencesRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetSectionPreferencesRequest) GetAgent() *string { + if g == nil { + return nil + } + return g.Agent +} + +type GetSectionPreferencesResponse 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 + // OK + MediaContainerWithSettings *components.MediaContainerWithSettings +} + +func (g *GetSectionPreferencesResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSectionPreferencesResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSectionPreferencesResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSectionPreferencesResponse) GetMediaContainerWithSettings() *components.MediaContainerWithSettings { + if g == nil { + return nil + } + return g.MediaContainerWithSettings +} diff --git a/models/operations/getsections.go b/models/operations/getsections.go new file mode 100644 index 0000000..f08c9e3 --- /dev/null +++ b/models/operations/getsections.go @@ -0,0 +1,134 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +// GetSectionsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetSectionsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Directory []components.LibrarySection `json:"Directory,omitempty"` + // Typically just "Plex Library" + Title1 *string `json:"title1,omitempty"` +} + +func (g *GetSectionsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetSectionsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetSectionsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetSectionsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetSectionsMediaContainer) GetAllowSync() *bool { + if g == nil { + return nil + } + return g.AllowSync +} + +func (g *GetSectionsMediaContainer) GetDirectory() []components.LibrarySection { + if g == nil { + return nil + } + return g.Directory +} + +func (g *GetSectionsMediaContainer) GetTitle1() *string { + if g == nil { + return nil + } + return g.Title1 +} + +// GetSectionsResponseBody - OK +type GetSectionsResponseBody struct { + MediaContainer *GetSectionsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetSectionsResponseBody) GetMediaContainer() *GetSectionsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetSectionsResponse 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 + // OK + Object *GetSectionsResponseBody + Headers map[string][]string +} + +func (g *GetSectionsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSectionsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSectionsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSectionsResponse) GetObject() *GetSectionsResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetSectionsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getsectionsprefs.go b/models/operations/getsectionsprefs.go new file mode 100644 index 0000000..c18b730 --- /dev/null +++ b/models/operations/getsectionsprefs.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSectionsPrefsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSectionsPrefsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionsPrefsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSectionsPrefsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionsPrefsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionsPrefsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionsPrefsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionsPrefsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionsPrefsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionsPrefsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionsPrefsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionsPrefsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionsPrefsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionsPrefsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSectionsPrefsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The metadata type + Type int64 `queryParam:"style=form,explode=true,name=type"` + // The metadata agent in use + Agent *string `queryParam:"style=form,explode=true,name=agent"` +} + +func (g GetSectionsPrefsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSectionsPrefsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type"}); err != nil { + return err + } + return nil +} + +func (g *GetSectionsPrefsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSectionsPrefsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSectionsPrefsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSectionsPrefsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSectionsPrefsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSectionsPrefsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSectionsPrefsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSectionsPrefsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSectionsPrefsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSectionsPrefsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSectionsPrefsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSectionsPrefsRequest) GetType() int64 { + if g == nil { + return 0 + } + return g.Type +} + +func (g *GetSectionsPrefsRequest) GetAgent() *string { + if g == nil { + return nil + } + return g.Agent +} + +type GetSectionsPrefsResponse 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 + // OK + RequestHandlerSlashGetResponses200 *components.RequestHandlerSlashGetResponses200 +} + +func (g *GetSectionsPrefsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSectionsPrefsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSectionsPrefsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSectionsPrefsResponse) GetRequestHandlerSlashGetResponses200() *components.RequestHandlerSlashGetResponses200 { + if g == nil { + return nil + } + return g.RequestHandlerSlashGetResponses200 +} diff --git a/models/operations/getserveractivities.go b/models/operations/getserveractivities.go deleted file mode 100644 index eaf81ff..0000000 --- a/models/operations/getserveractivities.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type Context struct { - LibrarySectionID *string `json:"librarySectionID,omitempty"` -} - -func (c *Context) GetLibrarySectionID() *string { - if c == nil { - return nil - } - return c.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 (a *Activity) GetUUID() *string { - if a == nil { - return nil - } - return a.UUID -} - -func (a *Activity) GetType() *string { - if a == nil { - return nil - } - return a.Type -} - -func (a *Activity) GetCancellable() *bool { - if a == nil { - return nil - } - return a.Cancellable -} - -func (a *Activity) GetUserID() *float64 { - if a == nil { - return nil - } - return a.UserID -} - -func (a *Activity) GetTitle() *string { - if a == nil { - return nil - } - return a.Title -} - -func (a *Activity) GetSubtitle() *string { - if a == nil { - return nil - } - return a.Subtitle -} - -func (a *Activity) GetProgress() *float64 { - if a == nil { - return nil - } - return a.Progress -} - -func (a *Activity) GetContext() *Context { - if a == nil { - return nil - } - return a.Context -} - -type GetServerActivitiesMediaContainer struct { - Size *float64 `json:"size,omitempty"` - Activity []Activity `json:"Activity,omitempty"` -} - -func (g *GetServerActivitiesMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetServerActivitiesMediaContainer) GetActivity() []Activity { - if g == nil { - return nil - } - return g.Activity -} - -// GetServerActivitiesResponseBody - The Server Activities -type GetServerActivitiesResponseBody struct { - MediaContainer *GetServerActivitiesMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetServerActivitiesResponseBody) GetMediaContainer() *GetServerActivitiesMediaContainer { - if g == nil { - return nil - } - return g.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 (g *GetServerActivitiesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetServerActivitiesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetServerActivitiesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetServerActivitiesResponse) GetObject() *GetServerActivitiesResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getservercapabilities.go b/models/operations/getservercapabilities.go deleted file mode 100644 index 0a1f178..0000000 --- a/models/operations/getservercapabilities.go +++ /dev/null @@ -1,496 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (d *Directory) GetCount() *float64 { - if d == nil { - return nil - } - return d.Count -} - -func (d *Directory) GetKey() *string { - if d == nil { - return nil - } - return d.Key -} - -func (d *Directory) GetTitle() *string { - if d == nil { - return nil - } - return d.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 (m *MediaContainer) GetSize() *float64 { - if m == nil { - return nil - } - return m.Size -} - -func (m *MediaContainer) GetAllowCameraUpload() *bool { - if m == nil { - return nil - } - return m.AllowCameraUpload -} - -func (m *MediaContainer) GetAllowChannelAccess() *bool { - if m == nil { - return nil - } - return m.AllowChannelAccess -} - -func (m *MediaContainer) GetAllowMediaDeletion() *bool { - if m == nil { - return nil - } - return m.AllowMediaDeletion -} - -func (m *MediaContainer) GetAllowSharing() *bool { - if m == nil { - return nil - } - return m.AllowSharing -} - -func (m *MediaContainer) GetAllowSync() *bool { - if m == nil { - return nil - } - return m.AllowSync -} - -func (m *MediaContainer) GetAllowTuners() *bool { - if m == nil { - return nil - } - return m.AllowTuners -} - -func (m *MediaContainer) GetBackgroundProcessing() *bool { - if m == nil { - return nil - } - return m.BackgroundProcessing -} - -func (m *MediaContainer) GetCertificate() *bool { - if m == nil { - return nil - } - return m.Certificate -} - -func (m *MediaContainer) GetCompanionProxy() *bool { - if m == nil { - return nil - } - return m.CompanionProxy -} - -func (m *MediaContainer) GetCountryCode() *string { - if m == nil { - return nil - } - return m.CountryCode -} - -func (m *MediaContainer) GetDiagnostics() *string { - if m == nil { - return nil - } - return m.Diagnostics -} - -func (m *MediaContainer) GetEventStream() *bool { - if m == nil { - return nil - } - return m.EventStream -} - -func (m *MediaContainer) GetFriendlyName() *string { - if m == nil { - return nil - } - return m.FriendlyName -} - -func (m *MediaContainer) GetHubSearch() *bool { - if m == nil { - return nil - } - return m.HubSearch -} - -func (m *MediaContainer) GetItemClusters() *bool { - if m == nil { - return nil - } - return m.ItemClusters -} - -func (m *MediaContainer) GetLivetv() *float64 { - if m == nil { - return nil - } - return m.Livetv -} - -func (m *MediaContainer) GetMachineIdentifier() *string { - if m == nil { - return nil - } - return m.MachineIdentifier -} - -func (m *MediaContainer) GetMediaProviders() *bool { - if m == nil { - return nil - } - return m.MediaProviders -} - -func (m *MediaContainer) GetMultiuser() *bool { - if m == nil { - return nil - } - return m.Multiuser -} - -func (m *MediaContainer) GetMusicAnalysis() *float64 { - if m == nil { - return nil - } - return m.MusicAnalysis -} - -func (m *MediaContainer) GetMyPlex() *bool { - if m == nil { - return nil - } - return m.MyPlex -} - -func (m *MediaContainer) GetMyPlexMappingState() *string { - if m == nil { - return nil - } - return m.MyPlexMappingState -} - -func (m *MediaContainer) GetMyPlexSigninState() *string { - if m == nil { - return nil - } - return m.MyPlexSigninState -} - -func (m *MediaContainer) GetMyPlexSubscription() *bool { - if m == nil { - return nil - } - return m.MyPlexSubscription -} - -func (m *MediaContainer) GetMyPlexUsername() *string { - if m == nil { - return nil - } - return m.MyPlexUsername -} - -func (m *MediaContainer) GetOfflineTranscode() *float64 { - if m == nil { - return nil - } - return m.OfflineTranscode -} - -func (m *MediaContainer) GetOwnerFeatures() *string { - if m == nil { - return nil - } - return m.OwnerFeatures -} - -func (m *MediaContainer) GetPhotoAutoTag() *bool { - if m == nil { - return nil - } - return m.PhotoAutoTag -} - -func (m *MediaContainer) GetPlatform() *string { - if m == nil { - return nil - } - return m.Platform -} - -func (m *MediaContainer) GetPlatformVersion() *string { - if m == nil { - return nil - } - return m.PlatformVersion -} - -func (m *MediaContainer) GetPluginHost() *bool { - if m == nil { - return nil - } - return m.PluginHost -} - -func (m *MediaContainer) GetPushNotifications() *bool { - if m == nil { - return nil - } - return m.PushNotifications -} - -func (m *MediaContainer) GetReadOnlyLibraries() *bool { - if m == nil { - return nil - } - return m.ReadOnlyLibraries -} - -func (m *MediaContainer) GetStreamingBrainABRVersion() *float64 { - if m == nil { - return nil - } - return m.StreamingBrainABRVersion -} - -func (m *MediaContainer) GetStreamingBrainVersion() *float64 { - if m == nil { - return nil - } - return m.StreamingBrainVersion -} - -func (m *MediaContainer) GetSync() *bool { - if m == nil { - return nil - } - return m.Sync -} - -func (m *MediaContainer) GetTranscoderActiveVideoSessions() *float64 { - if m == nil { - return nil - } - return m.TranscoderActiveVideoSessions -} - -func (m *MediaContainer) GetTranscoderAudio() *bool { - if m == nil { - return nil - } - return m.TranscoderAudio -} - -func (m *MediaContainer) GetTranscoderLyrics() *bool { - if m == nil { - return nil - } - return m.TranscoderLyrics -} - -func (m *MediaContainer) GetTranscoderPhoto() *bool { - if m == nil { - return nil - } - return m.TranscoderPhoto -} - -func (m *MediaContainer) GetTranscoderSubtitles() *bool { - if m == nil { - return nil - } - return m.TranscoderSubtitles -} - -func (m *MediaContainer) GetTranscoderVideo() *bool { - if m == nil { - return nil - } - return m.TranscoderVideo -} - -func (m *MediaContainer) GetTranscoderVideoBitrates() *string { - if m == nil { - return nil - } - return m.TranscoderVideoBitrates -} - -func (m *MediaContainer) GetTranscoderVideoQualities() *string { - if m == nil { - return nil - } - return m.TranscoderVideoQualities -} - -func (m *MediaContainer) GetTranscoderVideoResolutions() *string { - if m == nil { - return nil - } - return m.TranscoderVideoResolutions -} - -func (m *MediaContainer) GetUpdatedAt() *float64 { - if m == nil { - return nil - } - return m.UpdatedAt -} - -func (m *MediaContainer) GetUpdater() *bool { - if m == nil { - return nil - } - return m.Updater -} - -func (m *MediaContainer) GetVersion() *string { - if m == nil { - return nil - } - return m.Version -} - -func (m *MediaContainer) GetVoiceSearch() *bool { - if m == nil { - return nil - } - return m.VoiceSearch -} - -func (m *MediaContainer) GetDirectory() []Directory { - if m == nil { - return nil - } - return m.Directory -} - -// GetServerCapabilitiesResponseBody - The Server Capabilities -type GetServerCapabilitiesResponseBody struct { - MediaContainer *MediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetServerCapabilitiesResponseBody) GetMediaContainer() *MediaContainer { - if g == nil { - return nil - } - return g.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 (g *GetServerCapabilitiesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetServerCapabilitiesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetServerCapabilitiesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetServerCapabilitiesResponse) GetObject() *GetServerCapabilitiesResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getserveridentity.go b/models/operations/getserveridentity.go deleted file mode 100644 index 0326c24..0000000 --- a/models/operations/getserveridentity.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (g *GetServerIdentityMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetServerIdentityMediaContainer) GetClaimed() *bool { - if g == nil { - return nil - } - return g.Claimed -} - -func (g *GetServerIdentityMediaContainer) GetMachineIdentifier() *string { - if g == nil { - return nil - } - return g.MachineIdentifier -} - -func (g *GetServerIdentityMediaContainer) GetVersion() *string { - if g == nil { - return nil - } - return g.Version -} - -// GetServerIdentityResponseBody - The Server Identity information -type GetServerIdentityResponseBody struct { - MediaContainer *GetServerIdentityMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetServerIdentityResponseBody) GetMediaContainer() *GetServerIdentityMediaContainer { - if g == nil { - return nil - } - return g.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 Server Identity information - Object *GetServerIdentityResponseBody -} - -func (g *GetServerIdentityResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetServerIdentityResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetServerIdentityResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetServerIdentityResponse) GetObject() *GetServerIdentityResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getserverinfo.go b/models/operations/getserverinfo.go new file mode 100644 index 0000000..1017f76 --- /dev/null +++ b/models/operations/getserverinfo.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetServerInfoGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetServerInfoGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetServerInfoGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetServerInfoGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetServerInfoGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetServerInfoGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetServerInfoGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetServerInfoGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetServerInfoGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetServerInfoGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetServerInfoGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetServerInfoGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetServerInfoGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetServerInfoGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetServerInfoRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetServerInfoRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetServerInfoRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetServerInfoRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetServerInfoRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetServerInfoRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetServerInfoRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetServerInfoRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetServerInfoRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetServerInfoRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetServerInfoRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetServerInfoRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetServerInfoRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetServerInfoRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetServerInfoResponse 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 + // OK + MediaContainerWithDirectory *components.MediaContainerWithDirectory +} + +func (g *GetServerInfoResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetServerInfoResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetServerInfoResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetServerInfoResponse) GetMediaContainerWithDirectory() *components.MediaContainerWithDirectory { + if g == nil { + return nil + } + return g.MediaContainerWithDirectory +} diff --git a/models/operations/getserverlist.go b/models/operations/getserverlist.go deleted file mode 100644 index e49d153..0000000 --- a/models/operations/getserverlist.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (g *GetServerListServer) GetName() *string { - if g == nil { - return nil - } - return g.Name -} - -func (g *GetServerListServer) GetHost() *string { - if g == nil { - return nil - } - return g.Host -} - -func (g *GetServerListServer) GetAddress() *string { - if g == nil { - return nil - } - return g.Address -} - -func (g *GetServerListServer) GetPort() *float64 { - if g == nil { - return nil - } - return g.Port -} - -func (g *GetServerListServer) GetMachineIdentifier() *string { - if g == nil { - return nil - } - return g.MachineIdentifier -} - -func (g *GetServerListServer) GetVersion() *string { - if g == nil { - return nil - } - return g.Version -} - -type GetServerListMediaContainer struct { - Size *float64 `json:"size,omitempty"` - Server []GetServerListServer `json:"Server,omitempty"` -} - -func (g *GetServerListMediaContainer) GetSize() *float64 { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetServerListMediaContainer) GetServer() []GetServerListServer { - if g == nil { - return nil - } - return g.Server -} - -// GetServerListResponseBody - List of Servers -type GetServerListResponseBody struct { - MediaContainer *GetServerListMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetServerListResponseBody) GetMediaContainer() *GetServerListMediaContainer { - if g == nil { - return nil - } - return g.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 (g *GetServerListResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetServerListResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetServerListResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetServerListResponse) GetObject() *GetServerListResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getserverpreferences.go b/models/operations/getserverpreferences.go deleted file mode 100644 index 9bde4d7..0000000 --- a/models/operations/getserverpreferences.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type Setting struct { - ID *string `json:"id,omitempty"` - Label *string `json:"label,omitempty"` - Summary *string `json:"summary,omitempty"` - Type *string `json:"type,omitempty"` - Default *bool `json:"default,omitempty"` - Value *bool `json:"value,omitempty"` - Hidden *bool `json:"hidden,omitempty"` - Advanced *bool `json:"advanced,omitempty"` - Group *string `json:"group,omitempty"` - EnumValues *string `json:"enumValues,omitempty"` -} - -func (s *Setting) GetID() *string { - if s == nil { - return nil - } - return s.ID -} - -func (s *Setting) GetLabel() *string { - if s == nil { - return nil - } - return s.Label -} - -func (s *Setting) GetSummary() *string { - if s == nil { - return nil - } - return s.Summary -} - -func (s *Setting) GetType() *string { - if s == nil { - return nil - } - return s.Type -} - -func (s *Setting) GetDefault() *bool { - if s == nil { - return nil - } - return s.Default -} - -func (s *Setting) GetValue() *bool { - if s == nil { - return nil - } - return s.Value -} - -func (s *Setting) GetHidden() *bool { - if s == nil { - return nil - } - return s.Hidden -} - -func (s *Setting) GetAdvanced() *bool { - if s == nil { - return nil - } - return s.Advanced -} - -func (s *Setting) GetGroup() *string { - if s == nil { - return nil - } - return s.Group -} - -func (s *Setting) GetEnumValues() *string { - if s == nil { - return nil - } - return s.EnumValues -} - -type GetServerPreferencesMediaContainer struct { - Size *int `json:"size,omitempty"` - Setting []Setting `json:"Setting,omitempty"` -} - -func (g *GetServerPreferencesMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetServerPreferencesMediaContainer) GetSetting() []Setting { - if g == nil { - return nil - } - return g.Setting -} - -// GetServerPreferencesResponseBody - Server Preferences -type GetServerPreferencesResponseBody struct { - MediaContainer *GetServerPreferencesMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetServerPreferencesResponseBody) GetMediaContainer() *GetServerPreferencesMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // Server Preferences - Object *GetServerPreferencesResponseBody -} - -func (g *GetServerPreferencesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetServerPreferencesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetServerPreferencesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetServerPreferencesResponse) GetObject() *GetServerPreferencesResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getserverresources.go b/models/operations/getserverresources.go deleted file mode 100644 index bb7ffef..0000000 --- a/models/operations/getserverresources.go +++ /dev/null @@ -1,488 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" - "time" -) - -var GetServerResourcesServerList = []string{ - "https://plex.tv/api/v2", -} - -// IncludeHTTPS - Include Https entries in the results -type IncludeHTTPS int - -const ( - IncludeHTTPSDisable IncludeHTTPS = 0 - IncludeHTTPSEnable IncludeHTTPS = 1 -) - -func (e IncludeHTTPS) ToPointer() *IncludeHTTPS { - return &e -} -func (e *IncludeHTTPS) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeHTTPS(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeHTTPS: %v", v) - } -} - -// IncludeRelay - Include Relay addresses in the results -// E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 -type IncludeRelay int - -const ( - IncludeRelayDisable IncludeRelay = 0 - IncludeRelayEnable IncludeRelay = 1 -) - -func (e IncludeRelay) ToPointer() *IncludeRelay { - return &e -} -func (e *IncludeRelay) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeRelay(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeRelay: %v", v) - } -} - -// IncludeIPv6 - Include IPv6 entries in the results -type IncludeIPv6 int - -const ( - IncludeIPv6Disable IncludeIPv6 = 0 - IncludeIPv6Enable IncludeIPv6 = 1 -) - -func (e IncludeIPv6) ToPointer() *IncludeIPv6 { - return &e -} -func (e *IncludeIPv6) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = IncludeIPv6(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeIPv6: %v", v) - } -} - -type GetServerResourcesRequest struct { - // Include Https entries in the results - IncludeHTTPS *IncludeHTTPS `default:"0" queryParam:"style=form,explode=true,name=includeHttps"` - // Include Relay addresses in the results - // E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 - // - IncludeRelay *IncludeRelay `default:"0" queryParam:"style=form,explode=true,name=includeRelay"` - // Include IPv6 entries in the results - IncludeIPv6 *IncludeIPv6 `default:"0" queryParam:"style=form,explode=true,name=includeIPv6"` - // An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` -} - -func (g GetServerResourcesRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetServerResourcesRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"X-Plex-Client-Identifier"}); err != nil { - return err - } - return nil -} - -func (g *GetServerResourcesRequest) GetIncludeHTTPS() *IncludeHTTPS { - if g == nil { - return nil - } - return g.IncludeHTTPS -} - -func (g *GetServerResourcesRequest) GetIncludeRelay() *IncludeRelay { - if g == nil { - return nil - } - return g.IncludeRelay -} - -func (g *GetServerResourcesRequest) GetIncludeIPv6() *IncludeIPv6 { - if g == nil { - return nil - } - return g.IncludeIPv6 -} - -func (g *GetServerResourcesRequest) GetClientID() string { - if g == nil { - return "" - } - return g.ClientID -} - -// Protocol - The protocol used for the connection (http, https, etc) -type Protocol string - -const ( - ProtocolHTTP Protocol = "http" - ProtocolHTTPS Protocol = "https" -) - -func (e Protocol) ToPointer() *Protocol { - return &e -} -func (e *Protocol) 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 = Protocol(v) - return nil - default: - return fmt.Errorf("invalid value for Protocol: %v", v) - } -} - -type Connections struct { - // The protocol used for the connection (http, https, etc) - Protocol Protocol `json:"protocol"` - // The (ip) address or domain name used for the connection - Address string `json:"address"` - // The port used for the connection - Port int `json:"port"` - // The full URI of the connection - URI string `json:"uri"` - // If the connection is local address - Local bool `json:"local"` - // If the connection is relayed through plex.direct - Relay bool `json:"relay"` - // If the connection is using IPv6 - IPv6 bool `json:"IPv6"` -} - -func (c *Connections) GetProtocol() Protocol { - if c == nil { - return Protocol("") - } - return c.Protocol -} - -func (c *Connections) GetAddress() string { - if c == nil { - return "" - } - return c.Address -} - -func (c *Connections) GetPort() int { - if c == nil { - return 0 - } - return c.Port -} - -func (c *Connections) GetURI() string { - if c == nil { - return "" - } - return c.URI -} - -func (c *Connections) GetLocal() bool { - if c == nil { - return false - } - return c.Local -} - -func (c *Connections) GetRelay() bool { - if c == nil { - return false - } - return c.Relay -} - -func (c *Connections) GetIPv6() bool { - if c == nil { - return false - } - return c.IPv6 -} - -type PlexDevice struct { - Name string `json:"name"` - Product string `json:"product"` - ProductVersion string `json:"productVersion"` - Platform *string `json:"platform"` - PlatformVersion *string `json:"platformVersion"` - Device *string `json:"device"` - ClientIdentifier string `json:"clientIdentifier"` - CreatedAt time.Time `json:"createdAt"` - LastSeenAt time.Time `json:"lastSeenAt"` - Provides string `json:"provides"` - // ownerId is null when the device is owned by the token used to send the request - OwnerID *int64 `json:"ownerId"` - SourceTitle *string `json:"sourceTitle"` - PublicAddress string `json:"publicAddress"` - AccessToken string `json:"accessToken"` - Owned bool `json:"owned"` - Home bool `json:"home"` - Synced bool `json:"synced"` - Relay bool `json:"relay"` - Presence bool `json:"presence"` - HTTPSRequired bool `json:"httpsRequired"` - PublicAddressMatches bool `json:"publicAddressMatches"` - DNSRebindingProtection bool `json:"dnsRebindingProtection"` - NatLoopbackSupported bool `json:"natLoopbackSupported"` - Connections []Connections `json:"connections"` -} - -func (p PlexDevice) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PlexDevice) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"name", "product", "productVersion", "clientIdentifier", "createdAt", "lastSeenAt", "provides", "publicAddress", "accessToken", "owned", "home", "synced", "relay", "presence", "httpsRequired", "publicAddressMatches", "dnsRebindingProtection", "natLoopbackSupported", "connections"}); err != nil { - return err - } - return nil -} - -func (p *PlexDevice) GetName() string { - if p == nil { - return "" - } - return p.Name -} - -func (p *PlexDevice) GetProduct() string { - if p == nil { - return "" - } - return p.Product -} - -func (p *PlexDevice) GetProductVersion() string { - if p == nil { - return "" - } - return p.ProductVersion -} - -func (p *PlexDevice) GetPlatform() *string { - if p == nil { - return nil - } - return p.Platform -} - -func (p *PlexDevice) GetPlatformVersion() *string { - if p == nil { - return nil - } - return p.PlatformVersion -} - -func (p *PlexDevice) GetDevice() *string { - if p == nil { - return nil - } - return p.Device -} - -func (p *PlexDevice) GetClientIdentifier() string { - if p == nil { - return "" - } - return p.ClientIdentifier -} - -func (p *PlexDevice) GetCreatedAt() time.Time { - if p == nil { - return time.Time{} - } - return p.CreatedAt -} - -func (p *PlexDevice) GetLastSeenAt() time.Time { - if p == nil { - return time.Time{} - } - return p.LastSeenAt -} - -func (p *PlexDevice) GetProvides() string { - if p == nil { - return "" - } - return p.Provides -} - -func (p *PlexDevice) GetOwnerID() *int64 { - if p == nil { - return nil - } - return p.OwnerID -} - -func (p *PlexDevice) GetSourceTitle() *string { - if p == nil { - return nil - } - return p.SourceTitle -} - -func (p *PlexDevice) GetPublicAddress() string { - if p == nil { - return "" - } - return p.PublicAddress -} - -func (p *PlexDevice) GetAccessToken() string { - if p == nil { - return "" - } - return p.AccessToken -} - -func (p *PlexDevice) GetOwned() bool { - if p == nil { - return false - } - return p.Owned -} - -func (p *PlexDevice) GetHome() bool { - if p == nil { - return false - } - return p.Home -} - -func (p *PlexDevice) GetSynced() bool { - if p == nil { - return false - } - return p.Synced -} - -func (p *PlexDevice) GetRelay() bool { - if p == nil { - return false - } - return p.Relay -} - -func (p *PlexDevice) GetPresence() bool { - if p == nil { - return false - } - return p.Presence -} - -func (p *PlexDevice) GetHTTPSRequired() bool { - if p == nil { - return false - } - return p.HTTPSRequired -} - -func (p *PlexDevice) GetPublicAddressMatches() bool { - if p == nil { - return false - } - return p.PublicAddressMatches -} - -func (p *PlexDevice) GetDNSRebindingProtection() bool { - if p == nil { - return false - } - return p.DNSRebindingProtection -} - -func (p *PlexDevice) GetNatLoopbackSupported() bool { - if p == nil { - return false - } - return p.NatLoopbackSupported -} - -func (p *PlexDevice) GetConnections() []Connections { - if p == nil { - return []Connections{} - } - return p.Connections -} - -type GetServerResourcesResponse 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 Plex Devices. This includes Plex hosted servers and clients - PlexDevices []PlexDevice -} - -func (g *GetServerResourcesResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetServerResourcesResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetServerResourcesResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetServerResourcesResponse) GetPlexDevices() []PlexDevice { - if g == nil { - return nil - } - return g.PlexDevices -} diff --git a/models/operations/getsessionhistory.go b/models/operations/getsessionhistory.go deleted file mode 100644 index 6617223..0000000 --- a/models/operations/getsessionhistory.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -// QueryParamFilter - Filters content by field and direction/equality -// (Unknown if viewedAt is the only supported column) -type QueryParamFilter struct { -} - -type GetSessionHistoryRequest struct { - // Sorts the results by the specified field followed by the direction (asc, desc) - // - Sort *string `queryParam:"style=form,explode=true,name=sort"` - // Filter results by those that are related to a specific users id - // - AccountID *int64 `queryParam:"style=form,explode=true,name=accountId"` - // Filters content by field and direction/equality - // (Unknown if viewedAt is the only supported column) - // - Filter *QueryParamFilter `queryParam:"style=form,explode=true,name=filter"` - // Filters the results based on the id of a valid library section - // - LibrarySectionID *int64 `queryParam:"style=form,explode=true,name=librarySectionID"` -} - -func (g *GetSessionHistoryRequest) GetSort() *string { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetSessionHistoryRequest) GetAccountID() *int64 { - if g == nil { - return nil - } - return g.AccountID -} - -func (g *GetSessionHistoryRequest) GetFilter() *QueryParamFilter { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetSessionHistoryRequest) GetLibrarySectionID() *int64 { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -type GetSessionHistoryMetadata struct { - HistoryKey *string `json:"historyKey,omitempty"` - Key *string `json:"key,omitempty"` - RatingKey *string `json:"ratingKey,omitempty"` - LibrarySectionID *string `json:"librarySectionID,omitempty"` - ParentKey *string `json:"parentKey,omitempty"` - GrandparentKey *string `json:"grandparentKey,omitempty"` - Title *string `json:"title,omitempty"` - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - Type *string `json:"type,omitempty"` - Thumb *string `json:"thumb,omitempty"` - ParentThumb *string `json:"parentThumb,omitempty"` - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - GrandparentArt *string `json:"grandparentArt,omitempty"` - Index *int `json:"index,omitempty"` - ParentIndex *int `json:"parentIndex,omitempty"` - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - ViewedAt *int `json:"viewedAt,omitempty"` - AccountID *int `json:"accountID,omitempty"` - DeviceID *int `json:"deviceID,omitempty"` -} - -func (g GetSessionHistoryMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSessionHistoryMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetSessionHistoryMetadata) GetHistoryKey() *string { - if g == nil { - return nil - } - return g.HistoryKey -} - -func (g *GetSessionHistoryMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSessionHistoryMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetSessionHistoryMetadata) GetLibrarySectionID() *string { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetSessionHistoryMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetSessionHistoryMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetSessionHistoryMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetSessionHistoryMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetSessionHistoryMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetSessionHistoryMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSessionHistoryMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetSessionHistoryMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetSessionHistoryMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetSessionHistoryMetadata) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetSessionHistoryMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetSessionHistoryMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetSessionHistoryMetadata) GetViewedAt() *int { - if g == nil { - return nil - } - return g.ViewedAt -} - -func (g *GetSessionHistoryMetadata) GetAccountID() *int { - if g == nil { - return nil - } - return g.AccountID -} - -func (g *GetSessionHistoryMetadata) GetDeviceID() *int { - if g == nil { - return nil - } - return g.DeviceID -} - -type GetSessionHistoryMediaContainer struct { - Size *int `json:"size,omitempty"` - Metadata []GetSessionHistoryMetadata `json:"Metadata,omitempty"` -} - -func (g *GetSessionHistoryMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSessionHistoryMediaContainer) GetMetadata() []GetSessionHistoryMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetSessionHistoryResponseBody - List of Plex Sessions -type GetSessionHistoryResponseBody struct { - MediaContainer *GetSessionHistoryMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetSessionHistoryResponseBody) GetMediaContainer() *GetSessionHistoryMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // List of Plex Sessions - Object *GetSessionHistoryResponseBody -} - -func (g *GetSessionHistoryResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetSessionHistoryResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetSessionHistoryResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetSessionHistoryResponse) GetObject() *GetSessionHistoryResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getsessionplaylistindex.go b/models/operations/getsessionplaylistindex.go new file mode 100644 index 0000000..2895767 --- /dev/null +++ b/models/operations/getsessionplaylistindex.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSessionPlaylistIndexGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSessionPlaylistIndexGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSessionPlaylistIndexGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSessionPlaylistIndexGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSessionPlaylistIndexGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSessionPlaylistIndexGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSessionPlaylistIndexGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSessionPlaylistIndexGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSessionPlaylistIndexGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSessionPlaylistIndexGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSessionPlaylistIndexGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSessionPlaylistIndexGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSessionPlaylistIndexGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSessionPlaylistIndexGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSessionPlaylistIndexRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The session id + SessionID string `pathParam:"style=simple,explode=false,name=sessionId"` + // The consumer id + ConsumerID string `pathParam:"style=simple,explode=false,name=consumerId"` +} + +func (g GetSessionPlaylistIndexRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSessionPlaylistIndexRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sessionId", "consumerId"}); err != nil { + return err + } + return nil +} + +func (g *GetSessionPlaylistIndexRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSessionPlaylistIndexRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSessionPlaylistIndexRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSessionPlaylistIndexRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSessionPlaylistIndexRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSessionPlaylistIndexRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSessionPlaylistIndexRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSessionPlaylistIndexRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSessionPlaylistIndexRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSessionPlaylistIndexRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSessionPlaylistIndexRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSessionPlaylistIndexRequest) GetSessionID() string { + if g == nil { + return "" + } + return g.SessionID +} + +func (g *GetSessionPlaylistIndexRequest) GetConsumerID() string { + if g == nil { + return "" + } + return g.ConsumerID +} + +type GetSessionPlaylistIndexResponse 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 (g *GetSessionPlaylistIndexResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSessionPlaylistIndexResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSessionPlaylistIndexResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getsessions.go b/models/operations/getsessions.go index 4a08e1d..c0413a4 100644 --- a/models/operations/getsessions.go +++ b/models/operations/getsessions.go @@ -3,838 +3,10 @@ package operations import ( + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -type GetSessionsStream struct { - AlbumGain *string `json:"albumGain,omitempty"` - AlbumPeak *string `json:"albumPeak,omitempty"` - AlbumRange *string `json:"albumRange,omitempty"` - AudioChannelLayout *string `json:"audioChannelLayout,omitempty"` - BitDepth *int `json:"bitDepth,omitempty"` - Bitrate *int `json:"bitrate,omitempty"` - Channels *int `json:"channels,omitempty"` - Codec *string `json:"codec,omitempty"` - DisplayTitle *string `json:"displayTitle,omitempty"` - ExtendedDisplayTitle *string `json:"extendedDisplayTitle,omitempty"` - Gain *string `json:"gain,omitempty"` - ID *string `json:"id,omitempty"` - Index *int `json:"index,omitempty"` - Loudness *string `json:"loudness,omitempty"` - Lra *string `json:"lra,omitempty"` - Peak *string `json:"peak,omitempty"` - SamplingRate *int `json:"samplingRate,omitempty"` - Selected *bool `json:"selected,omitempty"` - StreamType *int `json:"streamType,omitempty"` - Location *string `json:"location,omitempty"` -} - -func (g *GetSessionsStream) GetAlbumGain() *string { - if g == nil { - return nil - } - return g.AlbumGain -} - -func (g *GetSessionsStream) GetAlbumPeak() *string { - if g == nil { - return nil - } - return g.AlbumPeak -} - -func (g *GetSessionsStream) GetAlbumRange() *string { - if g == nil { - return nil - } - return g.AlbumRange -} - -func (g *GetSessionsStream) GetAudioChannelLayout() *string { - if g == nil { - return nil - } - return g.AudioChannelLayout -} - -func (g *GetSessionsStream) GetBitDepth() *int { - if g == nil { - return nil - } - return g.BitDepth -} - -func (g *GetSessionsStream) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetSessionsStream) GetChannels() *int { - if g == nil { - return nil - } - return g.Channels -} - -func (g *GetSessionsStream) GetCodec() *string { - if g == nil { - return nil - } - return g.Codec -} - -func (g *GetSessionsStream) GetDisplayTitle() *string { - if g == nil { - return nil - } - return g.DisplayTitle -} - -func (g *GetSessionsStream) GetExtendedDisplayTitle() *string { - if g == nil { - return nil - } - return g.ExtendedDisplayTitle -} - -func (g *GetSessionsStream) GetGain() *string { - if g == nil { - return nil - } - return g.Gain -} - -func (g *GetSessionsStream) GetID() *string { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetSessionsStream) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetSessionsStream) GetLoudness() *string { - if g == nil { - return nil - } - return g.Loudness -} - -func (g *GetSessionsStream) GetLra() *string { - if g == nil { - return nil - } - return g.Lra -} - -func (g *GetSessionsStream) GetPeak() *string { - if g == nil { - return nil - } - return g.Peak -} - -func (g *GetSessionsStream) GetSamplingRate() *int { - if g == nil { - return nil - } - return g.SamplingRate -} - -func (g *GetSessionsStream) GetSelected() *bool { - if g == nil { - return nil - } - return g.Selected -} - -func (g *GetSessionsStream) GetStreamType() *int { - if g == nil { - return nil - } - return g.StreamType -} - -func (g *GetSessionsStream) GetLocation() *string { - if g == nil { - return nil - } - return g.Location -} - -type GetSessionsPart struct { - Container *string `json:"container,omitempty"` - Duration *int `json:"duration,omitempty"` - File *string `json:"file,omitempty"` - HasThumbnail *string `json:"hasThumbnail,omitempty"` - ID *string `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Size *int `json:"size,omitempty"` - Decision *string `json:"decision,omitempty"` - Selected *bool `json:"selected,omitempty"` - Stream []GetSessionsStream `json:"Stream,omitempty"` -} - -func (g *GetSessionsPart) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetSessionsPart) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSessionsPart) GetFile() *string { - if g == nil { - return nil - } - return g.File -} - -func (g *GetSessionsPart) GetHasThumbnail() *string { - if g == nil { - return nil - } - return g.HasThumbnail -} - -func (g *GetSessionsPart) GetID() *string { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetSessionsPart) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSessionsPart) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSessionsPart) GetDecision() *string { - if g == nil { - return nil - } - return g.Decision -} - -func (g *GetSessionsPart) GetSelected() *bool { - if g == nil { - return nil - } - return g.Selected -} - -func (g *GetSessionsPart) GetStream() []GetSessionsStream { - if g == nil { - return nil - } - return g.Stream -} - -type GetSessionsMedia struct { - AudioChannels *int `json:"audioChannels,omitempty"` - AudioCodec *string `json:"audioCodec,omitempty"` - Bitrate *int `json:"bitrate,omitempty"` - Container *string `json:"container,omitempty"` - Duration *int `json:"duration,omitempty"` - ID *string `json:"id,omitempty"` - Selected *bool `json:"selected,omitempty"` - Part []GetSessionsPart `json:"Part,omitempty"` -} - -func (g *GetSessionsMedia) GetAudioChannels() *int { - if g == nil { - return nil - } - return g.AudioChannels -} - -func (g *GetSessionsMedia) GetAudioCodec() *string { - if g == nil { - return nil - } - return g.AudioCodec -} - -func (g *GetSessionsMedia) GetBitrate() *int { - if g == nil { - return nil - } - return g.Bitrate -} - -func (g *GetSessionsMedia) GetContainer() *string { - if g == nil { - return nil - } - return g.Container -} - -func (g *GetSessionsMedia) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSessionsMedia) GetID() *string { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetSessionsMedia) GetSelected() *bool { - if g == nil { - return nil - } - return g.Selected -} - -func (g *GetSessionsMedia) GetPart() []GetSessionsPart { - if g == nil { - return nil - } - return g.Part -} - -type GetSessionsUser struct { - ID *string `json:"id,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (g *GetSessionsUser) GetID() *string { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetSessionsUser) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSessionsUser) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -type Player struct { - Address *string `json:"address,omitempty"` - MachineIdentifier *string `json:"machineIdentifier,omitempty"` - Model *string `json:"model,omitempty"` - Platform *string `json:"platform,omitempty"` - PlatformVersion *string `json:"platformVersion,omitempty"` - Product *string `json:"product,omitempty"` - Profile *string `json:"profile,omitempty"` - RemotePublicAddress *string `json:"remotePublicAddress,omitempty"` - State *string `json:"state,omitempty"` - Title *string `json:"title,omitempty"` - Version *string `json:"version,omitempty"` - Local *bool `json:"local,omitempty"` - Relayed *bool `json:"relayed,omitempty"` - Secure *bool `json:"secure,omitempty"` - UserID *int `json:"userID,omitempty"` -} - -func (p *Player) GetAddress() *string { - if p == nil { - return nil - } - return p.Address -} - -func (p *Player) GetMachineIdentifier() *string { - if p == nil { - return nil - } - return p.MachineIdentifier -} - -func (p *Player) GetModel() *string { - if p == nil { - return nil - } - return p.Model -} - -func (p *Player) GetPlatform() *string { - if p == nil { - return nil - } - return p.Platform -} - -func (p *Player) GetPlatformVersion() *string { - if p == nil { - return nil - } - return p.PlatformVersion -} - -func (p *Player) GetProduct() *string { - if p == nil { - return nil - } - return p.Product -} - -func (p *Player) GetProfile() *string { - if p == nil { - return nil - } - return p.Profile -} - -func (p *Player) GetRemotePublicAddress() *string { - if p == nil { - return nil - } - return p.RemotePublicAddress -} - -func (p *Player) GetState() *string { - if p == nil { - return nil - } - return p.State -} - -func (p *Player) GetTitle() *string { - if p == nil { - return nil - } - return p.Title -} - -func (p *Player) GetVersion() *string { - if p == nil { - return nil - } - return p.Version -} - -func (p *Player) GetLocal() *bool { - if p == nil { - return nil - } - return p.Local -} - -func (p *Player) GetRelayed() *bool { - if p == nil { - return nil - } - return p.Relayed -} - -func (p *Player) GetSecure() *bool { - if p == nil { - return nil - } - return p.Secure -} - -func (p *Player) GetUserID() *int { - if p == nil { - return nil - } - return p.UserID -} - -type Session struct { - ID *string `json:"id,omitempty"` - Bandwidth *int `json:"bandwidth,omitempty"` - Location *string `json:"location,omitempty"` -} - -func (s *Session) GetID() *string { - if s == nil { - return nil - } - return s.ID -} - -func (s *Session) GetBandwidth() *int { - if s == nil { - return nil - } - return s.Bandwidth -} - -func (s *Session) GetLocation() *string { - if s == nil { - return nil - } - return s.Location -} - -type GetSessionsMetadata struct { - AddedAt *int `json:"addedAt,omitempty"` - Art *string `json:"art,omitempty"` - Duration *int `json:"duration,omitempty"` - GrandparentArt *string `json:"grandparentArt,omitempty"` - GrandparentGUID *string `json:"grandparentGuid,omitempty"` - GrandparentKey *string `json:"grandparentKey,omitempty"` - GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` - GrandparentThumb *string `json:"grandparentThumb,omitempty"` - GrandparentTitle *string `json:"grandparentTitle,omitempty"` - GUID *string `json:"guid,omitempty"` - Index *int `json:"index,omitempty"` - Key *string `json:"key,omitempty"` - LibrarySectionID *string `json:"librarySectionID,omitempty"` - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - MusicAnalysisVersion *string `json:"musicAnalysisVersion,omitempty"` - // The original untranslated name of the media item when non-english, or the track artist if an audio Item has an album artist - OriginalTitle *string `json:"originalTitle,omitempty"` - ParentGUID *string `json:"parentGuid,omitempty"` - ParentIndex *int `json:"parentIndex,omitempty"` - ParentKey *string `json:"parentKey,omitempty"` - ParentRatingKey *string `json:"parentRatingKey,omitempty"` - ParentStudio *string `json:"parentStudio,omitempty"` - ParentThumb *string `json:"parentThumb,omitempty"` - ParentTitle *string `json:"parentTitle,omitempty"` - ParentYear *int `json:"parentYear,omitempty"` - RatingCount *int `json:"ratingCount,omitempty"` - RatingKey *string `json:"ratingKey,omitempty"` - SessionKey *string `json:"sessionKey,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Title *string `json:"title,omitempty"` - TitleSort *string `json:"titleSort,omitempty"` - Type *string `json:"type,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` - ViewOffset *int `json:"viewOffset,omitempty"` - Media []GetSessionsMedia `json:"Media,omitempty"` - User *GetSessionsUser `json:"User,omitempty"` - Player *Player `json:"Player,omitempty"` - Session *Session `json:"Session,omitempty"` -} - -func (g *GetSessionsMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetSessionsMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetSessionsMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetSessionsMetadata) GetGrandparentArt() *string { - if g == nil { - return nil - } - return g.GrandparentArt -} - -func (g *GetSessionsMetadata) GetGrandparentGUID() *string { - if g == nil { - return nil - } - return g.GrandparentGUID -} - -func (g *GetSessionsMetadata) GetGrandparentKey() *string { - if g == nil { - return nil - } - return g.GrandparentKey -} - -func (g *GetSessionsMetadata) GetGrandparentRatingKey() *string { - if g == nil { - return nil - } - return g.GrandparentRatingKey -} - -func (g *GetSessionsMetadata) GetGrandparentThumb() *string { - if g == nil { - return nil - } - return g.GrandparentThumb -} - -func (g *GetSessionsMetadata) GetGrandparentTitle() *string { - if g == nil { - return nil - } - return g.GrandparentTitle -} - -func (g *GetSessionsMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetSessionsMetadata) GetIndex() *int { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetSessionsMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetSessionsMetadata) GetLibrarySectionID() *string { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetSessionsMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetSessionsMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetSessionsMetadata) GetMusicAnalysisVersion() *string { - if g == nil { - return nil - } - return g.MusicAnalysisVersion -} - -func (g *GetSessionsMetadata) GetOriginalTitle() *string { - if g == nil { - return nil - } - return g.OriginalTitle -} - -func (g *GetSessionsMetadata) GetParentGUID() *string { - if g == nil { - return nil - } - return g.ParentGUID -} - -func (g *GetSessionsMetadata) GetParentIndex() *int { - if g == nil { - return nil - } - return g.ParentIndex -} - -func (g *GetSessionsMetadata) GetParentKey() *string { - if g == nil { - return nil - } - return g.ParentKey -} - -func (g *GetSessionsMetadata) GetParentRatingKey() *string { - if g == nil { - return nil - } - return g.ParentRatingKey -} - -func (g *GetSessionsMetadata) GetParentStudio() *string { - if g == nil { - return nil - } - return g.ParentStudio -} - -func (g *GetSessionsMetadata) GetParentThumb() *string { - if g == nil { - return nil - } - return g.ParentThumb -} - -func (g *GetSessionsMetadata) GetParentTitle() *string { - if g == nil { - return nil - } - return g.ParentTitle -} - -func (g *GetSessionsMetadata) GetParentYear() *int { - if g == nil { - return nil - } - return g.ParentYear -} - -func (g *GetSessionsMetadata) GetRatingCount() *int { - if g == nil { - return nil - } - return g.RatingCount -} - -func (g *GetSessionsMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetSessionsMetadata) GetSessionKey() *string { - if g == nil { - return nil - } - return g.SessionKey -} - -func (g *GetSessionsMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetSessionsMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetSessionsMetadata) GetTitleSort() *string { - if g == nil { - return nil - } - return g.TitleSort -} - -func (g *GetSessionsMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetSessionsMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetSessionsMetadata) GetViewOffset() *int { - if g == nil { - return nil - } - return g.ViewOffset -} - -func (g *GetSessionsMetadata) GetMedia() []GetSessionsMedia { - if g == nil { - return nil - } - return g.Media -} - -func (g *GetSessionsMetadata) GetUser() *GetSessionsUser { - if g == nil { - return nil - } - return g.User -} - -func (g *GetSessionsMetadata) GetPlayer() *Player { - if g == nil { - return nil - } - return g.Player -} - -func (g *GetSessionsMetadata) GetSession() *Session { - if g == nil { - return nil - } - return g.Session -} - -type GetSessionsMediaContainer struct { - Size *int `json:"size,omitempty"` - Metadata []GetSessionsMetadata `json:"Metadata,omitempty"` -} - -func (g *GetSessionsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetSessionsMediaContainer) GetMetadata() []GetSessionsMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetSessionsResponseBody - List of Active Plex Sessions -type GetSessionsResponseBody struct { - MediaContainer *GetSessionsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetSessionsResponseBody) GetMediaContainer() *GetSessionsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - type GetSessionsResponse struct { // HTTP response content type for this operation ContentType string @@ -842,8 +14,9 @@ type GetSessionsResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response - // List of Active Plex Sessions - Object *GetSessionsResponseBody + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string } func (g *GetSessionsResponse) GetContentType() string { @@ -867,9 +40,16 @@ func (g *GetSessionsResponse) GetRawResponse() *http.Response { return g.RawResponse } -func (g *GetSessionsResponse) GetObject() *GetSessionsResponseBody { +func (g *GetSessionsResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { if g == nil { return nil } - return g.Object + return g.MediaContainerWithMetadata +} + +func (g *GetSessionsResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers } diff --git a/models/operations/getsessionsegment.go b/models/operations/getsessionsegment.go new file mode 100644 index 0000000..9d38376 --- /dev/null +++ b/models/operations/getsessionsegment.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSessionSegmentGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSessionSegmentGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSessionSegmentGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSessionSegmentGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSessionSegmentGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSessionSegmentGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSessionSegmentGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSessionSegmentGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSessionSegmentGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSessionSegmentGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSessionSegmentGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSessionSegmentGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSessionSegmentGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSessionSegmentGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSessionSegmentRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The session id + SessionID string `pathParam:"style=simple,explode=false,name=sessionId"` + // The consumer id + ConsumerID string `pathParam:"style=simple,explode=false,name=consumerId"` + // The segment id + SegmentID string `pathParam:"style=simple,explode=false,name=segmentId"` +} + +func (g GetSessionSegmentRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSessionSegmentRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sessionId", "consumerId", "segmentId"}); err != nil { + return err + } + return nil +} + +func (g *GetSessionSegmentRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSessionSegmentRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSessionSegmentRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSessionSegmentRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSessionSegmentRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSessionSegmentRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSessionSegmentRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSessionSegmentRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSessionSegmentRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSessionSegmentRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSessionSegmentRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSessionSegmentRequest) GetSessionID() string { + if g == nil { + return "" + } + return g.SessionID +} + +func (g *GetSessionSegmentRequest) GetConsumerID() string { + if g == nil { + return "" + } + return g.ConsumerID +} + +func (g *GetSessionSegmentRequest) GetSegmentID() string { + if g == nil { + return "" + } + return g.SegmentID +} + +type GetSessionSegmentResponse 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 (g *GetSessionSegmentResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSessionSegmentResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSessionSegmentResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getsonicallysimilar.go b/models/operations/getsonicallysimilar.go new file mode 100644 index 0000000..d3c346a --- /dev/null +++ b/models/operations/getsonicallysimilar.go @@ -0,0 +1,319 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSonicallySimilarGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSonicallySimilarGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSonicallySimilarGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSonicallySimilarGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSonicallySimilarGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSonicallySimilarGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSonicallySimilarGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSonicallySimilarGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSonicallySimilarGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSonicallySimilarGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSonicallySimilarGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSonicallySimilarGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSonicallySimilarGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSonicallySimilarGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSonicallySimilarRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The metadata type to fetch (should be 10 for audio track) + Type *int64 `queryParam:"style=form,explode=true,name=type"` + // The music analysis to center the search. Typically obtained from the `musicAnalysis` of a track + Values []int64 `queryParam:"style=form,explode=false,name=values"` + // The limit of the number of items to fetch; defaults to 50 + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` + // The maximum distance to search, defaults to 0.25 + MaxDistance *float64 `queryParam:"style=form,explode=true,name=maxDistance"` +} + +func (g GetSonicallySimilarRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSonicallySimilarRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId", "values"}); err != nil { + return err + } + return nil +} + +func (g *GetSonicallySimilarRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSonicallySimilarRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSonicallySimilarRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSonicallySimilarRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSonicallySimilarRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSonicallySimilarRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSonicallySimilarRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSonicallySimilarRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSonicallySimilarRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSonicallySimilarRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSonicallySimilarRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSonicallySimilarRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetSonicallySimilarRequest) GetType() *int64 { + if g == nil { + return nil + } + return g.Type +} + +func (g *GetSonicallySimilarRequest) GetValues() []int64 { + if g == nil { + return []int64{} + } + return g.Values +} + +func (g *GetSonicallySimilarRequest) GetLimit() *int64 { + if g == nil { + return nil + } + return g.Limit +} + +func (g *GetSonicallySimilarRequest) GetMaxDistance() *float64 { + if g == nil { + return nil + } + return g.MaxDistance +} + +type GetSonicallySimilarResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (g *GetSonicallySimilarResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSonicallySimilarResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSonicallySimilarResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSonicallySimilarResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} diff --git a/models/operations/getsonicpath.go b/models/operations/getsonicpath.go new file mode 100644 index 0000000..7352832 --- /dev/null +++ b/models/operations/getsonicpath.go @@ -0,0 +1,319 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSonicPathGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSonicPathGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSonicPathGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSonicPathGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSonicPathGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSonicPathGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSonicPathGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSonicPathGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSonicPathGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSonicPathGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSonicPathGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSonicPathGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSonicPathGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSonicPathGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSonicPathRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The starting metadata item id + StartID int64 `queryParam:"style=form,explode=true,name=startID"` + // The ending metadata item id + EndID int64 `queryParam:"style=form,explode=true,name=endID"` + // Limit results to count items + Count *int64 `queryParam:"style=form,explode=true,name=count"` + // The maximum distance allowed along the path; defaults to 0.25 + MaxDistance *float64 `queryParam:"style=form,explode=true,name=maxDistance"` +} + +func (g GetSonicPathRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSonicPathRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionId", "startID", "endID"}); err != nil { + return err + } + return nil +} + +func (g *GetSonicPathRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSonicPathRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSonicPathRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSonicPathRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSonicPathRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSonicPathRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSonicPathRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSonicPathRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSonicPathRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSonicPathRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSonicPathRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSonicPathRequest) GetSectionID() int64 { + if g == nil { + return 0 + } + return g.SectionID +} + +func (g *GetSonicPathRequest) GetStartID() int64 { + if g == nil { + return 0 + } + return g.StartID +} + +func (g *GetSonicPathRequest) GetEndID() int64 { + if g == nil { + return 0 + } + return g.EndID +} + +func (g *GetSonicPathRequest) GetCount() *int64 { + if g == nil { + return nil + } + return g.Count +} + +func (g *GetSonicPathRequest) GetMaxDistance() *float64 { + if g == nil { + return nil + } + return g.MaxDistance +} + +type GetSonicPathResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (g *GetSonicPathResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSonicPathResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSonicPathResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSonicPathResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if g == nil { + return nil + } + return g.MediaContainerWithMetadata +} diff --git a/models/operations/getsourceconnectioninformation.go b/models/operations/getsourceconnectioninformation.go index 34856e1..79c04e0 100644 --- a/models/operations/getsourceconnectioninformation.go +++ b/models/operations/getsourceconnectioninformation.go @@ -3,12 +3,239 @@ package operations import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) +type GetSourceConnectionInformationGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSourceConnectionInformationGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSourceConnectionInformationGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSourceConnectionInformationGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSourceConnectionInformationGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSourceConnectionInformationGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSourceConnectionInformationGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSourceConnectionInformationGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSourceConnectionInformationGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSourceConnectionInformationGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSourceConnectionInformationGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSourceConnectionInformationGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSourceConnectionInformationGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSourceConnectionInformationGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + type GetSourceConnectionInformationRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` // The source identifier with an included prefix. Source string `queryParam:"style=form,explode=true,name=source"` + // Force refresh + Refresh *components.BoolInt `queryParam:"style=form,explode=true,name=refresh"` +} + +func (g GetSourceConnectionInformationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSourceConnectionInformationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"source"}); err != nil { + return err + } + return nil +} + +func (g *GetSourceConnectionInformationRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSourceConnectionInformationRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSourceConnectionInformationRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSourceConnectionInformationRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSourceConnectionInformationRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSourceConnectionInformationRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSourceConnectionInformationRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSourceConnectionInformationRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSourceConnectionInformationRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSourceConnectionInformationRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSourceConnectionInformationRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace } func (g *GetSourceConnectionInformationRequest) GetSource() string { @@ -18,6 +245,163 @@ func (g *GetSourceConnectionInformationRequest) GetSource() string { return g.Source } +func (g *GetSourceConnectionInformationRequest) GetRefresh() *components.BoolInt { + if g == nil { + return nil + } + return g.Refresh +} + +type Connection struct { + Address *string `json:"address,omitempty"` + // Indicates if the connection is the server's LAN address + Local *bool `json:"local,omitempty"` + Port *int64 `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` + // Indicates the connection is over a relayed connection + Relay *bool `json:"relay,omitempty"` + URI *string `json:"uri,omitempty"` +} + +func (c *Connection) GetAddress() *string { + if c == nil { + return nil + } + return c.Address +} + +func (c *Connection) GetLocal() *bool { + if c == nil { + return nil + } + return c.Local +} + +func (c *Connection) GetPort() *int64 { + if c == nil { + return nil + } + return c.Port +} + +func (c *Connection) GetProtocol() *string { + if c == nil { + return nil + } + return c.Protocol +} + +func (c *Connection) GetRelay() *bool { + if c == nil { + return nil + } + return c.Relay +} + +func (c *Connection) GetURI() *string { + if c == nil { + return nil + } + return c.URI +} + +type Device struct { + AccessToken *string `json:"accessToken,omitempty"` + ClientIdentifier *string `json:"clientIdentifier,omitempty"` + Connection []Connection `json:"Connection,omitempty"` + Name *string `json:"name,omitempty"` +} + +func (d *Device) GetAccessToken() *string { + if d == nil { + return nil + } + return d.AccessToken +} + +func (d *Device) GetClientIdentifier() *string { + if d == nil { + return nil + } + return d.ClientIdentifier +} + +func (d *Device) GetConnection() []Connection { + if d == nil { + return nil + } + return d.Connection +} + +func (d *Device) GetName() *string { + if d == nil { + return nil + } + return d.Name +} + +// GetSourceConnectionInformationMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetSourceConnectionInformationMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Device *Device `json:"Device,omitempty"` +} + +func (g *GetSourceConnectionInformationMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetSourceConnectionInformationMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetSourceConnectionInformationMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetSourceConnectionInformationMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetSourceConnectionInformationMediaContainer) GetDevice() *Device { + if g == nil { + return nil + } + return g.Device +} + +// GetSourceConnectionInformationResponseBody - OK +type GetSourceConnectionInformationResponseBody struct { + MediaContainer *GetSourceConnectionInformationMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetSourceConnectionInformationResponseBody) GetMediaContainer() *GetSourceConnectionInformationMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + type GetSourceConnectionInformationResponse struct { // HTTP response content type for this operation ContentType string @@ -25,6 +409,8 @@ type GetSourceConnectionInformationResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response + // OK + Object *GetSourceConnectionInformationResponseBody } func (g *GetSourceConnectionInformationResponse) GetContentType() string { @@ -47,3 +433,10 @@ func (g *GetSourceConnectionInformationResponse) GetRawResponse() *http.Response } return g.RawResponse } + +func (g *GetSourceConnectionInformationResponse) GetObject() *GetSourceConnectionInformationResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getstatistics.go b/models/operations/getstatistics.go deleted file mode 100644 index 5270c4b..0000000 --- a/models/operations/getstatistics.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type GetStatisticsRequest struct { - // The timespan to retrieve statistics for - // the exact meaning of this parameter is not known - // - Timespan *int64 `queryParam:"style=form,explode=true,name=timespan"` -} - -func (g *GetStatisticsRequest) GetTimespan() *int64 { - if g == nil { - return nil - } - return g.Timespan -} - -type GetStatisticsDevice struct { - ID *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Platform *string `json:"platform,omitempty"` - ClientIdentifier *string `json:"clientIdentifier,omitempty"` - CreatedAt *int `json:"createdAt,omitempty"` -} - -func (g *GetStatisticsDevice) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetStatisticsDevice) GetName() *string { - if g == nil { - return nil - } - return g.Name -} - -func (g *GetStatisticsDevice) GetPlatform() *string { - if g == nil { - return nil - } - return g.Platform -} - -func (g *GetStatisticsDevice) GetClientIdentifier() *string { - if g == nil { - return nil - } - return g.ClientIdentifier -} - -func (g *GetStatisticsDevice) GetCreatedAt() *int { - if g == nil { - return nil - } - return g.CreatedAt -} - -type Account struct { - ID *int `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` - DefaultAudioLanguage *string `json:"defaultAudioLanguage,omitempty"` - AutoSelectAudio *bool `json:"autoSelectAudio,omitempty"` - DefaultSubtitleLanguage *string `json:"defaultSubtitleLanguage,omitempty"` - SubtitleMode *int `json:"subtitleMode,omitempty"` - Thumb *string `json:"thumb,omitempty"` -} - -func (a *Account) GetID() *int { - if a == nil { - return nil - } - return a.ID -} - -func (a *Account) GetKey() *string { - if a == nil { - return nil - } - return a.Key -} - -func (a *Account) GetName() *string { - if a == nil { - return nil - } - return a.Name -} - -func (a *Account) GetDefaultAudioLanguage() *string { - if a == nil { - return nil - } - return a.DefaultAudioLanguage -} - -func (a *Account) GetAutoSelectAudio() *bool { - if a == nil { - return nil - } - return a.AutoSelectAudio -} - -func (a *Account) GetDefaultSubtitleLanguage() *string { - if a == nil { - return nil - } - return a.DefaultSubtitleLanguage -} - -func (a *Account) GetSubtitleMode() *int { - if a == nil { - return nil - } - return a.SubtitleMode -} - -func (a *Account) GetThumb() *string { - if a == nil { - return nil - } - return a.Thumb -} - -type StatisticsMedia struct { - AccountID *int `json:"accountID,omitempty"` - DeviceID *int `json:"deviceID,omitempty"` - Timespan *int `json:"timespan,omitempty"` - At *int `json:"at,omitempty"` - MetadataType *int `json:"metadataType,omitempty"` - Count *int `json:"count,omitempty"` - Duration *int `json:"duration,omitempty"` -} - -func (s *StatisticsMedia) GetAccountID() *int { - if s == nil { - return nil - } - return s.AccountID -} - -func (s *StatisticsMedia) GetDeviceID() *int { - if s == nil { - return nil - } - return s.DeviceID -} - -func (s *StatisticsMedia) GetTimespan() *int { - if s == nil { - return nil - } - return s.Timespan -} - -func (s *StatisticsMedia) GetAt() *int { - if s == nil { - return nil - } - return s.At -} - -func (s *StatisticsMedia) GetMetadataType() *int { - if s == nil { - return nil - } - return s.MetadataType -} - -func (s *StatisticsMedia) GetCount() *int { - if s == nil { - return nil - } - return s.Count -} - -func (s *StatisticsMedia) GetDuration() *int { - if s == nil { - return nil - } - return s.Duration -} - -type GetStatisticsMediaContainer struct { - Size *int `json:"size,omitempty"` - Device []GetStatisticsDevice `json:"Device,omitempty"` - Account []Account `json:"Account,omitempty"` - StatisticsMedia []StatisticsMedia `json:"StatisticsMedia,omitempty"` -} - -func (g *GetStatisticsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetStatisticsMediaContainer) GetDevice() []GetStatisticsDevice { - if g == nil { - return nil - } - return g.Device -} - -func (g *GetStatisticsMediaContainer) GetAccount() []Account { - if g == nil { - return nil - } - return g.Account -} - -func (g *GetStatisticsMediaContainer) GetStatisticsMedia() []StatisticsMedia { - if g == nil { - return nil - } - return g.StatisticsMedia -} - -// GetStatisticsResponseBody - Media Statistics -type GetStatisticsResponseBody struct { - MediaContainer *GetStatisticsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetStatisticsResponseBody) GetMediaContainer() *GetStatisticsMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetStatisticsResponse 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 - // Media Statistics - Object *GetStatisticsResponseBody -} - -func (g *GetStatisticsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetStatisticsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetStatisticsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetStatisticsResponse) GetObject() *GetStatisticsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getstream.go b/models/operations/getstream.go new file mode 100644 index 0000000..25cf629 --- /dev/null +++ b/models/operations/getstream.go @@ -0,0 +1,310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetStreamGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetStreamGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetStreamGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetStreamGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetStreamGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetStreamGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetStreamGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetStreamGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetStreamGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetStreamGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetStreamGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetStreamGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetStreamGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetStreamGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetStreamRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the stream + StreamID int64 `pathParam:"style=simple,explode=false,name=streamId"` + // The extension of the stream. Required to fetch the `sub` portion of `idx`/`sub` subtitles + Ext string `pathParam:"style=simple,explode=false,name=ext"` + // The requested encoding for the subtitle (only used for text subtitles) + Encoding *string `queryParam:"style=form,explode=true,name=encoding"` + // The requested format for the subtitle to convert the subtitles to (only used for text subtitles) + Format *string `queryParam:"style=form,explode=true,name=format"` + // Whether the server should attempt to automatically adjust the subtitle timestamps to match the media + AutoAdjustSubtitle *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustSubtitle"` +} + +func (g GetStreamRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetStreamRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"streamId", "ext"}); err != nil { + return err + } + return nil +} + +func (g *GetStreamRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetStreamRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetStreamRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetStreamRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetStreamRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetStreamRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetStreamRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetStreamRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetStreamRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetStreamRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetStreamRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetStreamRequest) GetStreamID() int64 { + if g == nil { + return 0 + } + return g.StreamID +} + +func (g *GetStreamRequest) GetExt() string { + if g == nil { + return "" + } + return g.Ext +} + +func (g *GetStreamRequest) GetEncoding() *string { + if g == nil { + return nil + } + return g.Encoding +} + +func (g *GetStreamRequest) GetFormat() *string { + if g == nil { + return nil + } + return g.Format +} + +func (g *GetStreamRequest) GetAutoAdjustSubtitle() *components.BoolInt { + if g == nil { + return nil + } + return g.AutoAdjustSubtitle +} + +type GetStreamResponse 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 (g *GetStreamResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetStreamResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetStreamResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getstreamlevels.go b/models/operations/getstreamlevels.go new file mode 100644 index 0000000..f02a5ca --- /dev/null +++ b/models/operations/getstreamlevels.go @@ -0,0 +1,375 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetStreamLevelsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetStreamLevelsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetStreamLevelsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetStreamLevelsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetStreamLevelsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetStreamLevelsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetStreamLevelsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetStreamLevelsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetStreamLevelsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetStreamLevelsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetStreamLevelsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetStreamLevelsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetStreamLevelsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetStreamLevelsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetStreamLevelsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the stream + StreamID int64 `pathParam:"style=simple,explode=false,name=streamId"` + // Subsample result down to return only the provided number of samples + Subsample *int64 `queryParam:"style=form,explode=true,name=subsample"` +} + +func (g GetStreamLevelsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetStreamLevelsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"streamId"}); err != nil { + return err + } + return nil +} + +func (g *GetStreamLevelsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetStreamLevelsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetStreamLevelsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetStreamLevelsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetStreamLevelsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetStreamLevelsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetStreamLevelsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetStreamLevelsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetStreamLevelsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetStreamLevelsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetStreamLevelsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetStreamLevelsRequest) GetStreamID() int64 { + if g == nil { + return 0 + } + return g.StreamID +} + +func (g *GetStreamLevelsRequest) GetSubsample() *int64 { + if g == nil { + return nil + } + return g.Subsample +} + +type GetStreamLevelsLevel struct { + // The level in db. + V *float64 `json:"v,omitempty"` +} + +func (g *GetStreamLevelsLevel) GetV() *float64 { + if g == nil { + return nil + } + return g.V +} + +// GetStreamLevelsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetStreamLevelsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Level []GetStreamLevelsLevel `json:"Level,omitempty"` + // The total number of samples (as a string) + TotalSamples *string `json:"totalSamples,omitempty"` +} + +func (g *GetStreamLevelsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetStreamLevelsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetStreamLevelsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetStreamLevelsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetStreamLevelsMediaContainer) GetLevel() []GetStreamLevelsLevel { + if g == nil { + return nil + } + return g.Level +} + +func (g *GetStreamLevelsMediaContainer) GetTotalSamples() *string { + if g == nil { + return nil + } + return g.TotalSamples +} + +// GetStreamLevelsResponseBody - OK +type GetStreamLevelsResponseBody struct { + MediaContainer *GetStreamLevelsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetStreamLevelsResponseBody) GetMediaContainer() *GetStreamLevelsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetStreamLevelsResponse 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 + // OK + Object *GetStreamLevelsResponseBody +} + +func (g *GetStreamLevelsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetStreamLevelsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetStreamLevelsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetStreamLevelsResponse) GetObject() *GetStreamLevelsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getstreamloudness.go b/models/operations/getstreamloudness.go new file mode 100644 index 0000000..9f68c68 --- /dev/null +++ b/models/operations/getstreamloudness.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetStreamLoudnessGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetStreamLoudnessGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetStreamLoudnessGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetStreamLoudnessGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetStreamLoudnessGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetStreamLoudnessGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetStreamLoudnessGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetStreamLoudnessGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetStreamLoudnessGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetStreamLoudnessGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetStreamLoudnessGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetStreamLoudnessGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetStreamLoudnessGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetStreamLoudnessGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetStreamLoudnessRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the stream + StreamID int64 `pathParam:"style=simple,explode=false,name=streamId"` + // Subsample result down to return only the provided number of samples + Subsample *int64 `queryParam:"style=form,explode=true,name=subsample"` +} + +func (g GetStreamLoudnessRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetStreamLoudnessRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"streamId"}); err != nil { + return err + } + return nil +} + +func (g *GetStreamLoudnessRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetStreamLoudnessRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetStreamLoudnessRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetStreamLoudnessRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetStreamLoudnessRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetStreamLoudnessRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetStreamLoudnessRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetStreamLoudnessRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetStreamLoudnessRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetStreamLoudnessRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetStreamLoudnessRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetStreamLoudnessRequest) GetStreamID() int64 { + if g == nil { + return 0 + } + return g.StreamID +} + +func (g *GetStreamLoudnessRequest) GetSubsample() *int64 { + if g == nil { + return nil + } + return g.Subsample +} + +type GetStreamLoudnessResponse 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 + // OK + Res *string +} + +func (g *GetStreamLoudnessResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetStreamLoudnessResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetStreamLoudnessResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetStreamLoudnessResponse) GetRes() *string { + if g == nil { + return nil + } + return g.Res +} diff --git a/models/operations/getsubscription.go b/models/operations/getsubscription.go new file mode 100644 index 0000000..a3c7cae --- /dev/null +++ b/models/operations/getsubscription.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetSubscriptionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetSubscriptionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSubscriptionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetSubscriptionGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSubscriptionGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSubscriptionGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSubscriptionGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSubscriptionGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSubscriptionGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSubscriptionGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSubscriptionGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSubscriptionGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSubscriptionGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSubscriptionGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetSubscriptionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + SubscriptionID int64 `pathParam:"style=simple,explode=false,name=subscriptionId"` + // Indicates whether the active grabs should be included as well + IncludeGrabs *components.BoolInt `queryParam:"style=form,explode=true,name=includeGrabs"` + // Compute the storage of recorded items desired by this subscription + IncludeStorage *components.BoolInt `queryParam:"style=form,explode=true,name=includeStorage"` +} + +func (g GetSubscriptionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSubscriptionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"subscriptionId"}); err != nil { + return err + } + return nil +} + +func (g *GetSubscriptionRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetSubscriptionRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetSubscriptionRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetSubscriptionRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetSubscriptionRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetSubscriptionRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetSubscriptionRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetSubscriptionRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetSubscriptionRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetSubscriptionRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetSubscriptionRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetSubscriptionRequest) GetSubscriptionID() int64 { + if g == nil { + return 0 + } + return g.SubscriptionID +} + +func (g *GetSubscriptionRequest) GetIncludeGrabs() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeGrabs +} + +func (g *GetSubscriptionRequest) GetIncludeStorage() *components.BoolInt { + if g == nil { + return nil + } + return g.IncludeStorage +} + +type GetSubscriptionResponse 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 + // OK + MediaContainerWithSubscription *components.MediaContainerWithSubscription +} + +func (g *GetSubscriptionResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetSubscriptionResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetSubscriptionResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetSubscriptionResponse) GetMediaContainerWithSubscription() *components.MediaContainerWithSubscription { + if g == nil { + return nil + } + return g.MediaContainerWithSubscription +} diff --git a/models/operations/gettags.go b/models/operations/gettags.go new file mode 100644 index 0000000..02f7ec0 --- /dev/null +++ b/models/operations/gettags.go @@ -0,0 +1,401 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetTagsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetTagsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTagsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetTagsGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetTagsGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetTagsGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetTagsGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetTagsGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetTagsGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetTagsGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetTagsGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetTagsGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetTagsGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetTagsGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetTagsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The metadata type to filter by + Type *int64 `queryParam:"style=form,explode=true,name=type"` +} + +func (g GetTagsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTagsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetTagsRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetTagsRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetTagsRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetTagsRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetTagsRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetTagsRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetTagsRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetTagsRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetTagsRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetTagsRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetTagsRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetTagsRequest) GetType() *int64 { + if g == nil { + return nil + } + return g.Type +} + +type Directory struct { + // The filter string to view metadata wit this tag + Filter *string `json:"filter,omitempty"` + ID *int64 `json:"id,omitempty"` + // The name of the tag + Tag *string `json:"tag,omitempty"` + // The key of this tag. This is a universal key across all PMS instances and plex.tv services + TagKey *string `json:"tagKey,omitempty"` + // The type of the tag + TagType *int64 `json:"tagType,omitempty"` + // The URL to a thumbnail for this tag + Thumb *string `json:"thumb,omitempty"` +} + +func (d *Directory) GetFilter() *string { + if d == nil { + return nil + } + return d.Filter +} + +func (d *Directory) GetID() *int64 { + if d == nil { + return nil + } + return d.ID +} + +func (d *Directory) GetTag() *string { + if d == nil { + return nil + } + return d.Tag +} + +func (d *Directory) GetTagKey() *string { + if d == nil { + return nil + } + return d.TagKey +} + +func (d *Directory) GetTagType() *int64 { + if d == nil { + return nil + } + return d.TagType +} + +func (d *Directory) GetThumb() *string { + if d == nil { + return nil + } + return d.Thumb +} + +// GetTagsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetTagsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Directory []Directory `json:"Directory,omitempty"` +} + +func (g *GetTagsMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetTagsMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetTagsMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetTagsMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetTagsMediaContainer) GetDirectory() []Directory { + if g == nil { + return nil + } + return g.Directory +} + +// GetTagsResponseBody - OK +type GetTagsResponseBody struct { + MediaContainer *GetTagsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetTagsResponseBody) GetMediaContainer() *GetTagsMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetTagsResponse 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 + // OK + Object *GetTagsResponseBody +} + +func (g *GetTagsResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetTagsResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetTagsResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetTagsResponse) GetObject() *GetTagsResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/gettasks.go b/models/operations/gettasks.go new file mode 100644 index 0000000..84cb464 --- /dev/null +++ b/models/operations/gettasks.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type ButlerTask struct { + // A user-friendly description of the task + Description *string `json:"description,omitempty"` + // Whether this task is enabled or not + Enabled *bool `json:"enabled,omitempty"` + // The interval (in days) of when this task is run. A value of 1 is run every day, 7 is every week, etc. + Interval *int64 `json:"interval,omitempty"` + // The name of the task + Name *string `json:"name,omitempty"` + // Indicates whether the timing of the task is randomized within the butler interval + ScheduleRandomized *bool `json:"scheduleRandomized,omitempty"` + // A user-friendly title of the task + Title *string `json:"title,omitempty"` +} + +func (b *ButlerTask) GetDescription() *string { + if b == nil { + return nil + } + return b.Description +} + +func (b *ButlerTask) GetEnabled() *bool { + if b == nil { + return nil + } + return b.Enabled +} + +func (b *ButlerTask) GetInterval() *int64 { + if b == nil { + return nil + } + return b.Interval +} + +func (b *ButlerTask) GetName() *string { + if b == nil { + return nil + } + return b.Name +} + +func (b *ButlerTask) GetScheduleRandomized() *bool { + if b == nil { + return nil + } + return b.ScheduleRandomized +} + +func (b *ButlerTask) GetTitle() *string { + if b == nil { + return nil + } + return b.Title +} + +type ButlerTasks struct { + ButlerTask []ButlerTask `json:"ButlerTask,omitempty"` +} + +func (b *ButlerTasks) GetButlerTask() []ButlerTask { + if b == nil { + return nil + } + return b.ButlerTask +} + +// GetTasksResponseBody - Butler tasks +type GetTasksResponseBody struct { + ButlerTasks *ButlerTasks `json:"ButlerTasks,omitempty"` +} + +func (g *GetTasksResponseBody) GetButlerTasks() *ButlerTasks { + if g == nil { + return nil + } + return g.ButlerTasks +} + +type GetTasksResponse 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 + // Butler tasks + Object *GetTasksResponseBody +} + +func (g *GetTasksResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetTasksResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetTasksResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetTasksResponse) GetObject() *GetTasksResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/gettemplate.go b/models/operations/gettemplate.go new file mode 100644 index 0000000..ff9ca20 --- /dev/null +++ b/models/operations/gettemplate.go @@ -0,0 +1,522 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetTemplateGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetTemplateGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTemplateGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetTemplateGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetTemplateGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetTemplateGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetTemplateGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetTemplateGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetTemplateGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetTemplateGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetTemplateGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetTemplateGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetTemplateGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetTemplateGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetTemplateRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The guid of the item for which to get the template + GUID *string `queryParam:"style=form,explode=true,name=guid"` +} + +func (g GetTemplateRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTemplateRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetTemplateRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetTemplateRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetTemplateRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetTemplateRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetTemplateRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetTemplateRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetTemplateRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetTemplateRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetTemplateRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetTemplateRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetTemplateRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetTemplateRequest) GetGUID() *string { + if g == nil { + return nil + } + return g.GUID +} + +// MediaSubscription - A media subscription contains a representation of metadata desired to be recorded +type MediaSubscription struct { + // The title of this subscription type + Title *string `json:"title,omitempty"` + // Metadata type number + Type *int64 `json:"type,omitempty"` + AiringsType *string `json:"airingsType,omitempty"` + CreatedAt *int64 `json:"createdAt,omitempty"` + // Media Matching Hints + Directory map[string]any `json:"Directory,omitempty"` + // Only included if `includeStorage` is specified + DurationTotal *int64 `json:"durationTotal,omitempty"` + Key *string `json:"key,omitempty"` + LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` + LocationPath *string `json:"locationPath,omitempty"` + MediaGrabOperation []components.MediaGrabOperation `json:"MediaGrabOperation,omitempty"` + // Media Matching Hints + Playlist map[string]any `json:"Playlist,omitempty"` + Setting []components.Setting `json:"Setting,omitempty"` + // Only included if `includeStorage` is specified + StorageTotal *int64 `json:"storageTotal,omitempty"` + // Where this subscription will record to + TargetLibrarySectionID *int64 `json:"targetLibrarySectionID,omitempty"` + // The library section location id for where the item is to be recorded + TargetSectionLocationID *int64 `json:"targetSectionLocationID,omitempty"` + // Media Matching Hints + Video map[string]any `json:"Video,omitempty"` + // Parameter string for creating this subscription + Parameters *string `json:"parameters,omitempty"` + Selected *bool `json:"selected,omitempty"` +} + +func (m *MediaSubscription) GetTitle() *string { + if m == nil { + return nil + } + return m.Title +} + +func (m *MediaSubscription) GetType() *int64 { + if m == nil { + return nil + } + return m.Type +} + +func (m *MediaSubscription) GetAiringsType() *string { + if m == nil { + return nil + } + return m.AiringsType +} + +func (m *MediaSubscription) GetCreatedAt() *int64 { + if m == nil { + return nil + } + return m.CreatedAt +} + +func (m *MediaSubscription) GetDirectory() map[string]any { + if m == nil { + return nil + } + return m.Directory +} + +func (m *MediaSubscription) GetDurationTotal() *int64 { + if m == nil { + return nil + } + return m.DurationTotal +} + +func (m *MediaSubscription) GetKey() *string { + if m == nil { + return nil + } + return m.Key +} + +func (m *MediaSubscription) GetLibrarySectionTitle() *string { + if m == nil { + return nil + } + return m.LibrarySectionTitle +} + +func (m *MediaSubscription) GetLocationPath() *string { + if m == nil { + return nil + } + return m.LocationPath +} + +func (m *MediaSubscription) GetMediaGrabOperation() []components.MediaGrabOperation { + if m == nil { + return nil + } + return m.MediaGrabOperation +} + +func (m *MediaSubscription) GetPlaylist() map[string]any { + if m == nil { + return nil + } + return m.Playlist +} + +func (m *MediaSubscription) GetSetting() []components.Setting { + if m == nil { + return nil + } + return m.Setting +} + +func (m *MediaSubscription) GetStorageTotal() *int64 { + if m == nil { + return nil + } + return m.StorageTotal +} + +func (m *MediaSubscription) GetTargetLibrarySectionID() *int64 { + if m == nil { + return nil + } + return m.TargetLibrarySectionID +} + +func (m *MediaSubscription) GetTargetSectionLocationID() *int64 { + if m == nil { + return nil + } + return m.TargetSectionLocationID +} + +func (m *MediaSubscription) GetVideo() map[string]any { + if m == nil { + return nil + } + return m.Video +} + +func (m *MediaSubscription) GetParameters() *string { + if m == nil { + return nil + } + return m.Parameters +} + +func (m *MediaSubscription) GetSelected() *bool { + if m == nil { + return nil + } + return m.Selected +} + +type SubscriptionTemplate struct { + MediaSubscription []MediaSubscription `json:"MediaSubscription,omitempty"` +} + +func (s *SubscriptionTemplate) GetMediaSubscription() []MediaSubscription { + if s == nil { + return nil + } + return s.MediaSubscription +} + +// GetTemplateMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetTemplateMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + SubscriptionTemplate []SubscriptionTemplate `json:"SubscriptionTemplate,omitempty"` +} + +func (g *GetTemplateMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetTemplateMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetTemplateMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetTemplateMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetTemplateMediaContainer) GetSubscriptionTemplate() []SubscriptionTemplate { + if g == nil { + return nil + } + return g.SubscriptionTemplate +} + +// GetTemplateResponseBody - OK +type GetTemplateResponseBody struct { + MediaContainer *GetTemplateMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetTemplateResponseBody) GetMediaContainer() *GetTemplateMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetTemplateResponse 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 + // OK + Object *GetTemplateResponseBody + Headers map[string][]string +} + +func (g *GetTemplateResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetTemplateResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetTemplateResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetTemplateResponse) GetObject() *GetTemplateResponseBody { + if g == nil { + return nil + } + return g.Object +} + +func (g *GetTemplateResponse) GetHeaders() map[string][]string { + if g == nil { + return map[string][]string{} + } + return g.Headers +} diff --git a/models/operations/getthumb.go b/models/operations/getthumb.go new file mode 100644 index 0000000..93715d8 --- /dev/null +++ b/models/operations/getthumb.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type GetThumbGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetThumbGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetThumbGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetThumbGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetThumbGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetThumbGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetThumbGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetThumbGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetThumbGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetThumbGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetThumbGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetThumbGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetThumbGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetThumbGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +type GetThumbRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` + // A version number of the thumb used for busting cache + VersionPathParameter int64 `pathParam:"style=simple,explode=false,name=version"` +} + +func (g GetThumbRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetThumbRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"deviceId", "version"}); err != nil { + return err + } + return nil +} + +func (g *GetThumbRequest) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetThumbRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetThumbRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetThumbRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetThumbRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetThumbRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetThumbRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetThumbRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetThumbRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetThumbRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetThumbRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetThumbRequest) GetDeviceID() int64 { + if g == nil { + return 0 + } + return g.DeviceID +} + +func (g *GetThumbRequest) GetVersionPathParameter() int64 { + if g == nil { + return 0 + } + return g.VersionPathParameter +} + +type GetThumbResponse 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 (g *GetThumbResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetThumbResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetThumbResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} diff --git a/models/operations/getthumbimage.go b/models/operations/getthumbimage.go deleted file mode 100644 index a08ab3f..0000000 --- a/models/operations/getthumbimage.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "net/http" -) - -type GetThumbImageRequest struct { - // the id of the library item to return the children of. - RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"` - Width int64 `queryParam:"style=form,explode=true,name=width"` - Height int64 `queryParam:"style=form,explode=true,name=height"` - MinSize int64 `queryParam:"style=form,explode=true,name=minSize"` - Upscale int64 `queryParam:"style=form,explode=true,name=upscale"` - // An authentication token, obtained from plex.tv - XPlexToken string `header:"style=simple,explode=false,name=X-Plex-Token"` -} - -func (g *GetThumbImageRequest) GetRatingKey() int64 { - if g == nil { - return 0 - } - return g.RatingKey -} - -func (g *GetThumbImageRequest) GetWidth() int64 { - if g == nil { - return 0 - } - return g.Width -} - -func (g *GetThumbImageRequest) GetHeight() int64 { - if g == nil { - return 0 - } - return g.Height -} - -func (g *GetThumbImageRequest) GetMinSize() int64 { - if g == nil { - return 0 - } - return g.MinSize -} - -func (g *GetThumbImageRequest) GetUpscale() int64 { - if g == nil { - return 0 - } - return g.Upscale -} - -func (g *GetThumbImageRequest) GetXPlexToken() string { - if g == nil { - return "" - } - return g.XPlexToken -} - -type GetThumbImageResponse 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 - // Successful response returning an image - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - ResponseStream io.ReadCloser - Headers map[string][]string -} - -func (g *GetThumbImageResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetThumbImageResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetThumbImageResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetThumbImageResponse) GetResponseStream() io.ReadCloser { - if g == nil { - return nil - } - return g.ResponseStream -} - -func (g *GetThumbImageResponse) GetHeaders() map[string][]string { - if g == nil { - return map[string][]string{} - } - return g.Headers -} diff --git a/models/operations/gettimeline.go b/models/operations/gettimeline.go deleted file mode 100644 index c9116f7..0000000 --- a/models/operations/gettimeline.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "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 -} - -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 (g *GetTimelineRequest) GetRatingKey() float64 { - if g == nil { - return 0.0 - } - return g.RatingKey -} - -func (g *GetTimelineRequest) GetKey() string { - if g == nil { - return "" - } - return g.Key -} - -func (g *GetTimelineRequest) GetState() State { - if g == nil { - return State("") - } - return g.State -} - -func (g *GetTimelineRequest) GetHasMDE() float64 { - if g == nil { - return 0.0 - } - return g.HasMDE -} - -func (g *GetTimelineRequest) GetTime() float64 { - if g == nil { - return 0.0 - } - return g.Time -} - -func (g *GetTimelineRequest) GetDuration() float64 { - if g == nil { - return 0.0 - } - return g.Duration -} - -func (g *GetTimelineRequest) GetContext() string { - if g == nil { - return "" - } - return g.Context -} - -func (g *GetTimelineRequest) GetPlayQueueItemID() float64 { - if g == nil { - return 0.0 - } - return g.PlayQueueItemID -} - -func (g *GetTimelineRequest) GetPlayBackTime() float64 { - if g == nil { - return 0.0 - } - return g.PlayBackTime -} - -func (g *GetTimelineRequest) GetRow() float64 { - if g == nil { - return 0.0 - } - return g.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 (g *GetTimelineResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetTimelineResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetTimelineResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} diff --git a/models/operations/gettokenbypinid.go b/models/operations/gettokenbypinid.go deleted file mode 100644 index 0529a29..0000000 --- a/models/operations/gettokenbypinid.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" - "time" -) - -var GetTokenByPinIDServerList = []string{ - "https://plex.tv/api/v2", -} - -type GetTokenByPinIDRequest struct { - // The PinID to retrieve an access token for - PinID int64 `pathParam:"style=simple,explode=false,name=pinID"` - // An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` - // The name of the client application. (Plex Web, Plex Media Server, etc.) - ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"` - // A relatively friendly name for the client device - DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"` - // The version of the client application. - ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"` - // The platform of the client application. - Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` -} - -func (g *GetTokenByPinIDRequest) GetPinID() int64 { - if g == nil { - return 0 - } - return g.PinID -} - -func (g *GetTokenByPinIDRequest) GetClientID() string { - if g == nil { - return "" - } - return g.ClientID -} - -func (g *GetTokenByPinIDRequest) GetClientName() *string { - if g == nil { - return nil - } - return g.ClientName -} - -func (g *GetTokenByPinIDRequest) GetDeviceNickname() *string { - if g == nil { - return nil - } - return g.DeviceNickname -} - -func (g *GetTokenByPinIDRequest) GetClientVersion() *string { - if g == nil { - return nil - } - return g.ClientVersion -} - -func (g *GetTokenByPinIDRequest) GetPlatform() *string { - if g == nil { - return nil - } - return g.Platform -} - -// GetTokenByPinIDGeoData - Geo location data -type GetTokenByPinIDGeoData struct { - // The ISO 3166-1 alpha-2 code of the country. - Code string `json:"code"` - // The continent code where the country is located. - ContinentCode string `json:"continent_code"` - // The official name of the country. - Country string `json:"country"` - // The name of the city. - City string `json:"city"` - // Indicates if the country is a member of the European Union. - EuropeanUnionMember *bool `default:"false" json:"european_union_member"` - // The time zone of the country. - TimeZone string `json:"time_zone"` - // The postal code of the location. - PostalCode string `json:"postal_code"` - // Indicates if the country has privacy restrictions. - InPrivacyRestrictedCountry *bool `default:"false" json:"in_privacy_restricted_country"` - // Indicates if the region has privacy restrictions. - InPrivacyRestrictedRegion *bool `default:"false" json:"in_privacy_restricted_region"` - // The name of the primary administrative subdivision. - Subdivisions string `json:"subdivisions"` - // The geographical coordinates (latitude, longitude) of the location. - Coordinates string `json:"coordinates"` -} - -func (g GetTokenByPinIDGeoData) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetTokenByPinIDGeoData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil { - return err - } - return nil -} - -func (g *GetTokenByPinIDGeoData) GetCode() string { - if g == nil { - return "" - } - return g.Code -} - -func (g *GetTokenByPinIDGeoData) GetContinentCode() string { - if g == nil { - return "" - } - return g.ContinentCode -} - -func (g *GetTokenByPinIDGeoData) GetCountry() string { - if g == nil { - return "" - } - return g.Country -} - -func (g *GetTokenByPinIDGeoData) GetCity() string { - if g == nil { - return "" - } - return g.City -} - -func (g *GetTokenByPinIDGeoData) GetEuropeanUnionMember() *bool { - if g == nil { - return nil - } - return g.EuropeanUnionMember -} - -func (g *GetTokenByPinIDGeoData) GetTimeZone() string { - if g == nil { - return "" - } - return g.TimeZone -} - -func (g *GetTokenByPinIDGeoData) GetPostalCode() string { - if g == nil { - return "" - } - return g.PostalCode -} - -func (g *GetTokenByPinIDGeoData) GetInPrivacyRestrictedCountry() *bool { - if g == nil { - return nil - } - return g.InPrivacyRestrictedCountry -} - -func (g *GetTokenByPinIDGeoData) GetInPrivacyRestrictedRegion() *bool { - if g == nil { - return nil - } - return g.InPrivacyRestrictedRegion -} - -func (g *GetTokenByPinIDGeoData) GetSubdivisions() string { - if g == nil { - return "" - } - return g.Subdivisions -} - -func (g *GetTokenByPinIDGeoData) GetCoordinates() string { - if g == nil { - return "" - } - return g.Coordinates -} - -// GetTokenByPinIDAuthPinContainer - The Pin with a non-null authToken when it has been verified by the user -type GetTokenByPinIDAuthPinContainer struct { - ID int64 `json:"id"` - Code string `json:"code"` - Product string `json:"product"` - Trusted *bool `default:"false" json:"trusted"` - Qr string `json:"qr"` - // The X-Client-Identifier used in the request - ClientIdentifier string `json:"clientIdentifier"` - // Geo location data - Location GetTokenByPinIDGeoData `json:"location"` - // The number of seconds this pin expires, by default 900 seconds - ExpiresIn *int64 `default:"900" json:"expiresIn"` - CreatedAt time.Time `json:"createdAt"` - ExpiresAt time.Time `json:"expiresAt"` - AuthToken *string `json:"authToken,omitempty"` - NewRegistration any `json:"newRegistration,omitempty"` -} - -func (g GetTokenByPinIDAuthPinContainer) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetTokenByPinIDAuthPinContainer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "code", "product", "qr", "clientIdentifier", "location", "createdAt", "expiresAt"}); err != nil { - return err - } - return nil -} - -func (g *GetTokenByPinIDAuthPinContainer) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetTokenByPinIDAuthPinContainer) GetCode() string { - if g == nil { - return "" - } - return g.Code -} - -func (g *GetTokenByPinIDAuthPinContainer) GetProduct() string { - if g == nil { - return "" - } - return g.Product -} - -func (g *GetTokenByPinIDAuthPinContainer) GetTrusted() *bool { - if g == nil { - return nil - } - return g.Trusted -} - -func (g *GetTokenByPinIDAuthPinContainer) GetQr() string { - if g == nil { - return "" - } - return g.Qr -} - -func (g *GetTokenByPinIDAuthPinContainer) GetClientIdentifier() string { - if g == nil { - return "" - } - return g.ClientIdentifier -} - -func (g *GetTokenByPinIDAuthPinContainer) GetLocation() GetTokenByPinIDGeoData { - if g == nil { - return GetTokenByPinIDGeoData{} - } - return g.Location -} - -func (g *GetTokenByPinIDAuthPinContainer) GetExpiresIn() *int64 { - if g == nil { - return nil - } - return g.ExpiresIn -} - -func (g *GetTokenByPinIDAuthPinContainer) GetCreatedAt() time.Time { - if g == nil { - return time.Time{} - } - return g.CreatedAt -} - -func (g *GetTokenByPinIDAuthPinContainer) GetExpiresAt() time.Time { - if g == nil { - return time.Time{} - } - return g.ExpiresAt -} - -func (g *GetTokenByPinIDAuthPinContainer) GetAuthToken() *string { - if g == nil { - return nil - } - return g.AuthToken -} - -func (g *GetTokenByPinIDAuthPinContainer) GetNewRegistration() any { - if g == nil { - return nil - } - return g.NewRegistration -} - -type GetTokenByPinIDResponse 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 Pin with a non-null authToken when it has been verified by the user - AuthPinContainer *GetTokenByPinIDAuthPinContainer -} - -func (g *GetTokenByPinIDResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetTokenByPinIDResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetTokenByPinIDResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetTokenByPinIDResponse) GetAuthPinContainer() *GetTokenByPinIDAuthPinContainer { - if g == nil { - return nil - } - return g.AuthPinContainer -} diff --git a/models/operations/gettokendetails.go b/models/operations/gettokendetails.go deleted file mode 100644 index 3a68faf..0000000 --- a/models/operations/gettokendetails.go +++ /dev/null @@ -1,854 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" -) - -var GetTokenDetailsServerList = []string{ - "https://plex.tv/api/v2", -} - -// MailingListStatus - Your current mailing list status (active or unsubscribed) -type MailingListStatus string - -const ( - MailingListStatusActive MailingListStatus = "active" - MailingListStatusUnsubscribed MailingListStatus = "unsubscribed" -) - -func (e MailingListStatus) ToPointer() *MailingListStatus { - return &e -} - -// AutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) -type AutoSelectSubtitle int - -const ( - AutoSelectSubtitleDisable AutoSelectSubtitle = 0 - AutoSelectSubtitleEnable AutoSelectSubtitle = 1 -) - -func (e AutoSelectSubtitle) ToPointer() *AutoSelectSubtitle { - return &e -} -func (e *AutoSelectSubtitle) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AutoSelectSubtitle(v) - return nil - default: - return fmt.Errorf("invalid value for AutoSelectSubtitle: %v", v) - } -} - -// DefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) -type DefaultSubtitleAccessibility int - -const ( - DefaultSubtitleAccessibilityDisable DefaultSubtitleAccessibility = 0 - DefaultSubtitleAccessibilityEnable DefaultSubtitleAccessibility = 1 -) - -func (e DefaultSubtitleAccessibility) ToPointer() *DefaultSubtitleAccessibility { - return &e -} -func (e *DefaultSubtitleAccessibility) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = DefaultSubtitleAccessibility(v) - return nil - default: - return fmt.Errorf("invalid value for DefaultSubtitleAccessibility: %v", v) - } -} - -// DefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) -type DefaultSubtitleForced int - -const ( - DefaultSubtitleForcedDisable DefaultSubtitleForced = 0 - DefaultSubtitleForcedEnable DefaultSubtitleForced = 1 -) - -func (e DefaultSubtitleForced) ToPointer() *DefaultSubtitleForced { - return &e -} -func (e *DefaultSubtitleForced) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = DefaultSubtitleForced(v) - return nil - default: - return fmt.Errorf("invalid value for DefaultSubtitleForced: %v", v) - } -} - -// WatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media) -type WatchedIndicator int - -const ( - WatchedIndicatorDisable WatchedIndicator = 0 - WatchedIndicatorEnable WatchedIndicator = 1 -) - -func (e WatchedIndicator) ToPointer() *WatchedIndicator { - return &e -} -func (e *WatchedIndicator) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = WatchedIndicator(v) - return nil - default: - return fmt.Errorf("invalid value for WatchedIndicator: %v", v) - } -} - -// MediaReviewsVisibility - Whether or not the account has media reviews visibility enabled -type MediaReviewsVisibility int - -const ( - MediaReviewsVisibilityDisable MediaReviewsVisibility = 0 - MediaReviewsVisibilityEnable MediaReviewsVisibility = 1 -) - -func (e MediaReviewsVisibility) ToPointer() *MediaReviewsVisibility { - return &e -} -func (e *MediaReviewsVisibility) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = MediaReviewsVisibility(v) - return nil - default: - return fmt.Errorf("invalid value for MediaReviewsVisibility: %v", v) - } -} - -type UserProfile struct { - // If the account has automatically select audio and subtitle tracks enabled - AutoSelectAudio *bool `default:"true" json:"autoSelectAudio"` - // The preferred audio language for the account - DefaultAudioLanguage *string `json:"defaultAudioLanguage"` - // The preferred subtitle language for the account - DefaultSubtitleLanguage *string `json:"defaultSubtitleLanguage"` - AutoSelectSubtitle *AutoSelectSubtitle `default:"0" json:"autoSelectSubtitle"` - DefaultSubtitleAccessibility *DefaultSubtitleAccessibility `default:"0" json:"defaultSubtitleAccessibility"` - DefaultSubtitleForced *DefaultSubtitleForced `default:"0" json:"defaultSubtitleForced"` - WatchedIndicator *WatchedIndicator `default:"0" json:"watchedIndicator"` - MediaReviewsVisibility *MediaReviewsVisibility `default:"0" json:"mediaReviewsVisibility"` -} - -func (u UserProfile) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UserProfile) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { - return err - } - return nil -} - -func (u *UserProfile) GetAutoSelectAudio() *bool { - if u == nil { - return nil - } - return u.AutoSelectAudio -} - -func (u *UserProfile) GetDefaultAudioLanguage() *string { - if u == nil { - return nil - } - return u.DefaultAudioLanguage -} - -func (u *UserProfile) GetDefaultSubtitleLanguage() *string { - if u == nil { - return nil - } - return u.DefaultSubtitleLanguage -} - -func (u *UserProfile) GetAutoSelectSubtitle() *AutoSelectSubtitle { - if u == nil { - return nil - } - return u.AutoSelectSubtitle -} - -func (u *UserProfile) GetDefaultSubtitleAccessibility() *DefaultSubtitleAccessibility { - if u == nil { - return nil - } - return u.DefaultSubtitleAccessibility -} - -func (u *UserProfile) GetDefaultSubtitleForced() *DefaultSubtitleForced { - if u == nil { - return nil - } - return u.DefaultSubtitleForced -} - -func (u *UserProfile) GetWatchedIndicator() *WatchedIndicator { - if u == nil { - return nil - } - return u.WatchedIndicator -} - -func (u *UserProfile) GetMediaReviewsVisibility() *MediaReviewsVisibility { - if u == nil { - return nil - } - return u.MediaReviewsVisibility -} - -type GetTokenDetailsStatus string - -const ( - GetTokenDetailsStatusOnline GetTokenDetailsStatus = "online" - GetTokenDetailsStatusOffline GetTokenDetailsStatus = "offline" -) - -func (e GetTokenDetailsStatus) ToPointer() *GetTokenDetailsStatus { - return &e -} - -type Services struct { - Identifier string `json:"identifier"` - Endpoint string `json:"endpoint"` - Token *string `json:"token"` - Secret *string `json:"secret"` - Status GetTokenDetailsStatus `json:"status"` -} - -func (s *Services) GetIdentifier() string { - if s == nil { - return "" - } - return s.Identifier -} - -func (s *Services) GetEndpoint() string { - if s == nil { - return "" - } - return s.Endpoint -} - -func (s *Services) GetToken() *string { - if s == nil { - return nil - } - return s.Token -} - -func (s *Services) GetSecret() *string { - if s == nil { - return nil - } - return s.Secret -} - -func (s *Services) GetStatus() GetTokenDetailsStatus { - if s == nil { - return GetTokenDetailsStatus("") - } - return s.Status -} - -// GetTokenDetailsAuthenticationStatus - String representation of subscriptionActive -type GetTokenDetailsAuthenticationStatus string - -const ( - GetTokenDetailsAuthenticationStatusInactive GetTokenDetailsAuthenticationStatus = "Inactive" - GetTokenDetailsAuthenticationStatusActive GetTokenDetailsAuthenticationStatus = "Active" -) - -func (e GetTokenDetailsAuthenticationStatus) ToPointer() *GetTokenDetailsAuthenticationStatus { - return &e -} - -// Subscription - If the account’s Plex Pass subscription is active -type Subscription struct { - // List of features allowed on your Plex Pass subscription - Features []string `json:"features,omitempty"` - // If the account's Plex Pass subscription is active - Active *bool `json:"active,omitempty"` - // Date the account subscribed to Plex Pass - SubscribedAt *string `json:"subscribedAt,omitempty"` - // String representation of subscriptionActive - Status *GetTokenDetailsAuthenticationStatus `json:"status,omitempty"` - // Payment service used for your Plex Pass subscription - PaymentService *string `json:"paymentService,omitempty"` - // Name of Plex Pass subscription plan - Plan *string `json:"plan,omitempty"` -} - -func (s *Subscription) GetFeatures() []string { - if s == nil { - return nil - } - return s.Features -} - -func (s *Subscription) GetActive() *bool { - if s == nil { - return nil - } - return s.Active -} - -func (s *Subscription) GetSubscribedAt() *string { - if s == nil { - return nil - } - return s.SubscribedAt -} - -func (s *Subscription) GetStatus() *GetTokenDetailsAuthenticationStatus { - if s == nil { - return nil - } - return s.Status -} - -func (s *Subscription) GetPaymentService() *string { - if s == nil { - return nil - } - return s.PaymentService -} - -func (s *Subscription) GetPlan() *string { - if s == nil { - return nil - } - return s.Plan -} - -// GetTokenDetailsAuthenticationResponseStatus - String representation of subscriptionActive -type GetTokenDetailsAuthenticationResponseStatus string - -const ( - GetTokenDetailsAuthenticationResponseStatusInactive GetTokenDetailsAuthenticationResponseStatus = "Inactive" - GetTokenDetailsAuthenticationResponseStatusActive GetTokenDetailsAuthenticationResponseStatus = "Active" -) - -func (e GetTokenDetailsAuthenticationResponseStatus) ToPointer() *GetTokenDetailsAuthenticationResponseStatus { - return &e -} - -type GetTokenDetailsSubscription struct { - // List of features allowed on your Plex Pass subscription - Features []string `json:"features,omitempty"` - // If the account's Plex Pass subscription is active - Active *bool `json:"active,omitempty"` - // Date the account subscribed to Plex Pass - SubscribedAt *string `json:"subscribedAt,omitempty"` - // String representation of subscriptionActive - Status *GetTokenDetailsAuthenticationResponseStatus `json:"status,omitempty"` - // Payment service used for your Plex Pass subscription - PaymentService *string `json:"paymentService,omitempty"` - // Name of Plex Pass subscription plan - Plan *string `json:"plan,omitempty"` -} - -func (g *GetTokenDetailsSubscription) GetFeatures() []string { - if g == nil { - return nil - } - return g.Features -} - -func (g *GetTokenDetailsSubscription) GetActive() *bool { - if g == nil { - return nil - } - return g.Active -} - -func (g *GetTokenDetailsSubscription) GetSubscribedAt() *string { - if g == nil { - return nil - } - return g.SubscribedAt -} - -func (g *GetTokenDetailsSubscription) GetStatus() *GetTokenDetailsAuthenticationResponseStatus { - if g == nil { - return nil - } - return g.Status -} - -func (g *GetTokenDetailsSubscription) GetPaymentService() *string { - if g == nil { - return nil - } - return g.PaymentService -} - -func (g *GetTokenDetailsSubscription) GetPlan() *string { - if g == nil { - return nil - } - return g.Plan -} - -// GetTokenDetailsUserPlexAccount - Logged in user details -type GetTokenDetailsUserPlexAccount struct { - // Unknown - AdsConsent *bool `json:"adsConsent"` - AdsConsentReminderAt *int64 `json:"adsConsentReminderAt"` - AdsConsentSetAt *int64 `json:"adsConsentSetAt"` - // Unknown - Anonymous *bool `default:"false" json:"anonymous"` - // The account token - AuthToken string `json:"authToken"` - // If the two-factor authentication backup codes have been created - BackupCodesCreated *bool `default:"false" json:"backupCodesCreated"` - // If the account has been confirmed - Confirmed *bool `default:"false" json:"confirmed"` - // The account country - Country string `json:"country"` - // The account email address - Email string `json:"email"` - // If login with email only is enabled - EmailOnlyAuth *bool `default:"false" json:"emailOnlyAuth"` - // If experimental features are enabled - ExperimentalFeatures *bool `default:"false" json:"experimentalFeatures"` - // Your account full name - FriendlyName string `json:"friendlyName"` - // List of devices your allowed to use with this account - Entitlements []string `json:"entitlements"` - // If the account is a Plex Home guest user - Guest *bool `default:"false" json:"guest"` - // If the account has a password - HasPassword *bool `default:"true" json:"hasPassword"` - // If the account is a Plex Home user - Home *bool `default:"false" json:"home"` - // If the account is the Plex Home admin - HomeAdmin *bool `default:"false" json:"homeAdmin"` - // The number of accounts in the Plex Home - HomeSize int `json:"homeSize"` - // The Plex account ID - ID int `json:"id"` - // Unix epoch datetime in seconds - JoinedAt int64 `json:"joinedAt"` - // The account locale - Locale *string `json:"locale"` - // If you are subscribed to the Plex newsletter - MailingListActive *bool `default:"false" json:"mailingListActive"` - // Your current mailing list status (active or unsubscribed) - MailingListStatus MailingListStatus `json:"mailingListStatus"` - // The maximum number of accounts allowed in the Plex Home - MaxHomeSize int `json:"maxHomeSize"` - // [Might be removed] The hashed Plex Home PIN - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Pin *string `json:"pin,omitempty"` - Profile UserProfile `json:"profile"` - // If the account has a Plex Home PIN enabled - Protected *bool `default:"false" json:"protected"` - // Unix epoch datetime in seconds - RememberExpiresAt int64 `json:"rememberExpiresAt"` - // If the account is a Plex Home managed user - Restricted *bool `default:"false" json:"restricted"` - // [Might be removed] List of account roles. Plexpass membership listed here - Roles []string `json:"roles,omitempty"` - // Unknown - ScrobbleTypes string `json:"scrobbleTypes"` - Services []Services `json:"services"` - // If the account’s Plex Pass subscription is active - Subscription Subscription `json:"subscription"` - // Description of the Plex Pass subscription - SubscriptionDescription *string `json:"subscriptionDescription"` - Subscriptions []GetTokenDetailsSubscription `json:"subscriptions,omitempty"` - // URL of the account thumbnail - Thumb string `json:"thumb"` - // The title of the account (username or friendly name) - Title string `json:"title"` - // If two-factor authentication is enabled - TwoFactorEnabled *bool `default:"false" json:"twoFactorEnabled"` - // The account username - Username string `json:"username"` - // The account UUID - UUID string `json:"uuid"` - AttributionPartner *string `json:"attributionPartner"` -} - -func (g GetTokenDetailsUserPlexAccount) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetTokenDetailsUserPlexAccount) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"authToken", "country", "email", "friendlyName", "entitlements", "homeSize", "id", "joinedAt", "mailingListStatus", "maxHomeSize", "profile", "rememberExpiresAt", "scrobbleTypes", "services", "subscription", "thumb", "title", "username", "uuid"}); err != nil { - return err - } - return nil -} - -func (g *GetTokenDetailsUserPlexAccount) GetAdsConsent() *bool { - if g == nil { - return nil - } - return g.AdsConsent -} - -func (g *GetTokenDetailsUserPlexAccount) GetAdsConsentReminderAt() *int64 { - if g == nil { - return nil - } - return g.AdsConsentReminderAt -} - -func (g *GetTokenDetailsUserPlexAccount) GetAdsConsentSetAt() *int64 { - if g == nil { - return nil - } - return g.AdsConsentSetAt -} - -func (g *GetTokenDetailsUserPlexAccount) GetAnonymous() *bool { - if g == nil { - return nil - } - return g.Anonymous -} - -func (g *GetTokenDetailsUserPlexAccount) GetAuthToken() string { - if g == nil { - return "" - } - return g.AuthToken -} - -func (g *GetTokenDetailsUserPlexAccount) GetBackupCodesCreated() *bool { - if g == nil { - return nil - } - return g.BackupCodesCreated -} - -func (g *GetTokenDetailsUserPlexAccount) GetConfirmed() *bool { - if g == nil { - return nil - } - return g.Confirmed -} - -func (g *GetTokenDetailsUserPlexAccount) GetCountry() string { - if g == nil { - return "" - } - return g.Country -} - -func (g *GetTokenDetailsUserPlexAccount) GetEmail() string { - if g == nil { - return "" - } - return g.Email -} - -func (g *GetTokenDetailsUserPlexAccount) GetEmailOnlyAuth() *bool { - if g == nil { - return nil - } - return g.EmailOnlyAuth -} - -func (g *GetTokenDetailsUserPlexAccount) GetExperimentalFeatures() *bool { - if g == nil { - return nil - } - return g.ExperimentalFeatures -} - -func (g *GetTokenDetailsUserPlexAccount) GetFriendlyName() string { - if g == nil { - return "" - } - return g.FriendlyName -} - -func (g *GetTokenDetailsUserPlexAccount) GetEntitlements() []string { - if g == nil { - return []string{} - } - return g.Entitlements -} - -func (g *GetTokenDetailsUserPlexAccount) GetGuest() *bool { - if g == nil { - return nil - } - return g.Guest -} - -func (g *GetTokenDetailsUserPlexAccount) GetHasPassword() *bool { - if g == nil { - return nil - } - return g.HasPassword -} - -func (g *GetTokenDetailsUserPlexAccount) GetHome() *bool { - if g == nil { - return nil - } - return g.Home -} - -func (g *GetTokenDetailsUserPlexAccount) GetHomeAdmin() *bool { - if g == nil { - return nil - } - return g.HomeAdmin -} - -func (g *GetTokenDetailsUserPlexAccount) GetHomeSize() int { - if g == nil { - return 0 - } - return g.HomeSize -} - -func (g *GetTokenDetailsUserPlexAccount) GetID() int { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetTokenDetailsUserPlexAccount) GetJoinedAt() int64 { - if g == nil { - return 0 - } - return g.JoinedAt -} - -func (g *GetTokenDetailsUserPlexAccount) GetLocale() *string { - if g == nil { - return nil - } - return g.Locale -} - -func (g *GetTokenDetailsUserPlexAccount) GetMailingListActive() *bool { - if g == nil { - return nil - } - return g.MailingListActive -} - -func (g *GetTokenDetailsUserPlexAccount) GetMailingListStatus() MailingListStatus { - if g == nil { - return MailingListStatus("") - } - return g.MailingListStatus -} - -func (g *GetTokenDetailsUserPlexAccount) GetMaxHomeSize() int { - if g == nil { - return 0 - } - return g.MaxHomeSize -} - -func (g *GetTokenDetailsUserPlexAccount) GetPin() *string { - if g == nil { - return nil - } - return g.Pin -} - -func (g *GetTokenDetailsUserPlexAccount) GetProfile() UserProfile { - if g == nil { - return UserProfile{} - } - return g.Profile -} - -func (g *GetTokenDetailsUserPlexAccount) GetProtected() *bool { - if g == nil { - return nil - } - return g.Protected -} - -func (g *GetTokenDetailsUserPlexAccount) GetRememberExpiresAt() int64 { - if g == nil { - return 0 - } - return g.RememberExpiresAt -} - -func (g *GetTokenDetailsUserPlexAccount) GetRestricted() *bool { - if g == nil { - return nil - } - return g.Restricted -} - -func (g *GetTokenDetailsUserPlexAccount) GetRoles() []string { - if g == nil { - return nil - } - return g.Roles -} - -func (g *GetTokenDetailsUserPlexAccount) GetScrobbleTypes() string { - if g == nil { - return "" - } - return g.ScrobbleTypes -} - -func (g *GetTokenDetailsUserPlexAccount) GetServices() []Services { - if g == nil { - return []Services{} - } - return g.Services -} - -func (g *GetTokenDetailsUserPlexAccount) GetSubscription() Subscription { - if g == nil { - return Subscription{} - } - return g.Subscription -} - -func (g *GetTokenDetailsUserPlexAccount) GetSubscriptionDescription() *string { - if g == nil { - return nil - } - return g.SubscriptionDescription -} - -func (g *GetTokenDetailsUserPlexAccount) GetSubscriptions() []GetTokenDetailsSubscription { - if g == nil { - return nil - } - return g.Subscriptions -} - -func (g *GetTokenDetailsUserPlexAccount) GetThumb() string { - if g == nil { - return "" - } - return g.Thumb -} - -func (g *GetTokenDetailsUserPlexAccount) GetTitle() string { - if g == nil { - return "" - } - return g.Title -} - -func (g *GetTokenDetailsUserPlexAccount) GetTwoFactorEnabled() *bool { - if g == nil { - return nil - } - return g.TwoFactorEnabled -} - -func (g *GetTokenDetailsUserPlexAccount) GetUsername() string { - if g == nil { - return "" - } - return g.Username -} - -func (g *GetTokenDetailsUserPlexAccount) GetUUID() string { - if g == nil { - return "" - } - return g.UUID -} - -func (g *GetTokenDetailsUserPlexAccount) GetAttributionPartner() *string { - if g == nil { - return nil - } - return g.AttributionPartner -} - -type GetTokenDetailsResponse 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 - // Logged in user details - UserPlexAccount *GetTokenDetailsUserPlexAccount -} - -func (g *GetTokenDetailsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetTokenDetailsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetTokenDetailsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetTokenDetailsResponse) GetUserPlexAccount() *GetTokenDetailsUserPlexAccount { - if g == nil { - return nil - } - return g.UserPlexAccount -} diff --git a/models/operations/gettopwatchedcontent.go b/models/operations/gettopwatchedcontent.go deleted file mode 100644 index 4e3011b..0000000 --- a/models/operations/gettopwatchedcontent.go +++ /dev/null @@ -1,605 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -// GetTopWatchedContentQueryParamType - The type of media to retrieve or filter by. -// 1 = movie -// 2 = show -// 3 = season -// 4 = episode -// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries -type GetTopWatchedContentQueryParamType int64 - -const ( - GetTopWatchedContentQueryParamTypeMovie GetTopWatchedContentQueryParamType = 1 - GetTopWatchedContentQueryParamTypeTvShow GetTopWatchedContentQueryParamType = 2 - GetTopWatchedContentQueryParamTypeSeason GetTopWatchedContentQueryParamType = 3 - GetTopWatchedContentQueryParamTypeEpisode GetTopWatchedContentQueryParamType = 4 - GetTopWatchedContentQueryParamTypeArtist GetTopWatchedContentQueryParamType = 5 - GetTopWatchedContentQueryParamTypeAlbum GetTopWatchedContentQueryParamType = 6 - GetTopWatchedContentQueryParamTypeTrack GetTopWatchedContentQueryParamType = 7 - GetTopWatchedContentQueryParamTypePhotoAlbum GetTopWatchedContentQueryParamType = 8 - GetTopWatchedContentQueryParamTypePhoto GetTopWatchedContentQueryParamType = 9 -) - -func (e GetTopWatchedContentQueryParamType) ToPointer() *GetTopWatchedContentQueryParamType { - return &e -} - -// GetTopWatchedContentQueryParamIncludeGuids - Adds the Guid object to the response -type GetTopWatchedContentQueryParamIncludeGuids int - -const ( - GetTopWatchedContentQueryParamIncludeGuidsDisable GetTopWatchedContentQueryParamIncludeGuids = 0 - GetTopWatchedContentQueryParamIncludeGuidsEnable GetTopWatchedContentQueryParamIncludeGuids = 1 -) - -func (e GetTopWatchedContentQueryParamIncludeGuids) ToPointer() *GetTopWatchedContentQueryParamIncludeGuids { - return &e -} -func (e *GetTopWatchedContentQueryParamIncludeGuids) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = GetTopWatchedContentQueryParamIncludeGuids(v) - return nil - default: - return fmt.Errorf("invalid value for GetTopWatchedContentQueryParamIncludeGuids: %v", v) - } -} - -type GetTopWatchedContentRequest struct { - // The type of media to retrieve or filter by. - // 1 = movie - // 2 = show - // 3 = season - // 4 = episode - // E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - // - Type GetTopWatchedContentQueryParamType `queryParam:"style=form,explode=true,name=type"` - // Adds the Guid object to the response - // - IncludeGuids *GetTopWatchedContentQueryParamIncludeGuids `default:"0" queryParam:"style=form,explode=true,name=includeGuids"` -} - -func (g GetTopWatchedContentRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetTopWatchedContentRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type"}); err != nil { - return err - } - return nil -} - -func (g *GetTopWatchedContentRequest) GetType() GetTopWatchedContentQueryParamType { - if g == nil { - return GetTopWatchedContentQueryParamType(0) - } - return g.Type -} - -func (g *GetTopWatchedContentRequest) GetIncludeGuids() *GetTopWatchedContentQueryParamIncludeGuids { - if g == nil { - return nil - } - return g.IncludeGuids -} - -type GetTopWatchedContentGenre struct { - ID *int `json:"id,omitempty"` - Filter *string `json:"filter,omitempty"` - Tag *string `json:"tag,omitempty"` -} - -func (g *GetTopWatchedContentGenre) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetTopWatchedContentGenre) GetFilter() *string { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetTopWatchedContentGenre) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetTopWatchedContentCountry struct { - ID *int `json:"id,omitempty"` - Filter *string `json:"filter,omitempty"` - Tag *string `json:"tag,omitempty"` -} - -func (g *GetTopWatchedContentCountry) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetTopWatchedContentCountry) GetFilter() *string { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetTopWatchedContentCountry) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -type GetTopWatchedContentGuids struct { - ID *string `json:"id,omitempty"` -} - -func (g *GetTopWatchedContentGuids) GetID() *string { - if g == nil { - return nil - } - return g.ID -} - -type GetTopWatchedContentRole struct { - ID *int `json:"id,omitempty"` - Filter *string `json:"filter,omitempty"` - Tag *string `json:"tag,omitempty"` - TagKey *string `json:"tagKey,omitempty"` - Role *string `json:"role,omitempty"` - Thumb *string `json:"thumb,omitempty"` -} - -func (g *GetTopWatchedContentRole) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -func (g *GetTopWatchedContentRole) GetFilter() *string { - if g == nil { - return nil - } - return g.Filter -} - -func (g *GetTopWatchedContentRole) GetTag() *string { - if g == nil { - return nil - } - return g.Tag -} - -func (g *GetTopWatchedContentRole) GetTagKey() *string { - if g == nil { - return nil - } - return g.TagKey -} - -func (g *GetTopWatchedContentRole) GetRole() *string { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetTopWatchedContentRole) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -type GetTopWatchedContentUser struct { - ID *int `json:"id,omitempty"` -} - -func (g *GetTopWatchedContentUser) GetID() *int { - if g == nil { - return nil - } - return g.ID -} - -type GetTopWatchedContentMetadata struct { - RatingKey *string `json:"ratingKey,omitempty"` - Key *string `json:"key,omitempty"` - GUID *string `json:"guid,omitempty"` - Slug *string `json:"slug,omitempty"` - Studio *string `json:"studio,omitempty"` - Type *string `json:"type,omitempty"` - Title *string `json:"title,omitempty"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - LibrarySectionID *int `json:"librarySectionID,omitempty"` - LibrarySectionKey *string `json:"librarySectionKey,omitempty"` - ContentRating *string `json:"contentRating,omitempty"` - Summary *string `json:"summary,omitempty"` - Index *int64 `json:"index,omitempty"` - AudienceRating *float64 `json:"audienceRating,omitempty"` - Year *int `json:"year,omitempty"` - Tagline *string `json:"tagline,omitempty"` - Thumb *string `json:"thumb,omitempty"` - Art *string `json:"art,omitempty"` - Duration *int `json:"duration,omitempty"` - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - LeafCount *int64 `json:"leafCount,omitempty"` - ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` - ChildCount *int64 `json:"childCount,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - UpdatedAt *int `json:"updatedAt,omitempty"` - GlobalViewCount *int64 `json:"globalViewCount,omitempty"` - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - Genre []GetTopWatchedContentGenre `json:"Genre,omitempty"` - Country []GetTopWatchedContentCountry `json:"Country,omitempty"` - Guids []GetTopWatchedContentGuids `json:"Guid,omitempty"` - Role []GetTopWatchedContentRole `json:"Role,omitempty"` - User []GetTopWatchedContentUser `json:"User,omitempty"` -} - -func (g GetTopWatchedContentMetadata) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetTopWatchedContentMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetTopWatchedContentMetadata) GetRatingKey() *string { - if g == nil { - return nil - } - return g.RatingKey -} - -func (g *GetTopWatchedContentMetadata) GetKey() *string { - if g == nil { - return nil - } - return g.Key -} - -func (g *GetTopWatchedContentMetadata) GetGUID() *string { - if g == nil { - return nil - } - return g.GUID -} - -func (g *GetTopWatchedContentMetadata) GetSlug() *string { - if g == nil { - return nil - } - return g.Slug -} - -func (g *GetTopWatchedContentMetadata) GetStudio() *string { - if g == nil { - return nil - } - return g.Studio -} - -func (g *GetTopWatchedContentMetadata) GetType() *string { - if g == nil { - return nil - } - return g.Type -} - -func (g *GetTopWatchedContentMetadata) GetTitle() *string { - if g == nil { - return nil - } - return g.Title -} - -func (g *GetTopWatchedContentMetadata) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetTopWatchedContentMetadata) GetLibrarySectionID() *int { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetTopWatchedContentMetadata) GetLibrarySectionKey() *string { - if g == nil { - return nil - } - return g.LibrarySectionKey -} - -func (g *GetTopWatchedContentMetadata) GetContentRating() *string { - if g == nil { - return nil - } - return g.ContentRating -} - -func (g *GetTopWatchedContentMetadata) GetSummary() *string { - if g == nil { - return nil - } - return g.Summary -} - -func (g *GetTopWatchedContentMetadata) GetIndex() *int64 { - if g == nil { - return nil - } - return g.Index -} - -func (g *GetTopWatchedContentMetadata) GetAudienceRating() *float64 { - if g == nil { - return nil - } - return g.AudienceRating -} - -func (g *GetTopWatchedContentMetadata) GetYear() *int { - if g == nil { - return nil - } - return g.Year -} - -func (g *GetTopWatchedContentMetadata) GetTagline() *string { - if g == nil { - return nil - } - return g.Tagline -} - -func (g *GetTopWatchedContentMetadata) GetThumb() *string { - if g == nil { - return nil - } - return g.Thumb -} - -func (g *GetTopWatchedContentMetadata) GetArt() *string { - if g == nil { - return nil - } - return g.Art -} - -func (g *GetTopWatchedContentMetadata) GetDuration() *int { - if g == nil { - return nil - } - return g.Duration -} - -func (g *GetTopWatchedContentMetadata) GetOriginallyAvailableAt() *types.Date { - if g == nil { - return nil - } - return g.OriginallyAvailableAt -} - -func (g *GetTopWatchedContentMetadata) GetLeafCount() *int64 { - if g == nil { - return nil - } - return g.LeafCount -} - -func (g *GetTopWatchedContentMetadata) GetViewedLeafCount() *int64 { - if g == nil { - return nil - } - return g.ViewedLeafCount -} - -func (g *GetTopWatchedContentMetadata) GetChildCount() *int64 { - if g == nil { - return nil - } - return g.ChildCount -} - -func (g *GetTopWatchedContentMetadata) GetAddedAt() *int { - if g == nil { - return nil - } - return g.AddedAt -} - -func (g *GetTopWatchedContentMetadata) GetUpdatedAt() *int { - if g == nil { - return nil - } - return g.UpdatedAt -} - -func (g *GetTopWatchedContentMetadata) GetGlobalViewCount() *int64 { - if g == nil { - return nil - } - return g.GlobalViewCount -} - -func (g *GetTopWatchedContentMetadata) GetAudienceRatingImage() *string { - if g == nil { - return nil - } - return g.AudienceRatingImage -} - -func (g *GetTopWatchedContentMetadata) GetGenre() []GetTopWatchedContentGenre { - if g == nil { - return nil - } - return g.Genre -} - -func (g *GetTopWatchedContentMetadata) GetCountry() []GetTopWatchedContentCountry { - if g == nil { - return nil - } - return g.Country -} - -func (g *GetTopWatchedContentMetadata) GetGuids() []GetTopWatchedContentGuids { - if g == nil { - return nil - } - return g.Guids -} - -func (g *GetTopWatchedContentMetadata) GetRole() []GetTopWatchedContentRole { - if g == nil { - return nil - } - return g.Role -} - -func (g *GetTopWatchedContentMetadata) GetUser() []GetTopWatchedContentUser { - if g == nil { - return nil - } - return g.User -} - -type GetTopWatchedContentMediaContainer struct { - // Number of media items returned in this response. - Size int `json:"size"` - // Indicates whether syncing is allowed. - AllowSync bool `json:"allowSync"` - // An plugin identifier for the media container. - Identifier string `json:"identifier"` - // The prefix used for media tag resource paths. - MediaTagPrefix string `json:"mediaTagPrefix"` - // The version number for media tags. - MediaTagVersion int64 `json:"mediaTagVersion"` - Metadata []GetTopWatchedContentMetadata `json:"Metadata,omitempty"` -} - -func (g *GetTopWatchedContentMediaContainer) GetSize() int { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetTopWatchedContentMediaContainer) GetAllowSync() bool { - if g == nil { - return false - } - return g.AllowSync -} - -func (g *GetTopWatchedContentMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetTopWatchedContentMediaContainer) GetMediaTagPrefix() string { - if g == nil { - return "" - } - return g.MediaTagPrefix -} - -func (g *GetTopWatchedContentMediaContainer) GetMediaTagVersion() int64 { - if g == nil { - return 0 - } - return g.MediaTagVersion -} - -func (g *GetTopWatchedContentMediaContainer) GetMetadata() []GetTopWatchedContentMetadata { - if g == nil { - return nil - } - return g.Metadata -} - -// GetTopWatchedContentResponseBody - The metadata of the library item. -type GetTopWatchedContentResponseBody struct { - MediaContainer *GetTopWatchedContentMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetTopWatchedContentResponseBody) GetMediaContainer() *GetTopWatchedContentMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetTopWatchedContentResponse 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 metadata of the library item. - Object *GetTopWatchedContentResponseBody -} - -func (g *GetTopWatchedContentResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetTopWatchedContentResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetTopWatchedContentResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetTopWatchedContentResponse) GetObject() *GetTopWatchedContentResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/gettranscodesessions.go b/models/operations/gettranscodesessions.go deleted file mode 100644 index bd6c01a..0000000 --- a/models/operations/gettranscodesessions.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 *int `json:"size,omitempty"` - Speed *float64 `json:"speed,omitempty"` - Error *bool `json:"error,omitempty"` - Duration *int `json:"duration,omitempty"` - Remaining *int `json:"remaining,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"` - SubtitleDecision *string `json:"subtitleDecision,omitempty"` - Protocol *string `json:"protocol,omitempty"` - Container *string `json:"container,omitempty"` - VideoCodec *string `json:"videoCodec,omitempty"` - AudioCodec *string `json:"audioCodec,omitempty"` - AudioChannels *int `json:"audioChannels,omitempty"` - TranscodeHwRequested *bool `json:"transcodeHwRequested,omitempty"` - TimeStamp *float64 `json:"timeStamp,omitempty"` - MaxOffsetAvailable *float64 `json:"maxOffsetAvailable,omitempty"` - MinOffsetAvailable *float64 `json:"minOffsetAvailable,omitempty"` -} - -func (t *TranscodeSession) GetKey() *string { - if t == nil { - return nil - } - return t.Key -} - -func (t *TranscodeSession) GetThrottled() *bool { - if t == nil { - return nil - } - return t.Throttled -} - -func (t *TranscodeSession) GetComplete() *bool { - if t == nil { - return nil - } - return t.Complete -} - -func (t *TranscodeSession) GetProgress() *float64 { - if t == nil { - return nil - } - return t.Progress -} - -func (t *TranscodeSession) GetSize() *int { - if t == nil { - return nil - } - return t.Size -} - -func (t *TranscodeSession) GetSpeed() *float64 { - if t == nil { - return nil - } - return t.Speed -} - -func (t *TranscodeSession) GetError() *bool { - if t == nil { - return nil - } - return t.Error -} - -func (t *TranscodeSession) GetDuration() *int { - if t == nil { - return nil - } - return t.Duration -} - -func (t *TranscodeSession) GetRemaining() *int { - if t == nil { - return nil - } - return t.Remaining -} - -func (t *TranscodeSession) GetContext() *string { - if t == nil { - return nil - } - return t.Context -} - -func (t *TranscodeSession) GetSourceVideoCodec() *string { - if t == nil { - return nil - } - return t.SourceVideoCodec -} - -func (t *TranscodeSession) GetSourceAudioCodec() *string { - if t == nil { - return nil - } - return t.SourceAudioCodec -} - -func (t *TranscodeSession) GetVideoDecision() *string { - if t == nil { - return nil - } - return t.VideoDecision -} - -func (t *TranscodeSession) GetAudioDecision() *string { - if t == nil { - return nil - } - return t.AudioDecision -} - -func (t *TranscodeSession) GetSubtitleDecision() *string { - if t == nil { - return nil - } - return t.SubtitleDecision -} - -func (t *TranscodeSession) GetProtocol() *string { - if t == nil { - return nil - } - return t.Protocol -} - -func (t *TranscodeSession) GetContainer() *string { - if t == nil { - return nil - } - return t.Container -} - -func (t *TranscodeSession) GetVideoCodec() *string { - if t == nil { - return nil - } - return t.VideoCodec -} - -func (t *TranscodeSession) GetAudioCodec() *string { - if t == nil { - return nil - } - return t.AudioCodec -} - -func (t *TranscodeSession) GetAudioChannels() *int { - if t == nil { - return nil - } - return t.AudioChannels -} - -func (t *TranscodeSession) GetTranscodeHwRequested() *bool { - if t == nil { - return nil - } - return t.TranscodeHwRequested -} - -func (t *TranscodeSession) GetTimeStamp() *float64 { - if t == nil { - return nil - } - return t.TimeStamp -} - -func (t *TranscodeSession) GetMaxOffsetAvailable() *float64 { - if t == nil { - return nil - } - return t.MaxOffsetAvailable -} - -func (t *TranscodeSession) GetMinOffsetAvailable() *float64 { - if t == nil { - return nil - } - return t.MinOffsetAvailable -} - -type GetTranscodeSessionsMediaContainer struct { - Size *int `json:"size,omitempty"` - TranscodeSession []TranscodeSession `json:"TranscodeSession,omitempty"` -} - -func (g *GetTranscodeSessionsMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetTranscodeSessionsMediaContainer) GetTranscodeSession() []TranscodeSession { - if g == nil { - return nil - } - return g.TranscodeSession -} - -// GetTranscodeSessionsResponseBody - The Transcode Sessions -type GetTranscodeSessionsResponseBody struct { - MediaContainer *GetTranscodeSessionsMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetTranscodeSessionsResponseBody) GetMediaContainer() *GetTranscodeSessionsMediaContainer { - if g == nil { - return nil - } - return g.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 (g *GetTranscodeSessionsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetTranscodeSessionsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetTranscodeSessionsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetTranscodeSessionsResponse) GetObject() *GetTranscodeSessionsResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/gettransienttoken.go b/models/operations/gettransienttoken.go index 9cf0775..0ad9084 100644 --- a/models/operations/gettransienttoken.go +++ b/models/operations/gettransienttoken.go @@ -5,34 +5,149 @@ package operations import ( "encoding/json" "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -// GetTransientTokenQueryParamType - `delegation` - This is the only supported `type` parameter. -type GetTransientTokenQueryParamType string +type GetTransientTokenGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (g GetTransientTokenGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTransientTokenGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetTransientTokenGlobals) GetAccepts() *components.Accepts { + if g == nil { + return nil + } + return g.Accepts +} + +func (g *GetTransientTokenGlobals) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetTransientTokenGlobals) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetTransientTokenGlobals) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetTransientTokenGlobals) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetTransientTokenGlobals) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetTransientTokenGlobals) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetTransientTokenGlobals) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetTransientTokenGlobals) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetTransientTokenGlobals) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetTransientTokenGlobals) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +// QueryParamType - The value `delegation` is the only supported `type` parameter. +type QueryParamType string const ( - GetTransientTokenQueryParamTypeDelegation GetTransientTokenQueryParamType = "delegation" + QueryParamTypeDelegation QueryParamType = "delegation" ) -func (e GetTransientTokenQueryParamType) ToPointer() *GetTransientTokenQueryParamType { +func (e QueryParamType) ToPointer() *QueryParamType { return &e } -func (e *GetTransientTokenQueryParamType) UnmarshalJSON(data []byte) error { +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 = GetTransientTokenQueryParamType(v) + *e = QueryParamType(v) return nil default: - return fmt.Errorf("invalid value for GetTransientTokenQueryParamType: %v", v) + return fmt.Errorf("invalid value for QueryParamType: %v", v) } } -// Scope - `all` - This is the only supported `scope` parameter. +// Scope - The value `all` is the only supported `scope` parameter. type Scope string const ( @@ -57,15 +172,125 @@ func (e *Scope) UnmarshalJSON(data []byte) error { } type GetTransientTokenRequest struct { - // `delegation` - This is the only supported `type` parameter. - Type GetTransientTokenQueryParamType `queryParam:"style=form,explode=true,name=type"` - // `all` - This is the only supported `scope` parameter. + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The value `delegation` is the only supported `type` parameter. + Type QueryParamType `queryParam:"style=form,explode=true,name=type"` + // The value `all` is the only supported `scope` parameter. Scope Scope `queryParam:"style=form,explode=true,name=scope"` } -func (g *GetTransientTokenRequest) GetType() GetTransientTokenQueryParamType { +func (g GetTransientTokenRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTransientTokenRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type", "scope"}); err != nil { + return err + } + return nil +} + +func (g *GetTransientTokenRequest) GetAccepts() *components.Accepts { if g == nil { - return GetTransientTokenQueryParamType("") + return nil + } + return g.Accepts +} + +func (g *GetTransientTokenRequest) GetClientIdentifier() *string { + if g == nil { + return nil + } + return g.ClientIdentifier +} + +func (g *GetTransientTokenRequest) GetProduct() *string { + if g == nil { + return nil + } + return g.Product +} + +func (g *GetTransientTokenRequest) GetVersion() *string { + if g == nil { + return nil + } + return g.Version +} + +func (g *GetTransientTokenRequest) GetPlatform() *string { + if g == nil { + return nil + } + return g.Platform +} + +func (g *GetTransientTokenRequest) GetPlatformVersion() *string { + if g == nil { + return nil + } + return g.PlatformVersion +} + +func (g *GetTransientTokenRequest) GetDevice() *string { + if g == nil { + return nil + } + return g.Device +} + +func (g *GetTransientTokenRequest) GetModel() *string { + if g == nil { + return nil + } + return g.Model +} + +func (g *GetTransientTokenRequest) GetDeviceVendor() *string { + if g == nil { + return nil + } + return g.DeviceVendor +} + +func (g *GetTransientTokenRequest) GetDeviceName() *string { + if g == nil { + return nil + } + return g.DeviceName +} + +func (g *GetTransientTokenRequest) GetMarketplace() *string { + if g == nil { + return nil + } + return g.Marketplace +} + +func (g *GetTransientTokenRequest) GetType() QueryParamType { + if g == nil { + return QueryParamType("") } return g.Type } @@ -77,6 +302,69 @@ func (g *GetTransientTokenRequest) GetScope() Scope { return g.Scope } +// GetTransientTokenMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type GetTransientTokenMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // The transient token + Token *string `json:"token,omitempty"` +} + +func (g *GetTransientTokenMediaContainer) GetIdentifier() *string { + if g == nil { + return nil + } + return g.Identifier +} + +func (g *GetTransientTokenMediaContainer) GetOffset() *int64 { + if g == nil { + return nil + } + return g.Offset +} + +func (g *GetTransientTokenMediaContainer) GetSize() *int64 { + if g == nil { + return nil + } + return g.Size +} + +func (g *GetTransientTokenMediaContainer) GetTotalSize() *int64 { + if g == nil { + return nil + } + return g.TotalSize +} + +func (g *GetTransientTokenMediaContainer) GetToken() *string { + if g == nil { + return nil + } + return g.Token +} + +// GetTransientTokenResponseBody - OK +type GetTransientTokenResponseBody struct { + MediaContainer *GetTransientTokenMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetTransientTokenResponseBody) GetMediaContainer() *GetTransientTokenMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + type GetTransientTokenResponse struct { // HTTP response content type for this operation ContentType string @@ -84,6 +372,8 @@ type GetTransientTokenResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response + // OK + Object *GetTransientTokenResponseBody } func (g *GetTransientTokenResponse) GetContentType() string { @@ -106,3 +396,10 @@ func (g *GetTransientTokenResponse) GetRawResponse() *http.Response { } return g.RawResponse } + +func (g *GetTransientTokenResponse) GetObject() *GetTransientTokenResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getupdatesstatus.go b/models/operations/getupdatesstatus.go new file mode 100644 index 0000000..396bc35 --- /dev/null +++ b/models/operations/getupdatesstatus.go @@ -0,0 +1,242 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// GetUpdatesStatusState - The status of this update. +// +// - available - This release is available +// - downloading - This release is downloading +// - downloaded - This release has been downloaded +// - installing - This release is installing +// - tonight - This release will be installed tonight +// - skipped - This release has been skipped +// - error - This release has an error +// - notify - This release is only notifying it is available (typically because it cannot be installed on this setup) +// - done - This release is complete +type GetUpdatesStatusState string + +const ( + GetUpdatesStatusStateAvailable GetUpdatesStatusState = "available" + GetUpdatesStatusStateDownloading GetUpdatesStatusState = "downloading" + GetUpdatesStatusStateDownloaded GetUpdatesStatusState = "downloaded" + GetUpdatesStatusStateInstalling GetUpdatesStatusState = "installing" + GetUpdatesStatusStateTonight GetUpdatesStatusState = "tonight" + GetUpdatesStatusStateSkipped GetUpdatesStatusState = "skipped" + GetUpdatesStatusStateError GetUpdatesStatusState = "error" + GetUpdatesStatusStateNotify GetUpdatesStatusState = "notify" + GetUpdatesStatusStateDone GetUpdatesStatusState = "done" +) + +func (e GetUpdatesStatusState) ToPointer() *GetUpdatesStatusState { + return &e +} +func (e *GetUpdatesStatusState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "available": + fallthrough + case "downloading": + fallthrough + case "downloaded": + fallthrough + case "installing": + fallthrough + case "tonight": + fallthrough + case "skipped": + fallthrough + case "error": + fallthrough + case "notify": + fallthrough + case "done": + *e = GetUpdatesStatusState(v) + return nil + default: + return fmt.Errorf("invalid value for GetUpdatesStatusState: %v", v) + } +} + +type Release struct { + // A list of what has been added in this version + Added *string `json:"added,omitempty"` + // The URL of where this update is available + DownloadURL *string `json:"downloadURL,omitempty"` + // A list of what has been fixed in this version + Fixed *string `json:"fixed,omitempty"` + // The URL key of the update + Key *string `json:"key,omitempty"` + // The status of this update. + // + // - available - This release is available + // - downloading - This release is downloading + // - downloaded - This release has been downloaded + // - installing - This release is installing + // - tonight - This release will be installed tonight + // - skipped - This release has been skipped + // - error - This release has an error + // - notify - This release is only notifying it is available (typically because it cannot be installed on this setup) + // - done - This release is complete + // + State *GetUpdatesStatusState `json:"state,omitempty"` + // The version available + Version *string `json:"version,omitempty"` +} + +func (r *Release) GetAdded() *string { + if r == nil { + return nil + } + return r.Added +} + +func (r *Release) GetDownloadURL() *string { + if r == nil { + return nil + } + return r.DownloadURL +} + +func (r *Release) GetFixed() *string { + if r == nil { + return nil + } + return r.Fixed +} + +func (r *Release) GetKey() *string { + if r == nil { + return nil + } + return r.Key +} + +func (r *Release) GetState() *GetUpdatesStatusState { + if r == nil { + return nil + } + return r.State +} + +func (r *Release) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +type GetUpdatesStatusMediaContainer struct { + // The version of the updater (currently `1`) + AutoUpdateVersion *int64 `json:"autoUpdateVersion,omitempty"` + // Indicates whether this install can be updated through these endpoints (typically only on MacOS and Windows) + CanInstall *bool `json:"canInstall,omitempty"` + // The last time a check for updates was performed + CheckedAt *int64 `json:"checkedAt,omitempty"` + // The URL where the update is available + DownloadURL *string `json:"downloadURL,omitempty"` + Release []Release `json:"Release,omitempty"` + // The current error code (`0` means no error) + Status *int64 `json:"status,omitempty"` +} + +func (g *GetUpdatesStatusMediaContainer) GetAutoUpdateVersion() *int64 { + if g == nil { + return nil + } + return g.AutoUpdateVersion +} + +func (g *GetUpdatesStatusMediaContainer) GetCanInstall() *bool { + if g == nil { + return nil + } + return g.CanInstall +} + +func (g *GetUpdatesStatusMediaContainer) GetCheckedAt() *int64 { + if g == nil { + return nil + } + return g.CheckedAt +} + +func (g *GetUpdatesStatusMediaContainer) GetDownloadURL() *string { + if g == nil { + return nil + } + return g.DownloadURL +} + +func (g *GetUpdatesStatusMediaContainer) GetRelease() []Release { + if g == nil { + return nil + } + return g.Release +} + +func (g *GetUpdatesStatusMediaContainer) GetStatus() *int64 { + if g == nil { + return nil + } + return g.Status +} + +// GetUpdatesStatusResponseBody - OK +type GetUpdatesStatusResponseBody struct { + MediaContainer *GetUpdatesStatusMediaContainer `json:"MediaContainer,omitempty"` +} + +func (g *GetUpdatesStatusResponseBody) GetMediaContainer() *GetUpdatesStatusMediaContainer { + if g == nil { + return nil + } + return g.MediaContainer +} + +type GetUpdatesStatusResponse 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 + // OK + Object *GetUpdatesStatusResponseBody +} + +func (g *GetUpdatesStatusResponse) GetContentType() string { + if g == nil { + return "" + } + return g.ContentType +} + +func (g *GetUpdatesStatusResponse) GetStatusCode() int { + if g == nil { + return 0 + } + return g.StatusCode +} + +func (g *GetUpdatesStatusResponse) GetRawResponse() *http.Response { + if g == nil { + return nil + } + return g.RawResponse +} + +func (g *GetUpdatesStatusResponse) GetObject() *GetUpdatesStatusResponseBody { + if g == nil { + return nil + } + return g.Object +} diff --git a/models/operations/getupdatestatus.go b/models/operations/getupdatestatus.go deleted file mode 100644 index 57b0b77..0000000 --- a/models/operations/getupdatestatus.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type Release struct { - Key *string `json:"key,omitempty"` - Version *string `json:"version,omitempty"` - Added *string `json:"added,omitempty"` - Fixed *string `json:"fixed,omitempty"` - DownloadURL *string `json:"downloadURL,omitempty"` - State *string `json:"state,omitempty"` -} - -func (r *Release) GetKey() *string { - if r == nil { - return nil - } - return r.Key -} - -func (r *Release) GetVersion() *string { - if r == nil { - return nil - } - return r.Version -} - -func (r *Release) GetAdded() *string { - if r == nil { - return nil - } - return r.Added -} - -func (r *Release) GetFixed() *string { - if r == nil { - return nil - } - return r.Fixed -} - -func (r *Release) GetDownloadURL() *string { - if r == nil { - return nil - } - return r.DownloadURL -} - -func (r *Release) GetState() *string { - if r == nil { - return nil - } - return r.State -} - -type GetUpdateStatusMediaContainer struct { - Size *int `json:"size,omitempty"` - CanInstall *bool `json:"canInstall,omitempty"` - CheckedAt *int `json:"checkedAt,omitempty"` - DownloadURL *string `json:"downloadURL,omitempty"` - Status *int `json:"status,omitempty"` - Release []Release `json:"Release,omitempty"` -} - -func (g *GetUpdateStatusMediaContainer) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetUpdateStatusMediaContainer) GetCanInstall() *bool { - if g == nil { - return nil - } - return g.CanInstall -} - -func (g *GetUpdateStatusMediaContainer) GetCheckedAt() *int { - if g == nil { - return nil - } - return g.CheckedAt -} - -func (g *GetUpdateStatusMediaContainer) GetDownloadURL() *string { - if g == nil { - return nil - } - return g.DownloadURL -} - -func (g *GetUpdateStatusMediaContainer) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -func (g *GetUpdateStatusMediaContainer) GetRelease() []Release { - if g == nil { - return nil - } - return g.Release -} - -// GetUpdateStatusResponseBody - The Server Updates -type GetUpdateStatusResponseBody struct { - MediaContainer *GetUpdateStatusMediaContainer `json:"MediaContainer,omitempty"` -} - -func (g *GetUpdateStatusResponseBody) GetMediaContainer() *GetUpdateStatusMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -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 - // The Server Updates - Object *GetUpdateStatusResponseBody -} - -func (g *GetUpdateStatusResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetUpdateStatusResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetUpdateStatusResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetUpdateStatusResponse) GetObject() *GetUpdateStatusResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/getuserfriends.go b/models/operations/getuserfriends.go deleted file mode 100644 index 42b1b7d..0000000 --- a/models/operations/getuserfriends.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" -) - -var GetUserFriendsServerList = []string{ - "https://plex.tv/api/v2", -} - -type SharedServers struct { -} - -type SharedSources struct { -} - -// Status - Current friend request status -type Status string - -const ( - StatusAccepted Status = "accepted" -) - -func (e Status) ToPointer() *Status { - return &e -} - -type Friend struct { - // The account email address - Email string `json:"email"` - // The account full name - FriendlyName *string `json:"friendlyName"` - // If the account is a Plex Home user - Home bool `json:"home"` - // The Plex account ID - ID int `json:"id"` - // If the account is a Plex Home managed user - Restricted *bool `default:"false" json:"restricted"` - SharedServers []SharedServers `json:"sharedServers"` - SharedSources []SharedSources `json:"sharedSources"` - // Current friend request status - Status Status `json:"status"` - // URL of the account thumbnail - Thumb string `json:"thumb"` - // The title of the account (username or friendly name) - Title string `json:"title"` - // The account username - Username string `json:"username"` - // The account Universally Unique Identifier (UUID) - UUID string `json:"uuid"` -} - -func (f Friend) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *Friend) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, []string{"email", "home", "id", "sharedServers", "sharedSources", "status", "thumb", "title", "username", "uuid"}); err != nil { - return err - } - return nil -} - -func (f *Friend) GetEmail() string { - if f == nil { - return "" - } - return f.Email -} - -func (f *Friend) GetFriendlyName() *string { - if f == nil { - return nil - } - return f.FriendlyName -} - -func (f *Friend) GetHome() bool { - if f == nil { - return false - } - return f.Home -} - -func (f *Friend) GetID() int { - if f == nil { - return 0 - } - return f.ID -} - -func (f *Friend) GetRestricted() *bool { - if f == nil { - return nil - } - return f.Restricted -} - -func (f *Friend) GetSharedServers() []SharedServers { - if f == nil { - return []SharedServers{} - } - return f.SharedServers -} - -func (f *Friend) GetSharedSources() []SharedSources { - if f == nil { - return []SharedSources{} - } - return f.SharedSources -} - -func (f *Friend) GetStatus() Status { - if f == nil { - return Status("") - } - return f.Status -} - -func (f *Friend) GetThumb() string { - if f == nil { - return "" - } - return f.Thumb -} - -func (f *Friend) GetTitle() string { - if f == nil { - return "" - } - return f.Title -} - -func (f *Friend) GetUsername() string { - if f == nil { - return "" - } - return f.Username -} - -func (f *Friend) GetUUID() string { - if f == nil { - return "" - } - return f.UUID -} - -type GetUserFriendsResponse 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 - // Friends Data - Friends []Friend -} - -func (g *GetUserFriendsResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetUserFriendsResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetUserFriendsResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetUserFriendsResponse) GetFriends() []Friend { - if g == nil { - return nil - } - return g.Friends -} diff --git a/models/operations/getusers.go b/models/operations/getusers.go deleted file mode 100644 index 948ed33..0000000 --- a/models/operations/getusers.go +++ /dev/null @@ -1,816 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" -) - -var GetUsersServerList = []string{ - "https://plex.tv/api", -} - -type GetUsersRequest struct { - // An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` - // The name of the client application. (Plex Web, Plex Media Server, etc.) - ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"` - // A relatively friendly name for the client device - DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"` - // The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.) - DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` - // The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440) - DeviceScreenResolution *string `header:"style=simple,explode=false,name=X-Plex-Device-Screen-Resolution"` - // The version of the client application. - ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"` - // The platform of the client application. - Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` - // The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list) - ClientFeatures *string `header:"style=simple,explode=false,name=X-Plex-Features"` - // A potentially less friendly identifier for the device model - Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` - // The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca) - XPlexSessionID *string `header:"style=simple,explode=false,name=X-Plex-Session-Id"` - // The language of the client application. - XPlexLanguage *string `header:"style=simple,explode=false,name=X-Plex-Language"` - // The version of the platform - PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` - // An authentication token, obtained from plex.tv - XPlexToken string `header:"style=simple,explode=false,name=X-Plex-Token"` -} - -func (g *GetUsersRequest) GetClientID() string { - if g == nil { - return "" - } - return g.ClientID -} - -func (g *GetUsersRequest) GetClientName() *string { - if g == nil { - return nil - } - return g.ClientName -} - -func (g *GetUsersRequest) GetDeviceNickname() *string { - if g == nil { - return nil - } - return g.DeviceNickname -} - -func (g *GetUsersRequest) GetDeviceName() *string { - if g == nil { - return nil - } - return g.DeviceName -} - -func (g *GetUsersRequest) GetDeviceScreenResolution() *string { - if g == nil { - return nil - } - return g.DeviceScreenResolution -} - -func (g *GetUsersRequest) GetClientVersion() *string { - if g == nil { - return nil - } - return g.ClientVersion -} - -func (g *GetUsersRequest) GetPlatform() *string { - if g == nil { - return nil - } - return g.Platform -} - -func (g *GetUsersRequest) GetClientFeatures() *string { - if g == nil { - return nil - } - return g.ClientFeatures -} - -func (g *GetUsersRequest) GetModel() *string { - if g == nil { - return nil - } - return g.Model -} - -func (g *GetUsersRequest) GetXPlexSessionID() *string { - if g == nil { - return nil - } - return g.XPlexSessionID -} - -func (g *GetUsersRequest) GetXPlexLanguage() *string { - if g == nil { - return nil - } - return g.XPlexLanguage -} - -func (g *GetUsersRequest) GetPlatformVersion() *string { - if g == nil { - return nil - } - return g.PlatformVersion -} - -func (g *GetUsersRequest) GetXPlexToken() string { - if g == nil { - return "" - } - return g.XPlexToken -} - -// Protected - Indicates whether the account is protected. -type Protected int - -const ( - ProtectedDisable Protected = 0 - ProtectedEnable Protected = 1 -) - -func (e Protected) ToPointer() *Protected { - return &e -} -func (e *Protected) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = Protected(v) - return nil - default: - return fmt.Errorf("invalid value for Protected: %v", v) - } -} - -// Home - Indicates if the user is part of a home group. -type Home int - -const ( - HomeDisable Home = 0 - HomeEnable Home = 1 -) - -func (e Home) ToPointer() *Home { - return &e -} -func (e *Home) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = Home(v) - return nil - default: - return fmt.Errorf("invalid value for Home: %v", v) - } -} - -// AllowTuners - Indicates if the user is allowed to use tuners. -type AllowTuners int - -const ( - AllowTunersDisable AllowTuners = 0 - AllowTunersEnable AllowTuners = 1 -) - -func (e AllowTuners) ToPointer() *AllowTuners { - return &e -} -func (e *AllowTuners) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AllowTuners(v) - return nil - default: - return fmt.Errorf("invalid value for AllowTuners: %v", v) - } -} - -// AllowSync - Indicates if the user is allowed to sync media. -type AllowSync int - -const ( - AllowSyncDisable AllowSync = 0 - AllowSyncEnable AllowSync = 1 -) - -func (e AllowSync) ToPointer() *AllowSync { - return &e -} -func (e *AllowSync) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AllowSync(v) - return nil - default: - return fmt.Errorf("invalid value for AllowSync: %v", v) - } -} - -// AllowCameraUpload - Indicates if the user is allowed to upload from a camera. -type AllowCameraUpload int - -const ( - AllowCameraUploadDisable AllowCameraUpload = 0 - AllowCameraUploadEnable AllowCameraUpload = 1 -) - -func (e AllowCameraUpload) ToPointer() *AllowCameraUpload { - return &e -} -func (e *AllowCameraUpload) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AllowCameraUpload(v) - return nil - default: - return fmt.Errorf("invalid value for AllowCameraUpload: %v", v) - } -} - -// AllowChannels - Indicates if the user has access to channels. -type AllowChannels int - -const ( - AllowChannelsDisable AllowChannels = 0 - AllowChannelsEnable AllowChannels = 1 -) - -func (e AllowChannels) ToPointer() *AllowChannels { - return &e -} -func (e *AllowChannels) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AllowChannels(v) - return nil - default: - return fmt.Errorf("invalid value for AllowChannels: %v", v) - } -} - -// AllowSubtitleAdmin - Indicates if the user can manage subtitles. -type AllowSubtitleAdmin int - -const ( - AllowSubtitleAdminDisable AllowSubtitleAdmin = 0 - AllowSubtitleAdminEnable AllowSubtitleAdmin = 1 -) - -func (e AllowSubtitleAdmin) ToPointer() *AllowSubtitleAdmin { - return &e -} -func (e *AllowSubtitleAdmin) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AllowSubtitleAdmin(v) - return nil - default: - return fmt.Errorf("invalid value for AllowSubtitleAdmin: %v", v) - } -} - -// Restricted - Indicates if the user has restricted access. -type Restricted int - -const ( - RestrictedDisable Restricted = 0 - RestrictedEnable Restricted = 1 -) - -func (e Restricted) ToPointer() *Restricted { - return &e -} -func (e *Restricted) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = Restricted(v) - return nil - default: - return fmt.Errorf("invalid value for Restricted: %v", v) - } -} - -// AllLibraries - Indicates if the user has access to all libraries. -type AllLibraries int - -const ( - AllLibrariesDisable AllLibraries = 0 - AllLibrariesEnable AllLibraries = 1 -) - -func (e AllLibraries) ToPointer() *AllLibraries { - return &e -} -func (e *AllLibraries) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = AllLibraries(v) - return nil - default: - return fmt.Errorf("invalid value for AllLibraries: %v", v) - } -} - -// Owned - Indicates if the user owns the server. -type Owned int - -const ( - OwnedDisable Owned = 0 - OwnedEnable Owned = 1 -) - -func (e Owned) ToPointer() *Owned { - return &e -} -func (e *Owned) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = Owned(v) - return nil - default: - return fmt.Errorf("invalid value for Owned: %v", v) - } -} - -// Pending - Indicates if the server is pending approval. -type Pending int - -const ( - PendingDisable Pending = 0 - PendingEnable Pending = 1 -) - -func (e Pending) ToPointer() *Pending { - return &e -} -func (e *Pending) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = Pending(v) - return nil - default: - return fmt.Errorf("invalid value for Pending: %v", v) - } -} - -type GetUsersServer struct { - // Unique ID of the server of the connected user - ID int64 - // ID of the actual Plex server. - ServerID int64 - // Machine identifier of the Plex server. - MachineIdentifier string - // Name of the Plex server of the connected user. - Name string - LastSeenAt int64 - // Number of libraries in the server this user has access to. - NumLibraries int64 - AllLibraries *AllLibraries `default:"0"` - Owned *Owned `default:"0"` - Pending *Pending `default:"0"` -} - -func (g GetUsersServer) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetUsersServer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "serverId", "machineIdentifier", "name", "lastSeenAt", "numLibraries"}); err != nil { - return err - } - return nil -} - -func (g *GetUsersServer) GetID() int64 { - if g == nil { - return 0 - } - return g.ID -} - -func (g *GetUsersServer) GetServerID() int64 { - if g == nil { - return 0 - } - return g.ServerID -} - -func (g *GetUsersServer) GetMachineIdentifier() string { - if g == nil { - return "" - } - return g.MachineIdentifier -} - -func (g *GetUsersServer) GetName() string { - if g == nil { - return "" - } - return g.Name -} - -func (g *GetUsersServer) GetLastSeenAt() int64 { - if g == nil { - return 0 - } - return g.LastSeenAt -} - -func (g *GetUsersServer) GetNumLibraries() int64 { - if g == nil { - return 0 - } - return g.NumLibraries -} - -func (g *GetUsersServer) GetAllLibraries() *AllLibraries { - if g == nil { - return nil - } - return g.AllLibraries -} - -func (g *GetUsersServer) GetOwned() *Owned { - if g == nil { - return nil - } - return g.Owned -} - -func (g *GetUsersServer) GetPending() *Pending { - if g == nil { - return nil - } - return g.Pending -} - -type User struct { - // User's unique ID. - ID int64 - // User's display name. - Title string - // User's username. - Username string - // User's email address. - Email string - // ID of the user's recommendation playlist. - RecommendationsPlaylistID *string - // URL to the user's avatar image. - Thumb string - Protected *Protected `default:"0"` - Home *Home `default:"0"` - AllowTuners *AllowTuners `default:"0"` - AllowSync *AllowSync `default:"0"` - AllowCameraUpload *AllowCameraUpload `default:"0"` - AllowChannels *AllowChannels `default:"0"` - AllowSubtitleAdmin *AllowSubtitleAdmin `default:"0"` - // Filters applied for all content. - FilterAll *string - // Filters applied for movies. - FilterMovies *string - // Filters applied for music. - FilterMusic *string - // Filters applied for photos. - FilterPhotos *string - // Filters applied for television. - FilterTelevision *string - Restricted *Restricted `default:"0"` - // List of servers owned by the user. - Server []GetUsersServer -} - -func (u User) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *User) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, []string{"id", "title", "username", "email", "thumb", "Server"}); err != nil { - return err - } - return nil -} - -func (u *User) GetID() int64 { - if u == nil { - return 0 - } - return u.ID -} - -func (u *User) GetTitle() string { - if u == nil { - return "" - } - return u.Title -} - -func (u *User) GetUsername() string { - if u == nil { - return "" - } - return u.Username -} - -func (u *User) GetEmail() string { - if u == nil { - return "" - } - return u.Email -} - -func (u *User) GetRecommendationsPlaylistID() *string { - if u == nil { - return nil - } - return u.RecommendationsPlaylistID -} - -func (u *User) GetThumb() string { - if u == nil { - return "" - } - return u.Thumb -} - -func (u *User) GetProtected() *Protected { - if u == nil { - return nil - } - return u.Protected -} - -func (u *User) GetHome() *Home { - if u == nil { - return nil - } - return u.Home -} - -func (u *User) GetAllowTuners() *AllowTuners { - if u == nil { - return nil - } - return u.AllowTuners -} - -func (u *User) GetAllowSync() *AllowSync { - if u == nil { - return nil - } - return u.AllowSync -} - -func (u *User) GetAllowCameraUpload() *AllowCameraUpload { - if u == nil { - return nil - } - return u.AllowCameraUpload -} - -func (u *User) GetAllowChannels() *AllowChannels { - if u == nil { - return nil - } - return u.AllowChannels -} - -func (u *User) GetAllowSubtitleAdmin() *AllowSubtitleAdmin { - if u == nil { - return nil - } - return u.AllowSubtitleAdmin -} - -func (u *User) GetFilterAll() *string { - if u == nil { - return nil - } - return u.FilterAll -} - -func (u *User) GetFilterMovies() *string { - if u == nil { - return nil - } - return u.FilterMovies -} - -func (u *User) GetFilterMusic() *string { - if u == nil { - return nil - } - return u.FilterMusic -} - -func (u *User) GetFilterPhotos() *string { - if u == nil { - return nil - } - return u.FilterPhotos -} - -func (u *User) GetFilterTelevision() *string { - if u == nil { - return nil - } - return u.FilterTelevision -} - -func (u *User) GetRestricted() *Restricted { - if u == nil { - return nil - } - return u.Restricted -} - -func (u *User) GetServer() []GetUsersServer { - if u == nil { - return []GetUsersServer{} - } - return u.Server -} - -// GetUsersMediaContainer - Container holding user and server details. -type GetUsersMediaContainer struct { - // The friendly name of the Plex instance. - FriendlyName string - Identifier string - // Unique Machine identifier of the Plex server. - MachineIdentifier string - // Total number of users. - TotalSize int64 - // Number of users in the current response. - Size int64 - // List of users with access to the Plex server. - User []User -} - -func (g *GetUsersMediaContainer) GetFriendlyName() string { - if g == nil { - return "" - } - return g.FriendlyName -} - -func (g *GetUsersMediaContainer) GetIdentifier() string { - if g == nil { - return "" - } - return g.Identifier -} - -func (g *GetUsersMediaContainer) GetMachineIdentifier() string { - if g == nil { - return "" - } - return g.MachineIdentifier -} - -func (g *GetUsersMediaContainer) GetTotalSize() int64 { - if g == nil { - return 0 - } - return g.TotalSize -} - -func (g *GetUsersMediaContainer) GetSize() int64 { - if g == nil { - return 0 - } - return g.Size -} - -func (g *GetUsersMediaContainer) GetUser() []User { - if g == nil { - return []User{} - } - return g.User -} - -// GetUsersResponseBody - Successful response with media container data in XML -type GetUsersResponseBody struct { - // Container holding user and server details. - MediaContainer *GetUsersMediaContainer -} - -func (g *GetUsersResponseBody) GetMediaContainer() *GetUsersMediaContainer { - if g == nil { - return nil - } - return g.MediaContainer -} - -type GetUsersResponse 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 - Body []byte -} - -func (g *GetUsersResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetUsersResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetUsersResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetUsersResponse) GetBody() []byte { - if g == nil { - return nil - } - return g.Body -} diff --git a/models/operations/getwatchlist.go b/models/operations/getwatchlist.go deleted file mode 100644 index dcf258f..0000000 --- a/models/operations/getwatchlist.go +++ /dev/null @@ -1,623 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/types" - "net/http" -) - -var GetWatchListServerList = []string{ - "https://discover.provider.plex.tv", -} - -// Filter -type Filter string - -const ( - FilterAll Filter = "all" - FilterAvailable Filter = "available" - FilterReleased Filter = "released" -) - -func (e Filter) ToPointer() *Filter { - return &e -} - -// Libtype - The type of library to filter. Can be "movie" or "show", or all if not present. -type Libtype string - -const ( - LibtypeMovie Libtype = "movie" - LibtypeShow Libtype = "show" -) - -func (e Libtype) ToPointer() *Libtype { - return &e -} - -// IncludeCollections - include collections in the results -type IncludeCollections int64 - -const ( - IncludeCollectionsOne IncludeCollections = 1 - IncludeCollectionsZero IncludeCollections = 0 -) - -func (e IncludeCollections) ToPointer() *IncludeCollections { - return &e -} -func (e *IncludeCollections) UnmarshalJSON(data []byte) error { - var v int64 - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 1: - fallthrough - case 0: - *e = IncludeCollections(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeCollections: %v", v) - } -} - -// IncludeExternalMedia - include external media in the results -type IncludeExternalMedia int64 - -const ( - IncludeExternalMediaOne IncludeExternalMedia = 1 - IncludeExternalMediaZero IncludeExternalMedia = 0 -) - -func (e IncludeExternalMedia) ToPointer() *IncludeExternalMedia { - return &e -} -func (e *IncludeExternalMedia) UnmarshalJSON(data []byte) error { - var v int64 - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 1: - fallthrough - case 0: - *e = IncludeExternalMedia(v) - return nil - default: - return fmt.Errorf("invalid value for IncludeExternalMedia: %v", v) - } -} - -type GetWatchListRequest struct { - // Filter - Filter Filter `pathParam:"style=simple,explode=false,name=filter"` - // In the format "field:dir". Available fields are "watchlistedAt" (Added At), - // "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). - // "dir" can be "asc" or "desc" - // - Sort *string `queryParam:"style=form,explode=true,name=sort"` - // The type of library to filter. Can be "movie" or "show", or all if not present. - // - Libtype *Libtype `queryParam:"style=form,explode=true,name=libtype"` - // The number of items to return. If not specified, all items will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // - Maxresults *int `queryParam:"style=form,explode=true,name=maxresults"` - // include collections in the results - // - IncludeCollections *IncludeCollections `queryParam:"style=form,explode=true,name=includeCollections"` - // include external media in the results - // - IncludeExternalMedia *IncludeExternalMedia `queryParam:"style=form,explode=true,name=includeExternalMedia"` - // The index of the first item to return. If not specified, the first item will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 0 - // - XPlexContainerStart *int `default:"0" queryParam:"style=form,explode=true,name=X-Plex-Container-Start"` - // The number of items to return. If not specified, all items will be returned. - // If the number of items exceeds the limit, the response will be paginated. - // By default this is 50 - // - XPlexContainerSize *int `default:"50" queryParam:"style=form,explode=true,name=X-Plex-Container-Size"` - // An authentication token, obtained from plex.tv - XPlexToken string `header:"style=simple,explode=false,name=X-Plex-Token"` -} - -func (g GetWatchListRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetWatchListRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, []string{"filter", "X-Plex-Token"}); err != nil { - return err - } - return nil -} - -func (g *GetWatchListRequest) GetFilter() Filter { - if g == nil { - return Filter("") - } - return g.Filter -} - -func (g *GetWatchListRequest) GetSort() *string { - if g == nil { - return nil - } - return g.Sort -} - -func (g *GetWatchListRequest) GetLibtype() *Libtype { - if g == nil { - return nil - } - return g.Libtype -} - -func (g *GetWatchListRequest) GetMaxresults() *int { - if g == nil { - return nil - } - return g.Maxresults -} - -func (g *GetWatchListRequest) GetIncludeCollections() *IncludeCollections { - if g == nil { - return nil - } - return g.IncludeCollections -} - -func (g *GetWatchListRequest) GetIncludeExternalMedia() *IncludeExternalMedia { - if g == nil { - return nil - } - return g.IncludeExternalMedia -} - -func (g *GetWatchListRequest) GetXPlexContainerStart() *int { - if g == nil { - return nil - } - return g.XPlexContainerStart -} - -func (g *GetWatchListRequest) GetXPlexContainerSize() *int { - if g == nil { - return nil - } - return g.XPlexContainerSize -} - -func (g *GetWatchListRequest) GetXPlexToken() string { - if g == nil { - return "" - } - return g.XPlexToken -} - -type Image struct { - Alt *string `json:"alt,omitempty"` - Type *string `json:"type,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (i *Image) GetAlt() *string { - if i == nil { - return nil - } - return i.Alt -} - -func (i *Image) GetType() *string { - if i == nil { - return nil - } - return i.Type -} - -func (i *Image) GetURL() *string { - if i == nil { - return nil - } - return i.URL -} - -type Metadata struct { - Art *string `json:"art,omitempty"` - GUID *string `json:"guid,omitempty"` - Key *string `json:"key,omitempty"` - RatingKey *string `json:"ratingKey,omitempty"` - Studio *string `json:"studio,omitempty"` - Tagline *string `json:"tagline,omitempty"` - Type *string `json:"type,omitempty"` - Thumb *string `json:"thumb,omitempty"` - AddedAt *int `json:"addedAt,omitempty"` - Duration *int `json:"duration,omitempty"` - PublicPagesURL *string `json:"publicPagesURL,omitempty"` - Slug *string `json:"slug,omitempty"` - UserState *bool `json:"userState,omitempty"` - Title *string `json:"title,omitempty"` - ContentRating *string `json:"contentRating,omitempty"` - OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` - Year *int `json:"year,omitempty"` - Image []Image `json:"Image,omitempty"` - Banner *string `json:"banner,omitempty"` - Rating *float64 `json:"rating,omitempty"` - ExpiresAt *int `json:"expiresAt,omitempty"` - OriginalTitle *string `json:"originalTitle,omitempty"` - AudienceRating *float64 `json:"audienceRating,omitempty"` - AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` - RatingImage *string `json:"ratingImage,omitempty"` - ImdbRatingCount *int `json:"imdbRatingCount,omitempty"` - Subtype *string `json:"subtype,omitempty"` - Theme *string `json:"theme,omitempty"` - LeafCount *int `json:"leafCount,omitempty"` - ChildCount *int `json:"childCount,omitempty"` - IsContinuingSeries *bool `json:"isContinuingSeries,omitempty"` - SkipChildren *bool `json:"skipChildren,omitempty"` - AvailabilityID *string `json:"availabilityId,omitempty"` - StreamingMediaID *string `json:"streamingMediaId,omitempty"` - PlayableKey *string `json:"playableKey,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, nil); err != nil { - return err - } - return nil -} - -func (m *Metadata) GetArt() *string { - if m == nil { - return nil - } - return m.Art -} - -func (m *Metadata) GetGUID() *string { - if m == nil { - return nil - } - return m.GUID -} - -func (m *Metadata) GetKey() *string { - if m == nil { - return nil - } - return m.Key -} - -func (m *Metadata) GetRatingKey() *string { - if m == nil { - return nil - } - return m.RatingKey -} - -func (m *Metadata) GetStudio() *string { - if m == nil { - return nil - } - return m.Studio -} - -func (m *Metadata) GetTagline() *string { - if m == nil { - return nil - } - return m.Tagline -} - -func (m *Metadata) GetType() *string { - if m == nil { - return nil - } - return m.Type -} - -func (m *Metadata) GetThumb() *string { - if m == nil { - return nil - } - return m.Thumb -} - -func (m *Metadata) GetAddedAt() *int { - if m == nil { - return nil - } - return m.AddedAt -} - -func (m *Metadata) GetDuration() *int { - if m == nil { - return nil - } - return m.Duration -} - -func (m *Metadata) GetPublicPagesURL() *string { - if m == nil { - return nil - } - return m.PublicPagesURL -} - -func (m *Metadata) GetSlug() *string { - if m == nil { - return nil - } - return m.Slug -} - -func (m *Metadata) GetUserState() *bool { - if m == nil { - return nil - } - return m.UserState -} - -func (m *Metadata) GetTitle() *string { - if m == nil { - return nil - } - return m.Title -} - -func (m *Metadata) GetContentRating() *string { - if m == nil { - return nil - } - return m.ContentRating -} - -func (m *Metadata) GetOriginallyAvailableAt() *types.Date { - if m == nil { - return nil - } - return m.OriginallyAvailableAt -} - -func (m *Metadata) GetYear() *int { - if m == nil { - return nil - } - return m.Year -} - -func (m *Metadata) GetImage() []Image { - if m == nil { - return nil - } - return m.Image -} - -func (m *Metadata) GetBanner() *string { - if m == nil { - return nil - } - return m.Banner -} - -func (m *Metadata) GetRating() *float64 { - if m == nil { - return nil - } - return m.Rating -} - -func (m *Metadata) GetExpiresAt() *int { - if m == nil { - return nil - } - return m.ExpiresAt -} - -func (m *Metadata) GetOriginalTitle() *string { - if m == nil { - return nil - } - return m.OriginalTitle -} - -func (m *Metadata) GetAudienceRating() *float64 { - if m == nil { - return nil - } - return m.AudienceRating -} - -func (m *Metadata) GetAudienceRatingImage() *string { - if m == nil { - return nil - } - return m.AudienceRatingImage -} - -func (m *Metadata) GetRatingImage() *string { - if m == nil { - return nil - } - return m.RatingImage -} - -func (m *Metadata) GetImdbRatingCount() *int { - if m == nil { - return nil - } - return m.ImdbRatingCount -} - -func (m *Metadata) GetSubtype() *string { - if m == nil { - return nil - } - return m.Subtype -} - -func (m *Metadata) GetTheme() *string { - if m == nil { - return nil - } - return m.Theme -} - -func (m *Metadata) GetLeafCount() *int { - if m == nil { - return nil - } - return m.LeafCount -} - -func (m *Metadata) GetChildCount() *int { - if m == nil { - return nil - } - return m.ChildCount -} - -func (m *Metadata) GetIsContinuingSeries() *bool { - if m == nil { - return nil - } - return m.IsContinuingSeries -} - -func (m *Metadata) GetSkipChildren() *bool { - if m == nil { - return nil - } - return m.SkipChildren -} - -func (m *Metadata) GetAvailabilityID() *string { - if m == nil { - return nil - } - return m.AvailabilityID -} - -func (m *Metadata) GetStreamingMediaID() *string { - if m == nil { - return nil - } - return m.StreamingMediaID -} - -func (m *Metadata) GetPlayableKey() *string { - if m == nil { - return nil - } - return m.PlayableKey -} - -// GetWatchListResponseBody - Watchlist Data -type GetWatchListResponseBody struct { - LibrarySectionID *string `json:"librarySectionID,omitempty"` - LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` - Offset *int `json:"offset,omitempty"` - TotalSize *int `json:"totalSize,omitempty"` - Identifier *string `json:"identifier,omitempty"` - Size *int `json:"size,omitempty"` - Metadata []Metadata `json:"Metadata,omitempty"` -} - -func (g *GetWatchListResponseBody) GetLibrarySectionID() *string { - if g == nil { - return nil - } - return g.LibrarySectionID -} - -func (g *GetWatchListResponseBody) GetLibrarySectionTitle() *string { - if g == nil { - return nil - } - return g.LibrarySectionTitle -} - -func (g *GetWatchListResponseBody) GetOffset() *int { - if g == nil { - return nil - } - return g.Offset -} - -func (g *GetWatchListResponseBody) GetTotalSize() *int { - if g == nil { - return nil - } - return g.TotalSize -} - -func (g *GetWatchListResponseBody) GetIdentifier() *string { - if g == nil { - return nil - } - return g.Identifier -} - -func (g *GetWatchListResponseBody) GetSize() *int { - if g == nil { - return nil - } - return g.Size -} - -func (g *GetWatchListResponseBody) GetMetadata() []Metadata { - if g == nil { - return nil - } - return g.Metadata -} - -type GetWatchListResponse 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 - // Watchlist Data - Object *GetWatchListResponseBody -} - -func (g *GetWatchListResponse) GetContentType() string { - if g == nil { - return "" - } - return g.ContentType -} - -func (g *GetWatchListResponse) GetStatusCode() int { - if g == nil { - return 0 - } - return g.StatusCode -} - -func (g *GetWatchListResponse) GetRawResponse() *http.Response { - if g == nil { - return nil - } - return g.RawResponse -} - -func (g *GetWatchListResponse) GetObject() *GetWatchListResponseBody { - if g == nil { - return nil - } - return g.Object -} diff --git a/models/operations/ingesttransientitem.go b/models/operations/ingesttransientitem.go new file mode 100644 index 0000000..fcd87a2 --- /dev/null +++ b/models/operations/ingesttransientitem.go @@ -0,0 +1,318 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type IngestTransientItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (i IngestTransientItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *IngestTransientItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *IngestTransientItemGlobals) GetAccepts() *components.Accepts { + if i == nil { + return nil + } + return i.Accepts +} + +func (i *IngestTransientItemGlobals) GetClientIdentifier() *string { + if i == nil { + return nil + } + return i.ClientIdentifier +} + +func (i *IngestTransientItemGlobals) GetProduct() *string { + if i == nil { + return nil + } + return i.Product +} + +func (i *IngestTransientItemGlobals) GetVersion() *string { + if i == nil { + return nil + } + return i.Version +} + +func (i *IngestTransientItemGlobals) GetPlatform() *string { + if i == nil { + return nil + } + return i.Platform +} + +func (i *IngestTransientItemGlobals) GetPlatformVersion() *string { + if i == nil { + return nil + } + return i.PlatformVersion +} + +func (i *IngestTransientItemGlobals) GetDevice() *string { + if i == nil { + return nil + } + return i.Device +} + +func (i *IngestTransientItemGlobals) GetModel() *string { + if i == nil { + return nil + } + return i.Model +} + +func (i *IngestTransientItemGlobals) GetDeviceVendor() *string { + if i == nil { + return nil + } + return i.DeviceVendor +} + +func (i *IngestTransientItemGlobals) GetDeviceName() *string { + if i == nil { + return nil + } + return i.DeviceName +} + +func (i *IngestTransientItemGlobals) GetMarketplace() *string { + if i == nil { + return nil + } + return i.Marketplace +} + +type IngestTransientItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The file of the file to ingest. + URL *string `queryParam:"style=form,explode=true,name=url"` + // A virtual path to use when the url is opaque. + VirtualFilePath *string `queryParam:"style=form,explode=true,name=virtualFilePath"` + // Whether or not to compute Plex and OpenSubtitle hashes for the file. Defaults to 0. + ComputeHashes *components.BoolInt `queryParam:"style=form,explode=true,name=computeHashes"` + // Whether or not non matching media should be stored. Defaults to 0. + IngestNonMatches *components.BoolInt `queryParam:"style=form,explode=true,name=ingestNonMatches"` +} + +func (i IngestTransientItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *IngestTransientItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *IngestTransientItemRequest) GetAccepts() *components.Accepts { + if i == nil { + return nil + } + return i.Accepts +} + +func (i *IngestTransientItemRequest) GetClientIdentifier() *string { + if i == nil { + return nil + } + return i.ClientIdentifier +} + +func (i *IngestTransientItemRequest) GetProduct() *string { + if i == nil { + return nil + } + return i.Product +} + +func (i *IngestTransientItemRequest) GetVersion() *string { + if i == nil { + return nil + } + return i.Version +} + +func (i *IngestTransientItemRequest) GetPlatform() *string { + if i == nil { + return nil + } + return i.Platform +} + +func (i *IngestTransientItemRequest) GetPlatformVersion() *string { + if i == nil { + return nil + } + return i.PlatformVersion +} + +func (i *IngestTransientItemRequest) GetDevice() *string { + if i == nil { + return nil + } + return i.Device +} + +func (i *IngestTransientItemRequest) GetModel() *string { + if i == nil { + return nil + } + return i.Model +} + +func (i *IngestTransientItemRequest) GetDeviceVendor() *string { + if i == nil { + return nil + } + return i.DeviceVendor +} + +func (i *IngestTransientItemRequest) GetDeviceName() *string { + if i == nil { + return nil + } + return i.DeviceName +} + +func (i *IngestTransientItemRequest) GetMarketplace() *string { + if i == nil { + return nil + } + return i.Marketplace +} + +func (i *IngestTransientItemRequest) GetURL() *string { + if i == nil { + return nil + } + return i.URL +} + +func (i *IngestTransientItemRequest) GetVirtualFilePath() *string { + if i == nil { + return nil + } + return i.VirtualFilePath +} + +func (i *IngestTransientItemRequest) GetComputeHashes() *components.BoolInt { + if i == nil { + return nil + } + return i.ComputeHashes +} + +func (i *IngestTransientItemRequest) GetIngestNonMatches() *components.BoolInt { + if i == nil { + return nil + } + return i.IngestNonMatches +} + +type IngestTransientItemResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (i *IngestTransientItemResponse) GetContentType() string { + if i == nil { + return "" + } + return i.ContentType +} + +func (i *IngestTransientItemResponse) GetStatusCode() int { + if i == nil { + return 0 + } + return i.StatusCode +} + +func (i *IngestTransientItemResponse) GetRawResponse() *http.Response { + if i == nil { + return nil + } + return i.RawResponse +} + +func (i *IngestTransientItemResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if i == nil { + return nil + } + return i.MediaContainerWithMetadata +} + +func (i *IngestTransientItemResponse) GetHeaders() map[string][]string { + if i == nil { + return map[string][]string{} + } + return i.Headers +} diff --git a/models/operations/listactivities.go b/models/operations/listactivities.go new file mode 100644 index 0000000..bba174e --- /dev/null +++ b/models/operations/listactivities.go @@ -0,0 +1,153 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type Activity struct { + // Indicates whether this activity can be cancelled + Cancellable *bool `json:"cancellable,omitempty"` + // An object with additional values + Context map[string]any `json:"Context,omitempty"` + // A progress percentage. A value of -1 means the progress is indeterminate + Progress *float64 `json:"progress,omitempty"` + // An object with the response to the async opperation + Response map[string]any `json:"Response,omitempty"` + // A user-friendly sub-title for this activity + Subtitle *string `json:"subtitle,omitempty"` + // A user-friendly title for this activity + Title *string `json:"title,omitempty"` + // The type of activity + Type *string `json:"type,omitempty"` + // The user this activity belongs to + UserID *int64 `json:"userID,omitempty"` + // The ID of the activity + UUID *string `json:"uuid,omitempty"` +} + +func (a *Activity) GetCancellable() *bool { + if a == nil { + return nil + } + return a.Cancellable +} + +func (a *Activity) GetContext() map[string]any { + if a == nil { + return nil + } + return a.Context +} + +func (a *Activity) GetProgress() *float64 { + if a == nil { + return nil + } + return a.Progress +} + +func (a *Activity) GetResponse() map[string]any { + if a == nil { + return nil + } + return a.Response +} + +func (a *Activity) GetSubtitle() *string { + if a == nil { + return nil + } + return a.Subtitle +} + +func (a *Activity) GetTitle() *string { + if a == nil { + return nil + } + return a.Title +} + +func (a *Activity) GetType() *string { + if a == nil { + return nil + } + return a.Type +} + +func (a *Activity) GetUserID() *int64 { + if a == nil { + return nil + } + return a.UserID +} + +func (a *Activity) GetUUID() *string { + if a == nil { + return nil + } + return a.UUID +} + +type ListActivitiesMediaContainer struct { + Activity []Activity `json:"Activity,omitempty"` +} + +func (l *ListActivitiesMediaContainer) GetActivity() []Activity { + if l == nil { + return nil + } + return l.Activity +} + +// ListActivitiesResponseBody - OK +type ListActivitiesResponseBody struct { + MediaContainer *ListActivitiesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListActivitiesResponseBody) GetMediaContainer() *ListActivitiesMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListActivitiesResponse 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 + // OK + Object *ListActivitiesResponseBody +} + +func (l *ListActivitiesResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListActivitiesResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListActivitiesResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListActivitiesResponse) GetObject() *ListActivitiesResponseBody { + if l == nil { + return nil + } + return l.Object +} diff --git a/models/operations/listcontent.go b/models/operations/listcontent.go new file mode 100644 index 0000000..6fb69f5 --- /dev/null +++ b/models/operations/listcontent.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListContentGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListContentGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListContentGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListContentGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListContentGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListContentGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListContentGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListContentGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListContentGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListContentGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListContentGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListContentGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListContentGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListContentGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListContentRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // This is a complex query built of several parameters. See [API Info section](#section/API-Info/Media-Queries) for information on building media queries + MediaQuery *components.MediaQuery `queryParam:"style=form,explode=true,name=mediaQuery"` + // The id of the section + SectionID string `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (l ListContentRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListContentRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (l *ListContentRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListContentRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListContentRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListContentRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListContentRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListContentRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListContentRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListContentRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListContentRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListContentRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListContentRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListContentRequest) GetMediaQuery() *components.MediaQuery { + if l == nil { + return nil + } + return l.MediaQuery +} + +func (l *ListContentRequest) GetSectionID() string { + if l == nil { + return "" + } + return l.SectionID +} + +type ListContentResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (l *ListContentResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListContentResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListContentResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListContentResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if l == nil { + return nil + } + return l.MediaContainerWithMetadata +} + +func (l *ListContentResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listdevices.go b/models/operations/listdevices.go new file mode 100644 index 0000000..e54ba62 --- /dev/null +++ b/models/operations/listdevices.go @@ -0,0 +1,55 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListDevicesResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice + Headers map[string][]string +} + +func (l *ListDevicesResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListDevicesResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListDevicesResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListDevicesResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if l == nil { + return nil + } + return l.MediaContainerWithDevice +} + +func (l *ListDevicesResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listdownloadqueueitems.go b/models/operations/listdownloadqueueitems.go new file mode 100644 index 0000000..d9efb3c --- /dev/null +++ b/models/operations/listdownloadqueueitems.go @@ -0,0 +1,552 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListDownloadQueueItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListDownloadQueueItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListDownloadQueueItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListDownloadQueueItemsGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListDownloadQueueItemsGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListDownloadQueueItemsGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListDownloadQueueItemsGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListDownloadQueueItemsGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListDownloadQueueItemsGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListDownloadQueueItemsGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListDownloadQueueItemsGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListDownloadQueueItemsGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListDownloadQueueItemsGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListDownloadQueueItemsGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListDownloadQueueItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` +} + +func (l ListDownloadQueueItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListDownloadQueueItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"queueId"}); err != nil { + return err + } + return nil +} + +func (l *ListDownloadQueueItemsRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListDownloadQueueItemsRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListDownloadQueueItemsRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListDownloadQueueItemsRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListDownloadQueueItemsRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListDownloadQueueItemsRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListDownloadQueueItemsRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListDownloadQueueItemsRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListDownloadQueueItemsRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListDownloadQueueItemsRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListDownloadQueueItemsRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListDownloadQueueItemsRequest) GetQueueID() int64 { + if l == nil { + return 0 + } + return l.QueueID +} + +type DecisionResult struct { + // The maximum bitrate set when item was added + AvailableBandwidth *int64 `json:"availableBandwidth,omitempty"` + DirectPlayDecisionCode *int64 `json:"directPlayDecisionCode,omitempty"` + DirectPlayDecisionText *string `json:"directPlayDecisionText,omitempty"` + GeneralDecisionCode *int64 `json:"generalDecisionCode,omitempty"` + GeneralDecisionText *string `json:"generalDecisionText,omitempty"` + // The code indicating the status of evaluation of playback when client indicates `hasMDE=1` + MdeDecisionCode *int64 `json:"mdeDecisionCode,omitempty"` + // Descriptive text for the above code + MdeDecisionText *string `json:"mdeDecisionText,omitempty"` + TranscodeDecisionCode *int64 `json:"transcodeDecisionCode,omitempty"` + TranscodeDecisionText *string `json:"transcodeDecisionText,omitempty"` +} + +func (d *DecisionResult) GetAvailableBandwidth() *int64 { + if d == nil { + return nil + } + return d.AvailableBandwidth +} + +func (d *DecisionResult) GetDirectPlayDecisionCode() *int64 { + if d == nil { + return nil + } + return d.DirectPlayDecisionCode +} + +func (d *DecisionResult) GetDirectPlayDecisionText() *string { + if d == nil { + return nil + } + return d.DirectPlayDecisionText +} + +func (d *DecisionResult) GetGeneralDecisionCode() *int64 { + if d == nil { + return nil + } + return d.GeneralDecisionCode +} + +func (d *DecisionResult) GetGeneralDecisionText() *string { + if d == nil { + return nil + } + return d.GeneralDecisionText +} + +func (d *DecisionResult) GetMdeDecisionCode() *int64 { + if d == nil { + return nil + } + return d.MdeDecisionCode +} + +func (d *DecisionResult) GetMdeDecisionText() *string { + if d == nil { + return nil + } + return d.MdeDecisionText +} + +func (d *DecisionResult) GetTranscodeDecisionCode() *int64 { + if d == nil { + return nil + } + return d.TranscodeDecisionCode +} + +func (d *DecisionResult) GetTranscodeDecisionText() *string { + if d == nil { + return nil + } + return d.TranscodeDecisionText +} + +// ListDownloadQueueItemsStatus - The state of the item: +// - deciding: The item decision is pending +// - waiting: The item is waiting for transcode +// - processing: The item is being transcoded +// - available: The item is available for download +// - error: The item encountered an error in the decision or transcode +// - expired: The transcoded item has timed out and is no longer available +type ListDownloadQueueItemsStatus string + +const ( + ListDownloadQueueItemsStatusDeciding ListDownloadQueueItemsStatus = "deciding" + ListDownloadQueueItemsStatusWaiting ListDownloadQueueItemsStatus = "waiting" + ListDownloadQueueItemsStatusProcessing ListDownloadQueueItemsStatus = "processing" + ListDownloadQueueItemsStatusAvailable ListDownloadQueueItemsStatus = "available" + ListDownloadQueueItemsStatusError ListDownloadQueueItemsStatus = "error" + ListDownloadQueueItemsStatusExpired ListDownloadQueueItemsStatus = "expired" +) + +func (e ListDownloadQueueItemsStatus) ToPointer() *ListDownloadQueueItemsStatus { + return &e +} +func (e *ListDownloadQueueItemsStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "deciding": + fallthrough + case "waiting": + fallthrough + case "processing": + fallthrough + case "available": + fallthrough + case "error": + fallthrough + case "expired": + *e = ListDownloadQueueItemsStatus(v) + return nil + default: + return fmt.Errorf("invalid value for ListDownloadQueueItemsStatus: %v", v) + } +} + +// Transcode - The transcode session object which is not yet documented otherwise it'd be a $ref here. +type Transcode struct { +} + +type DownloadQueueItem struct { + DecisionResult *DecisionResult `json:"DecisionResult,omitempty"` + // The error encountered in transcoding or decision + Error *string `json:"error,omitempty"` + ID *int64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + QueueID *int64 `json:"queueId,omitempty"` + // The state of the item: + // - deciding: The item decision is pending + // - waiting: The item is waiting for transcode + // - processing: The item is being transcoded + // - available: The item is available for download + // - error: The item encountered an error in the decision or transcode + // - expired: The transcoded item has timed out and is no longer available + // + Status *ListDownloadQueueItemsStatus `json:"status,omitempty"` + // The transcode session object which is not yet documented otherwise it'd be a $ref here. + Transcode *Transcode `json:"transcode,omitempty"` + // The transcode session if item is currently being transcoded + TranscodeSession *components.TranscodeSession `json:"TranscodeSession,omitempty"` +} + +func (d *DownloadQueueItem) GetDecisionResult() *DecisionResult { + if d == nil { + return nil + } + return d.DecisionResult +} + +func (d *DownloadQueueItem) GetError() *string { + if d == nil { + return nil + } + return d.Error +} + +func (d *DownloadQueueItem) GetID() *int64 { + if d == nil { + return nil + } + return d.ID +} + +func (d *DownloadQueueItem) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *DownloadQueueItem) GetQueueID() *int64 { + if d == nil { + return nil + } + return d.QueueID +} + +func (d *DownloadQueueItem) GetStatus() *ListDownloadQueueItemsStatus { + if d == nil { + return nil + } + return d.Status +} + +func (d *DownloadQueueItem) GetTranscode() *Transcode { + if d == nil { + return nil + } + return d.Transcode +} + +func (d *DownloadQueueItem) GetTranscodeSession() *components.TranscodeSession { + if d == nil { + return nil + } + return d.TranscodeSession +} + +// ListDownloadQueueItemsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListDownloadQueueItemsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + DownloadQueueItem []DownloadQueueItem `json:"DownloadQueueItem,omitempty"` +} + +func (l *ListDownloadQueueItemsMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListDownloadQueueItemsMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListDownloadQueueItemsMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListDownloadQueueItemsMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListDownloadQueueItemsMediaContainer) GetDownloadQueueItem() []DownloadQueueItem { + if l == nil { + return nil + } + return l.DownloadQueueItem +} + +// ListDownloadQueueItemsResponseBody - OK +type ListDownloadQueueItemsResponseBody struct { + MediaContainer *ListDownloadQueueItemsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListDownloadQueueItemsResponseBody) GetMediaContainer() *ListDownloadQueueItemsMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListDownloadQueueItemsResponse 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 + // OK + Object *ListDownloadQueueItemsResponseBody +} + +func (l *ListDownloadQueueItemsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListDownloadQueueItemsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListDownloadQueueItemsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListDownloadQueueItemsResponse) GetObject() *ListDownloadQueueItemsResponseBody { + if l == nil { + return nil + } + return l.Object +} diff --git a/models/operations/listdvrs.go b/models/operations/listdvrs.go new file mode 100644 index 0000000..a00a2f9 --- /dev/null +++ b/models/operations/listdvrs.go @@ -0,0 +1,180 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +// ListDVRsDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListDVRsDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (l *ListDVRsDVRsMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListDVRsDVRsMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListDVRsDVRsMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListDVRsDVRsMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListDVRsDVRsMediaContainer) GetStatus() *int64 { + if l == nil { + return nil + } + return l.Status +} + +type Dvr struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (d *Dvr) GetDevice() []components.Device { + if d == nil { + return nil + } + return d.Device +} + +func (d *Dvr) GetKey() *string { + if d == nil { + return nil + } + return d.Key +} + +func (d *Dvr) GetLanguage() *string { + if d == nil { + return nil + } + return d.Language +} + +func (d *Dvr) GetLineup() *string { + if d == nil { + return nil + } + return d.Lineup +} + +func (d *Dvr) GetUUID() *string { + if d == nil { + return nil + } + return d.UUID +} + +type ListDVRsMediaContainer struct { + MediaContainer *ListDVRsDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []Dvr `json:"DVR,omitempty"` +} + +func (l *ListDVRsMediaContainer) GetMediaContainer() *ListDVRsDVRsMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +func (l *ListDVRsMediaContainer) GetDvr() []Dvr { + if l == nil { + return nil + } + return l.Dvr +} + +// ListDVRsResponseBody - OK +type ListDVRsResponseBody struct { + MediaContainer *ListDVRsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListDVRsResponseBody) GetMediaContainer() *ListDVRsMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListDVRsResponse 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 + // OK + Object *ListDVRsResponseBody + Headers map[string][]string +} + +func (l *ListDVRsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListDVRsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListDVRsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListDVRsResponse) GetObject() *ListDVRsResponseBody { + if l == nil { + return nil + } + return l.Object +} + +func (l *ListDVRsResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listhubs.go b/models/operations/listhubs.go new file mode 100644 index 0000000..d68089f --- /dev/null +++ b/models/operations/listhubs.go @@ -0,0 +1,514 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListHubsGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListHubsGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListHubsGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListHubsGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListHubsGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListHubsGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListHubsGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListHubsGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListHubsGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListHubsGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListHubsGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to reorder + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Restrict hubs to ones relevant to the provided metadata item + MetadataItemID *int64 `queryParam:"style=form,explode=true,name=metadataItemId"` +} + +func (l ListHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (l *ListHubsRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListHubsRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListHubsRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListHubsRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListHubsRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListHubsRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListHubsRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListHubsRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListHubsRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListHubsRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListHubsRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListHubsRequest) GetSectionID() int64 { + if l == nil { + return 0 + } + return l.SectionID +} + +func (l *ListHubsRequest) GetMetadataItemID() *int64 { + if l == nil { + return nil + } + return l.MetadataItemID +} + +// HomeVisibility - Whether this hub is visible on the home screen +// - all: Visible to all users +// - none: Visible to no users +// - admin: Visible to only admin users +// - shared: Visible to shared users +type HomeVisibility string + +const ( + HomeVisibilityAll HomeVisibility = "all" + HomeVisibilityNone HomeVisibility = "none" + HomeVisibilityAdmin HomeVisibility = "admin" + HomeVisibilityShared HomeVisibility = "shared" +) + +func (e HomeVisibility) ToPointer() *HomeVisibility { + return &e +} +func (e *HomeVisibility) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + fallthrough + case "none": + fallthrough + case "admin": + fallthrough + case "shared": + *e = HomeVisibility(v) + return nil + default: + return fmt.Errorf("invalid value for HomeVisibility: %v", v) + } +} + +// RecommendationsVisibility - The visibility of this hub in recommendations: +// - all: Visible to all users +// - none: Visible to no users +// - admin: Visible to only admin users +// - shared: Visible to shared users +type RecommendationsVisibility string + +const ( + RecommendationsVisibilityAll RecommendationsVisibility = "all" + RecommendationsVisibilityNone RecommendationsVisibility = "none" + RecommendationsVisibilityAdmin RecommendationsVisibility = "admin" + RecommendationsVisibilityShared RecommendationsVisibility = "shared" +) + +func (e RecommendationsVisibility) ToPointer() *RecommendationsVisibility { + return &e +} +func (e *RecommendationsVisibility) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + fallthrough + case "none": + fallthrough + case "admin": + fallthrough + case "shared": + *e = RecommendationsVisibility(v) + return nil + default: + return fmt.Errorf("invalid value for RecommendationsVisibility: %v", v) + } +} + +type Hub struct { + // Whether this hub is visible on the home screen + // - all: Visible to all users + // - none: Visible to no users + // - admin: Visible to only admin users + // - shared: Visible to shared users + // + HomeVisibility *HomeVisibility `json:"homeVisibility,omitempty"` + // The identifier for this hub + Identifier *string `json:"identifier,omitempty"` + // Whether this hub is visible to admin user home + PromotedToOwnHome *bool `json:"promotedToOwnHome,omitempty"` + // Whether this hub is promoted to all for recommendations + PromotedToRecommended *bool `json:"promotedToRecommended,omitempty"` + // Whether this hub is visible to shared user's home + PromotedToSharedHome *bool `json:"promotedToSharedHome,omitempty"` + // The visibility of this hub in recommendations: + // - all: Visible to all users + // - none: Visible to no users + // - admin: Visible to only admin users + // - shared: Visible to shared users + // + RecommendationsVisibility *RecommendationsVisibility `json:"recommendationsVisibility,omitempty"` + // The title of this hub + Title *string `json:"title,omitempty"` +} + +func (h *Hub) GetHomeVisibility() *HomeVisibility { + if h == nil { + return nil + } + return h.HomeVisibility +} + +func (h *Hub) GetIdentifier() *string { + if h == nil { + return nil + } + return h.Identifier +} + +func (h *Hub) GetPromotedToOwnHome() *bool { + if h == nil { + return nil + } + return h.PromotedToOwnHome +} + +func (h *Hub) GetPromotedToRecommended() *bool { + if h == nil { + return nil + } + return h.PromotedToRecommended +} + +func (h *Hub) GetPromotedToSharedHome() *bool { + if h == nil { + return nil + } + return h.PromotedToSharedHome +} + +func (h *Hub) GetRecommendationsVisibility() *RecommendationsVisibility { + if h == nil { + return nil + } + return h.RecommendationsVisibility +} + +func (h *Hub) GetTitle() *string { + if h == nil { + return nil + } + return h.Title +} + +// ListHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []Hub `json:"Hub,omitempty"` +} + +func (l *ListHubsMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListHubsMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListHubsMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListHubsMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListHubsMediaContainer) GetHub() []Hub { + if l == nil { + return nil + } + return l.Hub +} + +// ListHubsResponseBody - OK +type ListHubsResponseBody struct { + MediaContainer *ListHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListHubsResponseBody) GetMediaContainer() *ListHubsMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListHubsResponse 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 + // OK + Object *ListHubsResponseBody + Headers map[string][]string +} + +func (l *ListHubsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListHubsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListHubsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListHubsResponse) GetObject() *ListHubsResponseBody { + if l == nil { + return nil + } + return l.Object +} + +func (l *ListHubsResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listlineups.go b/models/operations/listlineups.go new file mode 100644 index 0000000..632af72 --- /dev/null +++ b/models/operations/listlineups.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListLineupsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListLineupsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListLineupsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListLineupsGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListLineupsGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListLineupsGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListLineupsGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListLineupsGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListLineupsGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListLineupsGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListLineupsGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListLineupsGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListLineupsGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListLineupsGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListLineupsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 3 letter country code + Country string `pathParam:"style=simple,explode=false,name=country"` + // The `providerIdentifier` of the provider + EpgID string `pathParam:"style=simple,explode=false,name=epgId"` + // The region for the lineup + Region string `pathParam:"style=simple,explode=false,name=region"` +} + +func (l ListLineupsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListLineupsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"country", "epgId", "region"}); err != nil { + return err + } + return nil +} + +func (l *ListLineupsRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListLineupsRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListLineupsRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListLineupsRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListLineupsRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListLineupsRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListLineupsRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListLineupsRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListLineupsRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListLineupsRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListLineupsRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListLineupsRequest) GetCountry() string { + if l == nil { + return "" + } + return l.Country +} + +func (l *ListLineupsRequest) GetEpgID() string { + if l == nil { + return "" + } + return l.EpgID +} + +func (l *ListLineupsRequest) GetRegion() string { + if l == nil { + return "" + } + return l.Region +} + +type ListLineupsResponse 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 + // OK + MediaContainerWithLineup *components.MediaContainerWithLineup + Headers map[string][]string +} + +func (l *ListLineupsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListLineupsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListLineupsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListLineupsResponse) GetMediaContainerWithLineup() *components.MediaContainerWithLineup { + if l == nil { + return nil + } + return l.MediaContainerWithLineup +} + +func (l *ListLineupsResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listmatches.go b/models/operations/listmatches.go new file mode 100644 index 0000000..62e9eff --- /dev/null +++ b/models/operations/listmatches.go @@ -0,0 +1,330 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListMatchesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListMatchesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListMatchesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListMatchesGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListMatchesGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListMatchesGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListMatchesGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListMatchesGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListMatchesGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListMatchesGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListMatchesGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListMatchesGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListMatchesGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListMatchesGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListMatchesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Title *string `queryParam:"style=form,explode=true,name=title"` + ParentTitle *string `queryParam:"style=form,explode=true,name=parentTitle"` + Agent *string `queryParam:"style=form,explode=true,name=agent"` + Language *string `queryParam:"style=form,explode=true,name=language"` + Year *int64 `queryParam:"style=form,explode=true,name=year"` + Manual *components.BoolInt `queryParam:"style=form,explode=true,name=manual"` +} + +func (l ListMatchesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListMatchesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (l *ListMatchesRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListMatchesRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListMatchesRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListMatchesRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListMatchesRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListMatchesRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListMatchesRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListMatchesRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListMatchesRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListMatchesRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListMatchesRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListMatchesRequest) GetIds() string { + if l == nil { + return "" + } + return l.Ids +} + +func (l *ListMatchesRequest) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +func (l *ListMatchesRequest) GetParentTitle() *string { + if l == nil { + return nil + } + return l.ParentTitle +} + +func (l *ListMatchesRequest) GetAgent() *string { + if l == nil { + return nil + } + return l.Agent +} + +func (l *ListMatchesRequest) GetLanguage() *string { + if l == nil { + return nil + } + return l.Language +} + +func (l *ListMatchesRequest) GetYear() *int64 { + if l == nil { + return nil + } + return l.Year +} + +func (l *ListMatchesRequest) GetManual() *components.BoolInt { + if l == nil { + return nil + } + return l.Manual +} + +type ListMatchesResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (l *ListMatchesResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListMatchesResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListMatchesResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListMatchesResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if l == nil { + return nil + } + return l.MediaContainerWithMetadata +} diff --git a/models/operations/listmoments.go b/models/operations/listmoments.go new file mode 100644 index 0000000..f1ed3d2 --- /dev/null +++ b/models/operations/listmoments.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListMomentsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListMomentsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListMomentsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListMomentsGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListMomentsGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListMomentsGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListMomentsGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListMomentsGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListMomentsGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListMomentsGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListMomentsGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListMomentsGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListMomentsGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListMomentsGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListMomentsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (l ListMomentsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListMomentsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (l *ListMomentsRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListMomentsRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListMomentsRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListMomentsRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListMomentsRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListMomentsRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListMomentsRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListMomentsRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListMomentsRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListMomentsRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListMomentsRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListMomentsRequest) GetSectionID() int64 { + if l == nil { + return 0 + } + return l.SectionID +} + +type ListMomentsResponse 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 + // OK + MediaContainerWithArtwork *components.MediaContainerWithArtwork +} + +func (l *ListMomentsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListMomentsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListMomentsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListMomentsResponse) GetMediaContainerWithArtwork() *components.MediaContainerWithArtwork { + if l == nil { + return nil + } + return l.MediaContainerWithArtwork +} diff --git a/models/operations/listpersonmedia.go b/models/operations/listpersonmedia.go new file mode 100644 index 0000000..1a2354e --- /dev/null +++ b/models/operations/listpersonmedia.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListPersonMediaGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListPersonMediaGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPersonMediaGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListPersonMediaGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListPersonMediaGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListPersonMediaGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListPersonMediaGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListPersonMediaGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListPersonMediaGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListPersonMediaGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListPersonMediaGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListPersonMediaGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListPersonMediaGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListPersonMediaGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListPersonMediaRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Either the PMS tag `id` of the person or `tagKey` of the actor. Note the `tagKey` is the hex portion of the plex guid for the actor + PersonID string `pathParam:"style=simple,explode=false,name=personId"` +} + +func (l ListPersonMediaRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPersonMediaRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"personId"}); err != nil { + return err + } + return nil +} + +func (l *ListPersonMediaRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListPersonMediaRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListPersonMediaRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListPersonMediaRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListPersonMediaRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListPersonMediaRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListPersonMediaRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListPersonMediaRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListPersonMediaRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListPersonMediaRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListPersonMediaRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListPersonMediaRequest) GetPersonID() string { + if l == nil { + return "" + } + return l.PersonID +} + +type ListPersonMediaResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (l *ListPersonMediaResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListPersonMediaResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListPersonMediaResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListPersonMediaResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if l == nil { + return nil + } + return l.MediaContainerWithMetadata +} diff --git a/models/operations/listplaybackhistory.go b/models/operations/listplaybackhistory.go new file mode 100644 index 0000000..3b358c5 --- /dev/null +++ b/models/operations/listplaybackhistory.go @@ -0,0 +1,491 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListPlaybackHistoryGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListPlaybackHistoryGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPlaybackHistoryGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListPlaybackHistoryGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListPlaybackHistoryGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListPlaybackHistoryGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListPlaybackHistoryGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListPlaybackHistoryGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListPlaybackHistoryGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListPlaybackHistoryGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListPlaybackHistoryGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListPlaybackHistoryGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListPlaybackHistoryGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListPlaybackHistoryGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListPlaybackHistoryRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The account id to restrict view history + AccountID *int64 `queryParam:"style=form,explode=true,name=accountID"` + // The time period to restrict history (typically of the form `viewedAt>=12456789`) + ViewedAt *int64 `queryParam:"style=form,explode=true,name=viewedAt"` + // The library section id to restrict view history + LibrarySectionID *int64 `queryParam:"style=form,explode=true,name=librarySectionID"` + // The metadata item to restrict view history (can provide the id for a show to see all of that show's view history). Note this is translated to `metadata_items.id`, `parents.id`, or `grandparents.id` internally depending on the metadata type. + MetadataItemID *int64 `queryParam:"style=form,explode=true,name=metadataItemID"` + // The field on which to sort. Multiple orderings can be specified separated by `,` and the direction specified following a `:` (`desc` or `asc`; `asc` is assumed if not provided). Note `metadataItemID` may not be used here. + Sort []string `queryParam:"style=form,explode=true,name=sort"` +} + +func (l ListPlaybackHistoryRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPlaybackHistoryRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListPlaybackHistoryRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListPlaybackHistoryRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListPlaybackHistoryRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListPlaybackHistoryRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListPlaybackHistoryRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListPlaybackHistoryRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListPlaybackHistoryRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListPlaybackHistoryRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListPlaybackHistoryRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListPlaybackHistoryRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListPlaybackHistoryRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListPlaybackHistoryRequest) GetAccountID() *int64 { + if l == nil { + return nil + } + return l.AccountID +} + +func (l *ListPlaybackHistoryRequest) GetViewedAt() *int64 { + if l == nil { + return nil + } + return l.ViewedAt +} + +func (l *ListPlaybackHistoryRequest) GetLibrarySectionID() *int64 { + if l == nil { + return nil + } + return l.LibrarySectionID +} + +func (l *ListPlaybackHistoryRequest) GetMetadataItemID() *int64 { + if l == nil { + return nil + } + return l.MetadataItemID +} + +func (l *ListPlaybackHistoryRequest) GetSort() []string { + if l == nil { + return nil + } + return l.Sort +} + +type ListPlaybackHistoryMetadata struct { + // The account id of this playback + AccountID *int64 `json:"accountID,omitempty"` + // The device id which played the item + DeviceID *int64 `json:"deviceID,omitempty"` + // The key for this individual history item + HistoryKey *string `json:"historyKey,omitempty"` + // The metadata key for the item played + Key *string `json:"key,omitempty"` + // The library section id containing the item played + LibrarySectionID *string `json:"librarySectionID,omitempty"` + // The originally available at of the item played + OriginallyAvailableAt *string `json:"originallyAvailableAt,omitempty"` + // The rating key for the item played + RatingKey *string `json:"ratingKey,omitempty"` + // The thumb of the item played + Thumb *string `json:"thumb,omitempty"` + // The title of the item played + Title *string `json:"title,omitempty"` + // The metadata type of the item played + Type *string `json:"type,omitempty"` + // The time when the item was played + ViewedAt *int64 `json:"viewedAt,omitempty"` +} + +func (l *ListPlaybackHistoryMetadata) GetAccountID() *int64 { + if l == nil { + return nil + } + return l.AccountID +} + +func (l *ListPlaybackHistoryMetadata) GetDeviceID() *int64 { + if l == nil { + return nil + } + return l.DeviceID +} + +func (l *ListPlaybackHistoryMetadata) GetHistoryKey() *string { + if l == nil { + return nil + } + return l.HistoryKey +} + +func (l *ListPlaybackHistoryMetadata) GetKey() *string { + if l == nil { + return nil + } + return l.Key +} + +func (l *ListPlaybackHistoryMetadata) GetLibrarySectionID() *string { + if l == nil { + return nil + } + return l.LibrarySectionID +} + +func (l *ListPlaybackHistoryMetadata) GetOriginallyAvailableAt() *string { + if l == nil { + return nil + } + return l.OriginallyAvailableAt +} + +func (l *ListPlaybackHistoryMetadata) GetRatingKey() *string { + if l == nil { + return nil + } + return l.RatingKey +} + +func (l *ListPlaybackHistoryMetadata) GetThumb() *string { + if l == nil { + return nil + } + return l.Thumb +} + +func (l *ListPlaybackHistoryMetadata) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +func (l *ListPlaybackHistoryMetadata) GetType() *string { + if l == nil { + return nil + } + return l.Type +} + +func (l *ListPlaybackHistoryMetadata) GetViewedAt() *int64 { + if l == nil { + return nil + } + return l.ViewedAt +} + +// ListPlaybackHistoryMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListPlaybackHistoryMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata []ListPlaybackHistoryMetadata `json:"Metadata,omitempty"` +} + +func (l *ListPlaybackHistoryMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListPlaybackHistoryMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListPlaybackHistoryMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListPlaybackHistoryMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListPlaybackHistoryMediaContainer) GetMetadata() []ListPlaybackHistoryMetadata { + if l == nil { + return nil + } + return l.Metadata +} + +// ListPlaybackHistoryResponseBody - OK +type ListPlaybackHistoryResponseBody struct { + MediaContainer *ListPlaybackHistoryMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListPlaybackHistoryResponseBody) GetMediaContainer() *ListPlaybackHistoryMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListPlaybackHistoryResponse 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 + // OK + Object *ListPlaybackHistoryResponseBody + Headers map[string][]string +} + +func (l *ListPlaybackHistoryResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListPlaybackHistoryResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListPlaybackHistoryResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListPlaybackHistoryResponse) GetObject() *ListPlaybackHistoryResponseBody { + if l == nil { + return nil + } + return l.Object +} + +func (l *ListPlaybackHistoryResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listplaylists.go b/models/operations/listplaylists.go new file mode 100644 index 0000000..1f95603 --- /dev/null +++ b/models/operations/listplaylists.go @@ -0,0 +1,332 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListPlaylistsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListPlaylistsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPlaylistsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListPlaylistsGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListPlaylistsGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListPlaylistsGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListPlaylistsGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListPlaylistsGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListPlaylistsGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListPlaylistsGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListPlaylistsGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListPlaylistsGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListPlaylistsGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListPlaylistsGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +// 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) + } +} + +type ListPlaylistsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Limit to a type of playlist + PlaylistType *PlaylistType `queryParam:"style=form,explode=true,name=playlistType"` + // Whether this is a smart collection/playlist + Smart *bool `queryParam:"style=form,explode=true,name=smart"` +} + +func (l ListPlaylistsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPlaylistsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListPlaylistsRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListPlaylistsRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListPlaylistsRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListPlaylistsRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListPlaylistsRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListPlaylistsRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListPlaylistsRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListPlaylistsRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListPlaylistsRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListPlaylistsRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListPlaylistsRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListPlaylistsRequest) GetPlaylistType() *PlaylistType { + if l == nil { + return nil + } + return l.PlaylistType +} + +func (l *ListPlaylistsRequest) GetSmart() *bool { + if l == nil { + return nil + } + return l.Smart +} + +type ListPlaylistsResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata + Headers map[string][]string +} + +func (l *ListPlaylistsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListPlaylistsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListPlaylistsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListPlaylistsResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if l == nil { + return nil + } + return l.MediaContainerWithPlaylistMetadata +} + +func (l *ListPlaylistsResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listproviders.go b/models/operations/listproviders.go new file mode 100644 index 0000000..e973da3 --- /dev/null +++ b/models/operations/listproviders.go @@ -0,0 +1,552 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type Feature struct { + Directory []components.Directory `json:"Directory,omitempty"` + Key *string `json:"key,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (f *Feature) GetDirectory() []components.Directory { + if f == nil { + return nil + } + return f.Directory +} + +func (f *Feature) GetKey() *string { + if f == nil { + return nil + } + return f.Key +} + +func (f *Feature) GetType() *string { + if f == nil { + return nil + } + return f.Type +} + +// ListProvidersMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListProvidersMediaContainer struct { + // A unique identifier for the provider, e.g. `com.plexapp.plugins.library`. + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,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 *int64 `json:"livetv,omitempty"` + MachineIdentifier any `json:"machineIdentifier,omitempty"` + MediaProviders *bool `json:"mediaProviders,omitempty"` + Multiuser *bool `json:"multiuser,omitempty"` + MusicAnalysis *int64 `json:"musicAnalysis,omitempty"` + MyPlex *bool `json:"myPlex,omitempty"` + MyPlexMappingState any `json:"myPlexMappingState,omitempty"` + MyPlexSigninState any `json:"myPlexSigninState,omitempty"` + MyPlexSubscription *bool `json:"myPlexSubscription,omitempty"` + MyPlexUsername *string `json:"myPlexUsername,omitempty"` + OfflineTranscode any `json:"offlineTranscode,omitempty"` + // A comma-separated list of features which are enabled for the server owner + OwnerFeatures *string `json:"ownerFeatures,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 *int64 `json:"streamingBrainABRVersion,omitempty"` + StreamingBrainVersion *int64 `json:"streamingBrainVersion,omitempty"` + Sync *bool `json:"sync,omitempty"` + TranscoderActiveVideoSessions *int64 `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"` + // The suggested video quality bitrates to present to the user + TranscoderVideoBitrates any `json:"transcoderVideoBitrates,omitempty"` + TranscoderVideoQualities *string `json:"transcoderVideoQualities,omitempty"` + // The suggested video resolutions to the above quality bitrates + TranscoderVideoResolutions any `json:"transcoderVideoResolutions,omitempty"` + UpdatedAt *int64 `json:"updatedAt,omitempty"` + Updater *bool `json:"updater,omitempty"` + Version *string `json:"version,omitempty"` + VoiceSearch *bool `json:"voiceSearch,omitempty"` + Feature []Feature `json:"Feature,omitempty"` + // A comma-separated list of default protocols for the provider, which can be: + // - `stream`: The provider allows streaming media directly from the provider (e.g. for Vimeo). - `download`: The provider allows downloading media for offline storage, sync, etc. (e.g. Podcasts). - `livetv`: The provider provides live content which is only available on a schedule basis. + Protocols *string `json:"protocols,omitempty"` + // The title of the provider. + Title *string `json:"title,omitempty"` + // This attribute contains a comma-separated list of the media types exposed by the provider (e.g. `video, audio`). + Types *string `json:"types,omitempty"` +} + +func (l *ListProvidersMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListProvidersMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListProvidersMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListProvidersMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListProvidersMediaContainer) GetAllowCameraUpload() *bool { + if l == nil { + return nil + } + return l.AllowCameraUpload +} + +func (l *ListProvidersMediaContainer) GetAllowChannelAccess() *bool { + if l == nil { + return nil + } + return l.AllowChannelAccess +} + +func (l *ListProvidersMediaContainer) GetAllowMediaDeletion() *bool { + if l == nil { + return nil + } + return l.AllowMediaDeletion +} + +func (l *ListProvidersMediaContainer) GetAllowSharing() *bool { + if l == nil { + return nil + } + return l.AllowSharing +} + +func (l *ListProvidersMediaContainer) GetAllowSync() *bool { + if l == nil { + return nil + } + return l.AllowSync +} + +func (l *ListProvidersMediaContainer) GetAllowTuners() *bool { + if l == nil { + return nil + } + return l.AllowTuners +} + +func (l *ListProvidersMediaContainer) GetBackgroundProcessing() *bool { + if l == nil { + return nil + } + return l.BackgroundProcessing +} + +func (l *ListProvidersMediaContainer) GetCertificate() *bool { + if l == nil { + return nil + } + return l.Certificate +} + +func (l *ListProvidersMediaContainer) GetCompanionProxy() *bool { + if l == nil { + return nil + } + return l.CompanionProxy +} + +func (l *ListProvidersMediaContainer) GetCountryCode() *string { + if l == nil { + return nil + } + return l.CountryCode +} + +func (l *ListProvidersMediaContainer) GetDiagnostics() *string { + if l == nil { + return nil + } + return l.Diagnostics +} + +func (l *ListProvidersMediaContainer) GetEventStream() *bool { + if l == nil { + return nil + } + return l.EventStream +} + +func (l *ListProvidersMediaContainer) GetFriendlyName() *string { + if l == nil { + return nil + } + return l.FriendlyName +} + +func (l *ListProvidersMediaContainer) GetHubSearch() *bool { + if l == nil { + return nil + } + return l.HubSearch +} + +func (l *ListProvidersMediaContainer) GetItemClusters() *bool { + if l == nil { + return nil + } + return l.ItemClusters +} + +func (l *ListProvidersMediaContainer) GetLivetv() *int64 { + if l == nil { + return nil + } + return l.Livetv +} + +func (l *ListProvidersMediaContainer) GetMachineIdentifier() any { + if l == nil { + return nil + } + return l.MachineIdentifier +} + +func (l *ListProvidersMediaContainer) GetMediaProviders() *bool { + if l == nil { + return nil + } + return l.MediaProviders +} + +func (l *ListProvidersMediaContainer) GetMultiuser() *bool { + if l == nil { + return nil + } + return l.Multiuser +} + +func (l *ListProvidersMediaContainer) GetMusicAnalysis() *int64 { + if l == nil { + return nil + } + return l.MusicAnalysis +} + +func (l *ListProvidersMediaContainer) GetMyPlex() *bool { + if l == nil { + return nil + } + return l.MyPlex +} + +func (l *ListProvidersMediaContainer) GetMyPlexMappingState() any { + if l == nil { + return nil + } + return l.MyPlexMappingState +} + +func (l *ListProvidersMediaContainer) GetMyPlexSigninState() any { + if l == nil { + return nil + } + return l.MyPlexSigninState +} + +func (l *ListProvidersMediaContainer) GetMyPlexSubscription() *bool { + if l == nil { + return nil + } + return l.MyPlexSubscription +} + +func (l *ListProvidersMediaContainer) GetMyPlexUsername() *string { + if l == nil { + return nil + } + return l.MyPlexUsername +} + +func (l *ListProvidersMediaContainer) GetOfflineTranscode() any { + if l == nil { + return nil + } + return l.OfflineTranscode +} + +func (l *ListProvidersMediaContainer) GetOwnerFeatures() *string { + if l == nil { + return nil + } + return l.OwnerFeatures +} + +func (l *ListProvidersMediaContainer) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListProvidersMediaContainer) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListProvidersMediaContainer) GetPluginHost() *bool { + if l == nil { + return nil + } + return l.PluginHost +} + +func (l *ListProvidersMediaContainer) GetPushNotifications() *bool { + if l == nil { + return nil + } + return l.PushNotifications +} + +func (l *ListProvidersMediaContainer) GetReadOnlyLibraries() *bool { + if l == nil { + return nil + } + return l.ReadOnlyLibraries +} + +func (l *ListProvidersMediaContainer) GetStreamingBrainABRVersion() *int64 { + if l == nil { + return nil + } + return l.StreamingBrainABRVersion +} + +func (l *ListProvidersMediaContainer) GetStreamingBrainVersion() *int64 { + if l == nil { + return nil + } + return l.StreamingBrainVersion +} + +func (l *ListProvidersMediaContainer) GetSync() *bool { + if l == nil { + return nil + } + return l.Sync +} + +func (l *ListProvidersMediaContainer) GetTranscoderActiveVideoSessions() *int64 { + if l == nil { + return nil + } + return l.TranscoderActiveVideoSessions +} + +func (l *ListProvidersMediaContainer) GetTranscoderAudio() *bool { + if l == nil { + return nil + } + return l.TranscoderAudio +} + +func (l *ListProvidersMediaContainer) GetTranscoderLyrics() *bool { + if l == nil { + return nil + } + return l.TranscoderLyrics +} + +func (l *ListProvidersMediaContainer) GetTranscoderPhoto() *bool { + if l == nil { + return nil + } + return l.TranscoderPhoto +} + +func (l *ListProvidersMediaContainer) GetTranscoderSubtitles() *bool { + if l == nil { + return nil + } + return l.TranscoderSubtitles +} + +func (l *ListProvidersMediaContainer) GetTranscoderVideo() *bool { + if l == nil { + return nil + } + return l.TranscoderVideo +} + +func (l *ListProvidersMediaContainer) GetTranscoderVideoBitrates() any { + if l == nil { + return nil + } + return l.TranscoderVideoBitrates +} + +func (l *ListProvidersMediaContainer) GetTranscoderVideoQualities() *string { + if l == nil { + return nil + } + return l.TranscoderVideoQualities +} + +func (l *ListProvidersMediaContainer) GetTranscoderVideoResolutions() any { + if l == nil { + return nil + } + return l.TranscoderVideoResolutions +} + +func (l *ListProvidersMediaContainer) GetUpdatedAt() *int64 { + if l == nil { + return nil + } + return l.UpdatedAt +} + +func (l *ListProvidersMediaContainer) GetUpdater() *bool { + if l == nil { + return nil + } + return l.Updater +} + +func (l *ListProvidersMediaContainer) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListProvidersMediaContainer) GetVoiceSearch() *bool { + if l == nil { + return nil + } + return l.VoiceSearch +} + +func (l *ListProvidersMediaContainer) GetFeature() []Feature { + if l == nil { + return nil + } + return l.Feature +} + +func (l *ListProvidersMediaContainer) GetProtocols() *string { + if l == nil { + return nil + } + return l.Protocols +} + +func (l *ListProvidersMediaContainer) GetTitle() *string { + if l == nil { + return nil + } + return l.Title +} + +func (l *ListProvidersMediaContainer) GetTypes() *string { + if l == nil { + return nil + } + return l.Types +} + +// ListProvidersResponseBody - OK +type ListProvidersResponseBody struct { + MediaContainer *ListProvidersMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListProvidersResponseBody) GetMediaContainer() *ListProvidersMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListProvidersResponse 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 + // OK + Object *ListProvidersResponseBody +} + +func (l *ListProvidersResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListProvidersResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListProvidersResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListProvidersResponse) GetObject() *ListProvidersResponseBody { + if l == nil { + return nil + } + return l.Object +} diff --git a/models/operations/listsessions.go b/models/operations/listsessions.go new file mode 100644 index 0000000..bdc3625 --- /dev/null +++ b/models/operations/listsessions.go @@ -0,0 +1,765 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +// Metadata - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie. +// +// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items. +// +// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show. +type Metadata struct { + // Information about the player being used for playback + Player *components.Player `json:"Player,omitempty"` + // Information about the playback session + Session *components.Session `json:"Session,omitempty"` + // The user playing the content + User *components.User `json:"User,omitempty"` + // The title of the item (e.g. “300” or “The Simpsons”) + Title any `json:"title,omitempty"` + // The type of the video item, such as `movie`, `episode`, or `clip`. + Type any `json:"type,omitempty"` + // When present, contains the disc number for a track on multi-disc albums. + AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was added to the library. + AddedAt *int64 `json:"addedAt,omitempty"` + // When present, the URL for the background artwork for the item. + Art any `json:"art,omitempty"` + // Some rating systems separate reviewer ratings from audience ratings + AudienceRating *float64 `json:"audienceRating,omitempty"` + // A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled). + AudienceRatingImage any `json:"audienceRatingImage,omitempty"` + Autotag []components.Tag `json:"Autotag,omitempty"` + // When present, the URL for a banner graphic for the item. + Banner any `json:"banner,omitempty"` + // When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two). + ChapterSource any `json:"chapterSource,omitempty"` + // When present, the URL for a composite image for descendent items (e.g. photo albums or playlists). + Composite any `json:"composite,omitempty"` + // If known, the content rating (e.g. MPAA) for an item. + ContentRating any `json:"contentRating,omitempty"` + Country []components.Tag `json:"Country,omitempty"` + Director []components.Tag `json:"Director,omitempty"` + // When present, the duration for the item, in units of milliseconds. + Duration *int64 `json:"duration,omitempty"` + // Typically only seen in metadata at a library's top level + Filter []components.Filter `json:"Filter,omitempty"` + Genre []components.Tag `json:"Genre,omitempty"` + // The `art` of the grandparent + GrandparentArt *string `json:"grandparentArt,omitempty"` + // The `hero` of the grandparent + GrandparentHero *string `json:"grandparentHero,omitempty"` + // The `key` of the grandparent + GrandparentKey *string `json:"grandparentKey,omitempty"` + // The `ratingKey` of the grandparent + GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` + // The `theme` of the grandparent + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + // The `thumb` of the grandparent + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + // The `title` of the grandparent + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + GUID []components.Tag `json:"Guid,omitempty"` + // When present, the URL for a hero image for the item. + Hero any `json:"hero,omitempty"` + Image []components.Image `json:"Image,omitempty"` + // When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks. + Index *int64 `json:"index,omitempty"` + // The key at which the item's details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details. + Key any `json:"key,omitempty"` + // When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time. + LastViewedAt *int64 `json:"lastViewedAt,omitempty"` + // For shows and seasons, contains the number of total episodes. + LeafCount *int64 `json:"leafCount,omitempty"` + Media []components.Media `json:"Media,omitempty"` + // When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well. + OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"` + // When present, used to indicate an item's original title, e.g. a movie's foreign title. + OriginalTitle any `json:"originalTitle,omitempty"` + // The `hero` of the parent + ParentHero *string `json:"parentHero,omitempty"` + // The `index` of the parent + ParentIndex *int64 `json:"parentIndex,omitempty"` + // The `key` of the parent + ParentKey *string `json:"parentKey,omitempty"` + // The `ratingKey` of the parent + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + // The `thumb` of the parent + ParentThumb *string `json:"parentThumb,omitempty"` + // The `title` of the parent + ParentTitle *string `json:"parentTitle,omitempty"` + // Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item. + PrimaryExtraKey any `json:"primaryExtraKey,omitempty"` + // Prompt to give the user for this directory (such as `Search Movies`) + Prompt *string `json:"prompt,omitempty"` + // When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from. + Rating *float64 `json:"rating,omitempty"` + RatingArray []components.Tag `json:"Rating,omitempty"` + // Number of ratings under this metadata + RatingCount *int64 `json:"ratingCount,omitempty"` + // When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten. + RatingImage any `json:"ratingImage,omitempty"` + // This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed. + RatingKey any `json:"ratingKey,omitempty"` + Role []components.Tag `json:"Role,omitempty"` + // Indicates this is a search directory + Search *bool `json:"search,omitempty"` + // Used by old clients to provide nested menus allowing for primative (but structured) navigation. + Secondary *bool `json:"secondary,omitempty"` + // When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc. + SkipChildren *bool `json:"skipChildren,omitempty"` + // When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show). + SkipParent *bool `json:"skipParent,omitempty"` + // Typically only seen in metadata at a library's top level + Sort []components.Sort `json:"Sort,omitempty"` + // When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums). + Studio any `json:"studio,omitempty"` + // The subtype of the video item, such as `photo` when the video item is in a photo library + Subtype any `json:"subtype,omitempty"` + // When present, the extended textual information about the item (e.g. movie plot, artist biography, album review). + Summary any `json:"summary,omitempty"` + // When present, a pithy one-liner about the item (usually only seen for movies). + Tagline any `json:"tagline,omitempty"` + // When present, the URL for theme music for the item (usually only for TV shows). + Theme any `json:"theme,omitempty"` + // When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail. + Thumb any `json:"thumb,omitempty"` + // Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”). + TitleSort any `json:"titleSort,omitempty"` + // In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated). + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // When the user has rated an item, this contains the user rating + UserRating *float64 `json:"userRating,omitempty"` + // When a users has completed watched or listened to an item, this attribute contains the number of consumptions. + ViewCount *int64 `json:"viewCount,omitempty"` + // For shows and seasons, contains the number of viewed episodes. + ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` + // When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds. + ViewOffset *int64 `json:"viewOffset,omitempty"` + Writer []components.Tag `json:"Writer,omitempty"` + // When present, the year associated with the item's release (e.g. release year for a movie). + Year *int64 `json:"year,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +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, nil); err != nil { + return err + } + return nil +} + +func (m *Metadata) GetPlayer() *components.Player { + if m == nil { + return nil + } + return m.Player +} + +func (m *Metadata) GetSession() *components.Session { + if m == nil { + return nil + } + return m.Session +} + +func (m *Metadata) GetUser() *components.User { + if m == nil { + return nil + } + return m.User +} + +func (m *Metadata) GetTitle() any { + if m == nil { + return nil + } + return m.Title +} + +func (m *Metadata) GetType() any { + if m == nil { + return nil + } + return m.Type +} + +func (m *Metadata) GetAbsoluteIndex() *int64 { + if m == nil { + return nil + } + return m.AbsoluteIndex +} + +func (m *Metadata) GetAddedAt() *int64 { + if m == nil { + return nil + } + return m.AddedAt +} + +func (m *Metadata) GetArt() any { + if m == nil { + return nil + } + return m.Art +} + +func (m *Metadata) GetAudienceRating() *float64 { + if m == nil { + return nil + } + return m.AudienceRating +} + +func (m *Metadata) GetAudienceRatingImage() any { + if m == nil { + return nil + } + return m.AudienceRatingImage +} + +func (m *Metadata) GetAutotag() []components.Tag { + if m == nil { + return nil + } + return m.Autotag +} + +func (m *Metadata) GetBanner() any { + if m == nil { + return nil + } + return m.Banner +} + +func (m *Metadata) GetChapterSource() any { + if m == nil { + return nil + } + return m.ChapterSource +} + +func (m *Metadata) GetComposite() any { + if m == nil { + return nil + } + return m.Composite +} + +func (m *Metadata) GetContentRating() any { + if m == nil { + return nil + } + return m.ContentRating +} + +func (m *Metadata) GetCountry() []components.Tag { + if m == nil { + return nil + } + return m.Country +} + +func (m *Metadata) GetDirector() []components.Tag { + if m == nil { + return nil + } + return m.Director +} + +func (m *Metadata) GetDuration() *int64 { + if m == nil { + return nil + } + return m.Duration +} + +func (m *Metadata) GetFilter() []components.Filter { + if m == nil { + return nil + } + return m.Filter +} + +func (m *Metadata) GetGenre() []components.Tag { + if m == nil { + return nil + } + return m.Genre +} + +func (m *Metadata) GetGrandparentArt() *string { + if m == nil { + return nil + } + return m.GrandparentArt +} + +func (m *Metadata) GetGrandparentHero() *string { + if m == nil { + return nil + } + return m.GrandparentHero +} + +func (m *Metadata) GetGrandparentKey() *string { + if m == nil { + return nil + } + return m.GrandparentKey +} + +func (m *Metadata) GetGrandparentRatingKey() *string { + if m == nil { + return nil + } + return m.GrandparentRatingKey +} + +func (m *Metadata) GetGrandparentTheme() *string { + if m == nil { + return nil + } + return m.GrandparentTheme +} + +func (m *Metadata) GetGrandparentThumb() *string { + if m == nil { + return nil + } + return m.GrandparentThumb +} + +func (m *Metadata) GetGrandparentTitle() *string { + if m == nil { + return nil + } + return m.GrandparentTitle +} + +func (m *Metadata) GetGUID() []components.Tag { + if m == nil { + return nil + } + return m.GUID +} + +func (m *Metadata) GetHero() any { + if m == nil { + return nil + } + return m.Hero +} + +func (m *Metadata) GetImage() []components.Image { + if m == nil { + return nil + } + return m.Image +} + +func (m *Metadata) GetIndex() *int64 { + if m == nil { + return nil + } + return m.Index +} + +func (m *Metadata) GetKey() any { + if m == nil { + return nil + } + return m.Key +} + +func (m *Metadata) GetLastViewedAt() *int64 { + if m == nil { + return nil + } + return m.LastViewedAt +} + +func (m *Metadata) GetLeafCount() *int64 { + if m == nil { + return nil + } + return m.LeafCount +} + +func (m *Metadata) GetMedia() []components.Media { + if m == nil { + return nil + } + return m.Media +} + +func (m *Metadata) GetOriginallyAvailableAt() any { + if m == nil { + return nil + } + return m.OriginallyAvailableAt +} + +func (m *Metadata) GetOriginalTitle() any { + if m == nil { + return nil + } + return m.OriginalTitle +} + +func (m *Metadata) GetParentHero() *string { + if m == nil { + return nil + } + return m.ParentHero +} + +func (m *Metadata) GetParentIndex() *int64 { + if m == nil { + return nil + } + return m.ParentIndex +} + +func (m *Metadata) GetParentKey() *string { + if m == nil { + return nil + } + return m.ParentKey +} + +func (m *Metadata) GetParentRatingKey() *string { + if m == nil { + return nil + } + return m.ParentRatingKey +} + +func (m *Metadata) GetParentThumb() *string { + if m == nil { + return nil + } + return m.ParentThumb +} + +func (m *Metadata) GetParentTitle() *string { + if m == nil { + return nil + } + return m.ParentTitle +} + +func (m *Metadata) GetPrimaryExtraKey() any { + if m == nil { + return nil + } + return m.PrimaryExtraKey +} + +func (m *Metadata) GetPrompt() *string { + if m == nil { + return nil + } + return m.Prompt +} + +func (m *Metadata) GetRating() *float64 { + if m == nil { + return nil + } + return m.Rating +} + +func (m *Metadata) GetRatingArray() []components.Tag { + if m == nil { + return nil + } + return m.RatingArray +} + +func (m *Metadata) GetRatingCount() *int64 { + if m == nil { + return nil + } + return m.RatingCount +} + +func (m *Metadata) GetRatingImage() any { + if m == nil { + return nil + } + return m.RatingImage +} + +func (m *Metadata) GetRatingKey() any { + if m == nil { + return nil + } + return m.RatingKey +} + +func (m *Metadata) GetRole() []components.Tag { + if m == nil { + return nil + } + return m.Role +} + +func (m *Metadata) GetSearch() *bool { + if m == nil { + return nil + } + return m.Search +} + +func (m *Metadata) GetSecondary() *bool { + if m == nil { + return nil + } + return m.Secondary +} + +func (m *Metadata) GetSkipChildren() *bool { + if m == nil { + return nil + } + return m.SkipChildren +} + +func (m *Metadata) GetSkipParent() *bool { + if m == nil { + return nil + } + return m.SkipParent +} + +func (m *Metadata) GetSort() []components.Sort { + if m == nil { + return nil + } + return m.Sort +} + +func (m *Metadata) GetStudio() any { + if m == nil { + return nil + } + return m.Studio +} + +func (m *Metadata) GetSubtype() any { + if m == nil { + return nil + } + return m.Subtype +} + +func (m *Metadata) GetSummary() any { + if m == nil { + return nil + } + return m.Summary +} + +func (m *Metadata) GetTagline() any { + if m == nil { + return nil + } + return m.Tagline +} + +func (m *Metadata) GetTheme() any { + if m == nil { + return nil + } + return m.Theme +} + +func (m *Metadata) GetThumb() any { + if m == nil { + return nil + } + return m.Thumb +} + +func (m *Metadata) GetTitleSort() any { + if m == nil { + return nil + } + return m.TitleSort +} + +func (m *Metadata) GetUpdatedAt() *int64 { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *Metadata) GetUserRating() *float64 { + if m == nil { + return nil + } + return m.UserRating +} + +func (m *Metadata) GetViewCount() *int64 { + if m == nil { + return nil + } + return m.ViewCount +} + +func (m *Metadata) GetViewedLeafCount() *int64 { + if m == nil { + return nil + } + return m.ViewedLeafCount +} + +func (m *Metadata) GetViewOffset() *int64 { + if m == nil { + return nil + } + return m.ViewOffset +} + +func (m *Metadata) GetWriter() []components.Tag { + if m == nil { + return nil + } + return m.Writer +} + +func (m *Metadata) GetYear() *int64 { + if m == nil { + return nil + } + return m.Year +} + +func (m *Metadata) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +// ListSessionsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListSessionsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Metadata []Metadata `json:"Metadata,omitempty"` +} + +func (l *ListSessionsMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListSessionsMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListSessionsMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListSessionsMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListSessionsMediaContainer) GetMetadata() []Metadata { + if l == nil { + return nil + } + return l.Metadata +} + +// ListSessionsResponseBody - OK +type ListSessionsResponseBody struct { + MediaContainer *ListSessionsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListSessionsResponseBody) GetMediaContainer() *ListSessionsMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListSessionsResponse 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 + // OK + Object *ListSessionsResponseBody + Headers map[string][]string +} + +func (l *ListSessionsResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListSessionsResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListSessionsResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListSessionsResponse) GetObject() *ListSessionsResponseBody { + if l == nil { + return nil + } + return l.Object +} + +func (l *ListSessionsResponse) GetHeaders() map[string][]string { + if l == nil { + return map[string][]string{} + } + return l.Headers +} diff --git a/models/operations/listsimilar.go b/models/operations/listsimilar.go new file mode 100644 index 0000000..79aa0fa --- /dev/null +++ b/models/operations/listsimilar.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListSimilarGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListSimilarGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListSimilarGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListSimilarGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListSimilarGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListSimilarGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListSimilarGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListSimilarGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListSimilarGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListSimilarGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListSimilarGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListSimilarGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListSimilarGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListSimilarGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListSimilarRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + // Limit results to count items + Count *int64 `queryParam:"style=form,explode=true,name=count"` +} + +func (l ListSimilarRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListSimilarRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (l *ListSimilarRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListSimilarRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListSimilarRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListSimilarRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListSimilarRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListSimilarRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListSimilarRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListSimilarRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListSimilarRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListSimilarRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListSimilarRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListSimilarRequest) GetIds() string { + if l == nil { + return "" + } + return l.Ids +} + +func (l *ListSimilarRequest) GetCount() *int64 { + if l == nil { + return nil + } + return l.Count +} + +type ListSimilarResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (l *ListSimilarResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListSimilarResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListSimilarResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListSimilarResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if l == nil { + return nil + } + return l.MediaContainerWithMetadata +} diff --git a/models/operations/listsonicallysimilar.go b/models/operations/listsonicallysimilar.go new file mode 100644 index 0000000..555d4d8 --- /dev/null +++ b/models/operations/listsonicallysimilar.go @@ -0,0 +1,314 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListSonicallySimilarGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListSonicallySimilarGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListSonicallySimilarGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListSonicallySimilarGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListSonicallySimilarGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListSonicallySimilarGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListSonicallySimilarGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListSonicallySimilarGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListSonicallySimilarGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListSonicallySimilarGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListSonicallySimilarGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListSonicallySimilarGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListSonicallySimilarGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListSonicallySimilarGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListSonicallySimilarRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + ExcludeParentID *int64 `queryParam:"style=form,explode=true,name=excludeParentID"` + ExcludeGrandparentID *int64 `queryParam:"style=form,explode=true,name=excludeGrandparentID"` + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` + MaxDistance *float64 `queryParam:"style=form,explode=true,name=maxDistance"` +} + +func (l ListSonicallySimilarRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListSonicallySimilarRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (l *ListSonicallySimilarRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListSonicallySimilarRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListSonicallySimilarRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListSonicallySimilarRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListSonicallySimilarRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListSonicallySimilarRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListSonicallySimilarRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListSonicallySimilarRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListSonicallySimilarRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListSonicallySimilarRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListSonicallySimilarRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListSonicallySimilarRequest) GetIds() string { + if l == nil { + return "" + } + return l.Ids +} + +func (l *ListSonicallySimilarRequest) GetExcludeParentID() *int64 { + if l == nil { + return nil + } + return l.ExcludeParentID +} + +func (l *ListSonicallySimilarRequest) GetExcludeGrandparentID() *int64 { + if l == nil { + return nil + } + return l.ExcludeGrandparentID +} + +func (l *ListSonicallySimilarRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +func (l *ListSonicallySimilarRequest) GetMaxDistance() *float64 { + if l == nil { + return nil + } + return l.MaxDistance +} + +type ListSonicallySimilarResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (l *ListSonicallySimilarResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListSonicallySimilarResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListSonicallySimilarResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListSonicallySimilarResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if l == nil { + return nil + } + return l.MediaContainerWithMetadata +} diff --git a/models/operations/listtopusers.go b/models/operations/listtopusers.go new file mode 100644 index 0000000..ae5f09a --- /dev/null +++ b/models/operations/listtopusers.go @@ -0,0 +1,363 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ListTopUsersGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (l ListTopUsersGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListTopUsersGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListTopUsersGlobals) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListTopUsersGlobals) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListTopUsersGlobals) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListTopUsersGlobals) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListTopUsersGlobals) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListTopUsersGlobals) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListTopUsersGlobals) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListTopUsersGlobals) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListTopUsersGlobals) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListTopUsersGlobals) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListTopUsersGlobals) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +type ListTopUsersRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (l ListTopUsersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListTopUsersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (l *ListTopUsersRequest) GetAccepts() *components.Accepts { + if l == nil { + return nil + } + return l.Accepts +} + +func (l *ListTopUsersRequest) GetClientIdentifier() *string { + if l == nil { + return nil + } + return l.ClientIdentifier +} + +func (l *ListTopUsersRequest) GetProduct() *string { + if l == nil { + return nil + } + return l.Product +} + +func (l *ListTopUsersRequest) GetVersion() *string { + if l == nil { + return nil + } + return l.Version +} + +func (l *ListTopUsersRequest) GetPlatform() *string { + if l == nil { + return nil + } + return l.Platform +} + +func (l *ListTopUsersRequest) GetPlatformVersion() *string { + if l == nil { + return nil + } + return l.PlatformVersion +} + +func (l *ListTopUsersRequest) GetDevice() *string { + if l == nil { + return nil + } + return l.Device +} + +func (l *ListTopUsersRequest) GetModel() *string { + if l == nil { + return nil + } + return l.Model +} + +func (l *ListTopUsersRequest) GetDeviceVendor() *string { + if l == nil { + return nil + } + return l.DeviceVendor +} + +func (l *ListTopUsersRequest) GetDeviceName() *string { + if l == nil { + return nil + } + return l.DeviceName +} + +func (l *ListTopUsersRequest) GetMarketplace() *string { + if l == nil { + return nil + } + return l.Marketplace +} + +func (l *ListTopUsersRequest) GetIds() string { + if l == nil { + return "" + } + return l.Ids +} + +type Account struct { + GlobalViewCount *int64 `json:"globalViewCount,omitempty"` + ID *int64 `json:"id,omitempty"` +} + +func (a *Account) GetGlobalViewCount() *int64 { + if a == nil { + return nil + } + return a.GlobalViewCount +} + +func (a *Account) GetID() *int64 { + if a == nil { + return nil + } + return a.ID +} + +// ListTopUsersMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ListTopUsersMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Account []Account `json:"Account,omitempty"` +} + +func (l *ListTopUsersMediaContainer) GetIdentifier() *string { + if l == nil { + return nil + } + return l.Identifier +} + +func (l *ListTopUsersMediaContainer) GetOffset() *int64 { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListTopUsersMediaContainer) GetSize() *int64 { + if l == nil { + return nil + } + return l.Size +} + +func (l *ListTopUsersMediaContainer) GetTotalSize() *int64 { + if l == nil { + return nil + } + return l.TotalSize +} + +func (l *ListTopUsersMediaContainer) GetAccount() []Account { + if l == nil { + return nil + } + return l.Account +} + +// ListTopUsersResponseBody - OK +type ListTopUsersResponseBody struct { + MediaContainer *ListTopUsersMediaContainer `json:"MediaContainer,omitempty"` +} + +func (l *ListTopUsersResponseBody) GetMediaContainer() *ListTopUsersMediaContainer { + if l == nil { + return nil + } + return l.MediaContainer +} + +type ListTopUsersResponse 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 + // OK + Object *ListTopUsersResponseBody +} + +func (l *ListTopUsersResponse) GetContentType() string { + if l == nil { + return "" + } + return l.ContentType +} + +func (l *ListTopUsersResponse) GetStatusCode() int { + if l == nil { + return 0 + } + return l.StatusCode +} + +func (l *ListTopUsersResponse) GetRawResponse() *http.Response { + if l == nil { + return nil + } + return l.RawResponse +} + +func (l *ListTopUsersResponse) GetObject() *ListTopUsersResponseBody { + if l == nil { + return nil + } + return l.Object +} diff --git a/models/operations/logline.go b/models/operations/logline.go deleted file mode 100644 index 4c9263b..0000000 --- a/models/operations/logline.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "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 -} - -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 (l *LogLineRequest) GetLevel() Level { - if l == nil { - return Level(0) - } - return l.Level -} - -func (l *LogLineRequest) GetMessage() string { - if l == nil { - return "" - } - return l.Message -} - -func (l *LogLineRequest) GetSource() string { - if l == nil { - return "" - } - return l.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 (l *LogLineResponse) GetContentType() string { - if l == nil { - return "" - } - return l.ContentType -} - -func (l *LogLineResponse) GetStatusCode() int { - if l == nil { - return 0 - } - return l.StatusCode -} - -func (l *LogLineResponse) GetRawResponse() *http.Response { - if l == nil { - return nil - } - return l.RawResponse -} diff --git a/models/operations/logmultiline.go b/models/operations/logmultiline.go deleted file mode 100644 index 7c72bfc..0000000 --- a/models/operations/logmultiline.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (l *LogMultiLineResponse) GetContentType() string { - if l == nil { - return "" - } - return l.ContentType -} - -func (l *LogMultiLineResponse) GetStatusCode() int { - if l == nil { - return 0 - } - return l.StatusCode -} - -func (l *LogMultiLineResponse) GetRawResponse() *http.Response { - if l == nil { - return nil - } - return l.RawResponse -} diff --git a/models/operations/makedecision.go b/models/operations/makedecision.go new file mode 100644 index 0000000..c6ed8ce --- /dev/null +++ b/models/operations/makedecision.go @@ -0,0 +1,660 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MakeDecisionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MakeDecisionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MakeDecisionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MakeDecisionGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MakeDecisionGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MakeDecisionGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MakeDecisionGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MakeDecisionGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MakeDecisionGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MakeDecisionGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MakeDecisionGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MakeDecisionGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MakeDecisionGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MakeDecisionGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +// Location - Network type of the client, can be used to help determine target bitrate. +type Location string + +const ( + LocationLan Location = "lan" + LocationWan Location = "wan" + LocationCellular Location = "cellular" +) + +func (e Location) ToPointer() *Location { + return &e +} +func (e *Location) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "lan": + fallthrough + case "wan": + fallthrough + case "cellular": + *e = Location(v) + return nil + default: + return fmt.Errorf("invalid value for Location: %v", v) + } +} + +// Protocol - Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) +type Protocol string + +const ( + ProtocolHTTP Protocol = "http" + ProtocolHls Protocol = "hls" + ProtocolDash Protocol = "dash" +) + +func (e Protocol) ToPointer() *Protocol { + return &e +} +func (e *Protocol) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "http": + fallthrough + case "hls": + fallthrough + case "dash": + *e = Protocol(v) + return nil + default: + return fmt.Errorf("invalid value for Protocol: %v", v) + } +} + +// Subtitles - Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream +type Subtitles string + +const ( + SubtitlesAuto Subtitles = "auto" + SubtitlesBurn Subtitles = "burn" + SubtitlesNone Subtitles = "none" + SubtitlesSidecar Subtitles = "sidecar" + SubtitlesEmbedded Subtitles = "embedded" + SubtitlesSegmented Subtitles = "segmented" + SubtitlesUnknown Subtitles = "unknown" +) + +func (e Subtitles) ToPointer() *Subtitles { + return &e +} +func (e *Subtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + fallthrough + case "burn": + fallthrough + case "none": + fallthrough + case "sidecar": + fallthrough + case "embedded": + fallthrough + case "segmented": + fallthrough + case "unknown": + *e = Subtitles(v) + return nil + default: + return fmt.Errorf("invalid value for Subtitles: %v", v) + } +} + +type MakeDecisionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Type of transcode media + TranscodeType components.TranscodeType `pathParam:"style=simple,explode=false,name=transcodeType"` + // Transcode session UUID + TranscodeSessionID *string `queryParam:"style=form,explode=true,name=transcodeSessionId"` + // Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost + // + AdvancedSubtitles *components.AdvancedSubtitles `queryParam:"style=form,explode=true,name=advancedSubtitles"` + // Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) + AudioBoost *int64 `queryParam:"style=form,explode=true,name=audioBoost"` + // Target video number of audio channels. + AudioChannelCount *int64 `queryParam:"style=form,explode=true,name=audioChannelCount"` + // Indicates the client supports ABR. + AutoAdjustQuality *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustQuality"` + // Indicates if the server should adjust subtitles based on Voice Activity Data. + AutoAdjustSubtitle *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustSubtitle"` + // Indicates the client supports direct playing the indicated content. + DirectPlay *components.BoolInt `queryParam:"style=form,explode=true,name=directPlay"` + // Indicates the client supports direct streaming the video of the indicated content. + DirectStream *components.BoolInt `queryParam:"style=form,explode=true,name=directStream"` + // Indicates the client supports direct streaming the audio of the indicated content. + DirectStreamAudio *components.BoolInt `queryParam:"style=form,explode=true,name=directStreamAudio"` + // Indicates if resolution should be adjusted for orientation. + DisableResolutionRotation *components.BoolInt `queryParam:"style=form,explode=true,name=disableResolutionRotation"` + // Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 + HasMDE *components.BoolInt `queryParam:"style=form,explode=true,name=hasMDE"` + // Network type of the client, can be used to help determine target bitrate. + Location *Location `queryParam:"style=form,explode=true,name=location"` + // Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. + MediaBufferSize *int64 `queryParam:"style=form,explode=true,name=mediaBufferSize"` + // Index of the media to transcode. -1 or not specified indicates let the server choose. + MediaIndex *int64 `queryParam:"style=form,explode=true,name=mediaIndex"` + // Target bitrate for audio only files (in kbps, used to transcode). + MusicBitrate *int64 `queryParam:"style=form,explode=true,name=musicBitrate"` + // Offset from the start of the media (in seconds). + Offset *float64 `queryParam:"style=form,explode=true,name=offset"` + // Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode + PartIndex *int64 `queryParam:"style=form,explode=true,name=partIndex"` + // Internal PMS path of the media to transcode. + Path *string `queryParam:"style=form,explode=true,name=path"` + // Maximum bitrate (in kbps) to use in ABR. + PeakBitrate *int64 `queryParam:"style=form,explode=true,name=peakBitrate"` + // Target photo resolution. + PhotoResolution *string `queryParam:"style=form,explode=true,name=photoResolution"` + // Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + // + Protocol *Protocol `queryParam:"style=form,explode=true,name=protocol"` + // Number of seconds to include in each transcoded segment + SecondsPerSegment *int64 `queryParam:"style=form,explode=true,name=secondsPerSegment"` + // Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) + SubtitleSize *int64 `queryParam:"style=form,explode=true,name=subtitleSize"` + // Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + // + Subtitles *Subtitles `queryParam:"style=form,explode=true,name=subtitles"` + // Target video bitrate (in kbps). + VideoBitrate *int64 `queryParam:"style=form,explode=true,name=videoBitrate"` + // Target photo quality. + VideoQuality *int64 `queryParam:"style=form,explode=true,name=videoQuality"` + // Target maximum video resolution. + VideoResolution *string `queryParam:"style=form,explode=true,name=videoResolution"` + // See [Profile Augmentations](#section/API-Info/Profile-Augmentations) . + XPlexClientProfileExtra *string `header:"style=simple,explode=false,name=X-Plex-Client-Profile-Extra"` + // Which built in Client Profile to use in the decision. Generally should only be used to specify the Generic profile. + XPlexClientProfileName *string `header:"style=simple,explode=false,name=X-Plex-Client-Profile-Name"` + // Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) + XPlexSessionIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Session-Identifier"` +} + +func (m MakeDecisionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MakeDecisionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"transcodeType"}); err != nil { + return err + } + return nil +} + +func (m *MakeDecisionRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MakeDecisionRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MakeDecisionRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MakeDecisionRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MakeDecisionRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MakeDecisionRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MakeDecisionRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MakeDecisionRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MakeDecisionRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MakeDecisionRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MakeDecisionRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MakeDecisionRequest) GetTranscodeType() components.TranscodeType { + if m == nil { + return components.TranscodeType("") + } + return m.TranscodeType +} + +func (m *MakeDecisionRequest) GetTranscodeSessionID() *string { + if m == nil { + return nil + } + return m.TranscodeSessionID +} + +func (m *MakeDecisionRequest) GetAdvancedSubtitles() *components.AdvancedSubtitles { + if m == nil { + return nil + } + return m.AdvancedSubtitles +} + +func (m *MakeDecisionRequest) GetAudioBoost() *int64 { + if m == nil { + return nil + } + return m.AudioBoost +} + +func (m *MakeDecisionRequest) GetAudioChannelCount() *int64 { + if m == nil { + return nil + } + return m.AudioChannelCount +} + +func (m *MakeDecisionRequest) GetAutoAdjustQuality() *components.BoolInt { + if m == nil { + return nil + } + return m.AutoAdjustQuality +} + +func (m *MakeDecisionRequest) GetAutoAdjustSubtitle() *components.BoolInt { + if m == nil { + return nil + } + return m.AutoAdjustSubtitle +} + +func (m *MakeDecisionRequest) GetDirectPlay() *components.BoolInt { + if m == nil { + return nil + } + return m.DirectPlay +} + +func (m *MakeDecisionRequest) GetDirectStream() *components.BoolInt { + if m == nil { + return nil + } + return m.DirectStream +} + +func (m *MakeDecisionRequest) GetDirectStreamAudio() *components.BoolInt { + if m == nil { + return nil + } + return m.DirectStreamAudio +} + +func (m *MakeDecisionRequest) GetDisableResolutionRotation() *components.BoolInt { + if m == nil { + return nil + } + return m.DisableResolutionRotation +} + +func (m *MakeDecisionRequest) GetHasMDE() *components.BoolInt { + if m == nil { + return nil + } + return m.HasMDE +} + +func (m *MakeDecisionRequest) GetLocation() *Location { + if m == nil { + return nil + } + return m.Location +} + +func (m *MakeDecisionRequest) GetMediaBufferSize() *int64 { + if m == nil { + return nil + } + return m.MediaBufferSize +} + +func (m *MakeDecisionRequest) GetMediaIndex() *int64 { + if m == nil { + return nil + } + return m.MediaIndex +} + +func (m *MakeDecisionRequest) GetMusicBitrate() *int64 { + if m == nil { + return nil + } + return m.MusicBitrate +} + +func (m *MakeDecisionRequest) GetOffset() *float64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MakeDecisionRequest) GetPartIndex() *int64 { + if m == nil { + return nil + } + return m.PartIndex +} + +func (m *MakeDecisionRequest) GetPath() *string { + if m == nil { + return nil + } + return m.Path +} + +func (m *MakeDecisionRequest) GetPeakBitrate() *int64 { + if m == nil { + return nil + } + return m.PeakBitrate +} + +func (m *MakeDecisionRequest) GetPhotoResolution() *string { + if m == nil { + return nil + } + return m.PhotoResolution +} + +func (m *MakeDecisionRequest) GetProtocol() *Protocol { + if m == nil { + return nil + } + return m.Protocol +} + +func (m *MakeDecisionRequest) GetSecondsPerSegment() *int64 { + if m == nil { + return nil + } + return m.SecondsPerSegment +} + +func (m *MakeDecisionRequest) GetSubtitleSize() *int64 { + if m == nil { + return nil + } + return m.SubtitleSize +} + +func (m *MakeDecisionRequest) GetSubtitles() *Subtitles { + if m == nil { + return nil + } + return m.Subtitles +} + +func (m *MakeDecisionRequest) GetVideoBitrate() *int64 { + if m == nil { + return nil + } + return m.VideoBitrate +} + +func (m *MakeDecisionRequest) GetVideoQuality() *int64 { + if m == nil { + return nil + } + return m.VideoQuality +} + +func (m *MakeDecisionRequest) GetVideoResolution() *string { + if m == nil { + return nil + } + return m.VideoResolution +} + +func (m *MakeDecisionRequest) GetXPlexClientProfileExtra() *string { + if m == nil { + return nil + } + return m.XPlexClientProfileExtra +} + +func (m *MakeDecisionRequest) GetXPlexClientProfileName() *string { + if m == nil { + return nil + } + return m.XPlexClientProfileName +} + +func (m *MakeDecisionRequest) GetXPlexSessionIdentifier() *string { + if m == nil { + return nil + } + return m.XPlexSessionIdentifier +} + +type MakeDecisionResponse 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 + // OK + MediaContainerWithDecision *components.MediaContainerWithDecision +} + +func (m *MakeDecisionResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MakeDecisionResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MakeDecisionResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *MakeDecisionResponse) GetMediaContainerWithDecision() *components.MediaContainerWithDecision { + if m == nil { + return nil + } + return m.MediaContainerWithDecision +} diff --git a/models/operations/markplayed.go b/models/operations/markplayed.go index 206626b..e876336 100644 --- a/models/operations/markplayed.go +++ b/models/operations/markplayed.go @@ -3,21 +3,264 @@ package operations import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -type MarkPlayedRequest struct { - // The media key to mark as played - Key float64 `queryParam:"style=form,explode=true,name=key"` +type MarkPlayedGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (m *MarkPlayedRequest) GetKey() float64 { +func (m MarkPlayedGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MarkPlayedGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MarkPlayedGlobals) GetAccepts() *components.Accepts { if m == nil { - return 0.0 + return nil + } + return m.Accepts +} + +func (m *MarkPlayedGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MarkPlayedGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MarkPlayedGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MarkPlayedGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MarkPlayedGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MarkPlayedGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MarkPlayedGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MarkPlayedGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MarkPlayedGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MarkPlayedGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MarkPlayedRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library` + Identifier string `queryParam:"style=form,explode=true,name=identifier"` + // The key of the item to rate. This is the `ratingKey` found in metadata items + Key *string `queryParam:"style=form,explode=true,name=key"` + // The URI of the item to mark as played. See intro for description of the URIs + URI *string `queryParam:"style=form,explode=true,name=uri"` +} + +func (m MarkPlayedRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MarkPlayedRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"identifier"}); err != nil { + return err + } + return nil +} + +func (m *MarkPlayedRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MarkPlayedRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MarkPlayedRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MarkPlayedRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MarkPlayedRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MarkPlayedRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MarkPlayedRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MarkPlayedRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MarkPlayedRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MarkPlayedRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MarkPlayedRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MarkPlayedRequest) GetIdentifier() string { + if m == nil { + return "" + } + return m.Identifier +} + +func (m *MarkPlayedRequest) GetKey() *string { + if m == nil { + return nil } return m.Key } +func (m *MarkPlayedRequest) GetURI() *string { + if m == nil { + return nil + } + return m.URI +} + type MarkPlayedResponse struct { // HTTP response content type for this operation ContentType string diff --git a/models/operations/markunplayed.go b/models/operations/markunplayed.go deleted file mode 100644 index 44c6400..0000000 --- a/models/operations/markunplayed.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (m *MarkUnplayedRequest) GetKey() float64 { - if m == nil { - return 0.0 - } - return m.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 (m *MarkUnplayedResponse) GetContentType() string { - if m == nil { - return "" - } - return m.ContentType -} - -func (m *MarkUnplayedResponse) GetStatusCode() int { - if m == nil { - return 0 - } - return m.StatusCode -} - -func (m *MarkUnplayedResponse) GetRawResponse() *http.Response { - if m == nil { - return nil - } - return m.RawResponse -} diff --git a/models/operations/matchitem.go b/models/operations/matchitem.go new file mode 100644 index 0000000..121042a --- /dev/null +++ b/models/operations/matchitem.go @@ -0,0 +1,297 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MatchItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MatchItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MatchItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MatchItemGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MatchItemGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MatchItemGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MatchItemGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MatchItemGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MatchItemGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MatchItemGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MatchItemGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MatchItemGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MatchItemGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MatchItemGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MatchItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + GUID *string `queryParam:"style=form,explode=true,name=guid"` + Name *string `queryParam:"style=form,explode=true,name=name"` + Year *int64 `queryParam:"style=form,explode=true,name=year"` +} + +func (m MatchItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MatchItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (m *MatchItemRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MatchItemRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MatchItemRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MatchItemRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MatchItemRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MatchItemRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MatchItemRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MatchItemRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MatchItemRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MatchItemRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MatchItemRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MatchItemRequest) GetIds() string { + if m == nil { + return "" + } + return m.Ids +} + +func (m *MatchItemRequest) GetGUID() *string { + if m == nil { + return nil + } + return m.GUID +} + +func (m *MatchItemRequest) GetName() *string { + if m == nil { + return nil + } + return m.Name +} + +func (m *MatchItemRequest) GetYear() *int64 { + if m == nil { + return nil + } + return m.Year +} + +type MatchItemResponse 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 (m *MatchItemResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MatchItemResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MatchItemResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} diff --git a/models/operations/mergeitems.go b/models/operations/mergeitems.go new file mode 100644 index 0000000..d3cb54e --- /dev/null +++ b/models/operations/mergeitems.go @@ -0,0 +1,281 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MergeItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MergeItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MergeItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MergeItemsGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MergeItemsGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MergeItemsGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MergeItemsGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MergeItemsGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MergeItemsGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MergeItemsGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MergeItemsGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MergeItemsGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MergeItemsGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MergeItemsGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MergeItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + IdsPathParameter string `pathParam:"style=simple,explode=false,name=ids"` + IdsQueryParameter []string `queryParam:"style=form,explode=false,name=ids"` +} + +func (m MergeItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MergeItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (m *MergeItemsRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MergeItemsRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MergeItemsRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MergeItemsRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MergeItemsRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MergeItemsRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MergeItemsRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MergeItemsRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MergeItemsRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MergeItemsRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MergeItemsRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MergeItemsRequest) GetIdsPathParameter() string { + if m == nil { + return "" + } + return m.IdsPathParameter +} + +func (m *MergeItemsRequest) GetIdsQueryParameter() []string { + if m == nil { + return nil + } + return m.IdsQueryParameter +} + +type MergeItemsResponse 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 (m *MergeItemsResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MergeItemsResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MergeItemsResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} diff --git a/models/operations/modifydevice.go b/models/operations/modifydevice.go new file mode 100644 index 0000000..8347307 --- /dev/null +++ b/models/operations/modifydevice.go @@ -0,0 +1,370 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ModifyDeviceGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m ModifyDeviceGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ModifyDeviceGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *ModifyDeviceGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *ModifyDeviceGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *ModifyDeviceGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *ModifyDeviceGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *ModifyDeviceGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *ModifyDeviceGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *ModifyDeviceGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *ModifyDeviceGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *ModifyDeviceGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *ModifyDeviceGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *ModifyDeviceGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type ModifyDeviceRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` + // Whether to enable the device + Enabled *components.BoolInt `queryParam:"style=form,explode=true,name=enabled"` +} + +func (m ModifyDeviceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ModifyDeviceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (m *ModifyDeviceRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *ModifyDeviceRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *ModifyDeviceRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *ModifyDeviceRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *ModifyDeviceRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *ModifyDeviceRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *ModifyDeviceRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *ModifyDeviceRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *ModifyDeviceRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *ModifyDeviceRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *ModifyDeviceRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *ModifyDeviceRequest) GetDeviceID() int64 { + if m == nil { + return 0 + } + return m.DeviceID +} + +func (m *ModifyDeviceRequest) GetEnabled() *components.BoolInt { + if m == nil { + return nil + } + return m.Enabled +} + +// ModifyDeviceMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type ModifyDeviceMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Message *string `json:"message,omitempty"` + Status *int64 `json:"status,omitempty"` +} + +func (m *ModifyDeviceMediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *ModifyDeviceMediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *ModifyDeviceMediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *ModifyDeviceMediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *ModifyDeviceMediaContainer) GetMessage() *string { + if m == nil { + return nil + } + return m.Message +} + +func (m *ModifyDeviceMediaContainer) GetStatus() *int64 { + if m == nil { + return nil + } + return m.Status +} + +// ModifyDeviceResponseBody - OK +type ModifyDeviceResponseBody struct { + MediaContainer *ModifyDeviceMediaContainer `json:"MediaContainer,omitempty"` +} + +func (m *ModifyDeviceResponseBody) GetMediaContainer() *ModifyDeviceMediaContainer { + if m == nil { + return nil + } + return m.MediaContainer +} + +type ModifyDeviceResponse 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 + // OK + Object *ModifyDeviceResponseBody + Headers map[string][]string +} + +func (m *ModifyDeviceResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *ModifyDeviceResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *ModifyDeviceResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *ModifyDeviceResponse) GetObject() *ModifyDeviceResponseBody { + if m == nil { + return nil + } + return m.Object +} + +func (m *ModifyDeviceResponse) GetHeaders() map[string][]string { + if m == nil { + return map[string][]string{} + } + return m.Headers +} diff --git a/models/operations/modifyplaylistgenerator.go b/models/operations/modifyplaylistgenerator.go new file mode 100644 index 0000000..c881a01 --- /dev/null +++ b/models/operations/modifyplaylistgenerator.go @@ -0,0 +1,432 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ModifyPlaylistGeneratorGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m ModifyPlaylistGeneratorGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ModifyPlaylistGeneratorGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *ModifyPlaylistGeneratorGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *ModifyPlaylistGeneratorGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *ModifyPlaylistGeneratorGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *ModifyPlaylistGeneratorGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *ModifyPlaylistGeneratorGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *ModifyPlaylistGeneratorGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *ModifyPlaylistGeneratorGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *ModifyPlaylistGeneratorGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *ModifyPlaylistGeneratorGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *ModifyPlaylistGeneratorGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *ModifyPlaylistGeneratorGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type ModifyPlaylistGeneratorQueryParamLocation struct { + URI *string `queryParam:"name=uri"` +} + +func (m *ModifyPlaylistGeneratorQueryParamLocation) GetURI() *string { + if m == nil { + return nil + } + return m.URI +} + +type QueryParamScope string + +const ( + QueryParamScopeAll QueryParamScope = "all" + QueryParamScopeCount QueryParamScope = "count" +) + +func (e QueryParamScope) ToPointer() *QueryParamScope { + return &e +} +func (e *QueryParamScope) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + fallthrough + case "count": + *e = QueryParamScope(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamScope: %v", v) + } +} + +type Policy struct { + Value *int64 `queryParam:"name=value"` + Scope *QueryParamScope `queryParam:"name=scope"` + Unwatched *components.BoolInt `queryParam:"name=unwatched"` +} + +func (p *Policy) GetValue() *int64 { + if p == nil { + return nil + } + return p.Value +} + +func (p *Policy) GetScope() *QueryParamScope { + if p == nil { + return nil + } + return p.Scope +} + +func (p *Policy) GetUnwatched() *components.BoolInt { + if p == nil { + return nil + } + return p.Unwatched +} + +// Item - Note: OpenAPI cannot properly render this query parameter example ([See GHI](https://github.com/OAI/OpenAPI-Specification/issues/1706)). It should be rendered as: +// +// Item[type]=42&Item[title]=Jack-Jack Attack&Item[target]=&Item[targetTagID]=1&Item[locationID]=-1&Item[Location][uri]=library://82503060-0d68-4603-b594-8b071d54819e/item//library/metadata/146&Item[Policy][scope]=all&Item[Policy][value]=&Item[Policy][unwatched]=0 +type Item struct { + Location *ModifyPlaylistGeneratorQueryParamLocation `queryParam:"name=Location"` + LocationID *int64 `queryParam:"name=locationID"` + Policy *Policy `queryParam:"name=Policy"` + Target *string `queryParam:"name=target"` + TargetTagID *int64 `queryParam:"name=targetTagID"` + Title *string `queryParam:"name=title"` + Type *int64 `queryParam:"name=type"` +} + +func (i *Item) GetLocation() *ModifyPlaylistGeneratorQueryParamLocation { + if i == nil { + return nil + } + return i.Location +} + +func (i *Item) GetLocationID() *int64 { + if i == nil { + return nil + } + return i.LocationID +} + +func (i *Item) GetPolicy() *Policy { + if i == nil { + return nil + } + return i.Policy +} + +func (i *Item) GetTarget() *string { + if i == nil { + return nil + } + return i.Target +} + +func (i *Item) GetTargetTagID() *int64 { + if i == nil { + return nil + } + return i.TargetTagID +} + +func (i *Item) GetTitle() *string { + if i == nil { + return nil + } + return i.Title +} + +func (i *Item) GetType() *int64 { + if i == nil { + return nil + } + return i.Type +} + +type ModifyPlaylistGeneratorRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The generator item ID to modify. + GeneratorID int64 `pathParam:"style=simple,explode=false,name=generatorId"` + // Note: OpenAPI cannot properly render this query parameter example ([See GHI](https://github.com/OAI/OpenAPI-Specification/issues/1706)). It should be rendered as: + // + // Item[type]=42&Item[title]=Jack-Jack Attack&Item[target]=&Item[targetTagID]=1&Item[locationID]=-1&Item[Location][uri]=library://82503060-0d68-4603-b594-8b071d54819e/item//library/metadata/146&Item[Policy][scope]=all&Item[Policy][value]=&Item[Policy][unwatched]=0 + // + Item *Item `queryParam:"style=deepObject,explode=true,name=Item"` +} + +func (m ModifyPlaylistGeneratorRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ModifyPlaylistGeneratorRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"playlistId", "generatorId"}); err != nil { + return err + } + return nil +} + +func (m *ModifyPlaylistGeneratorRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *ModifyPlaylistGeneratorRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *ModifyPlaylistGeneratorRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *ModifyPlaylistGeneratorRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *ModifyPlaylistGeneratorRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *ModifyPlaylistGeneratorRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *ModifyPlaylistGeneratorRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *ModifyPlaylistGeneratorRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *ModifyPlaylistGeneratorRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *ModifyPlaylistGeneratorRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *ModifyPlaylistGeneratorRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *ModifyPlaylistGeneratorRequest) GetPlaylistID() int64 { + if m == nil { + return 0 + } + return m.PlaylistID +} + +func (m *ModifyPlaylistGeneratorRequest) GetGeneratorID() int64 { + if m == nil { + return 0 + } + return m.GeneratorID +} + +func (m *ModifyPlaylistGeneratorRequest) GetItem() *Item { + if m == nil { + return nil + } + return m.Item +} + +type ModifyPlaylistGeneratorResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (m *ModifyPlaylistGeneratorResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *ModifyPlaylistGeneratorResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *ModifyPlaylistGeneratorResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *ModifyPlaylistGeneratorResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if m == nil { + return nil + } + return m.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/movecollectionitem.go b/models/operations/movecollectionitem.go new file mode 100644 index 0000000..75cae50 --- /dev/null +++ b/models/operations/movecollectionitem.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MoveCollectionItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MoveCollectionItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MoveCollectionItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MoveCollectionItemGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MoveCollectionItemGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MoveCollectionItemGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MoveCollectionItemGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MoveCollectionItemGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MoveCollectionItemGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MoveCollectionItemGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MoveCollectionItemGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MoveCollectionItemGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MoveCollectionItemGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MoveCollectionItemGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MoveCollectionItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The collection id + CollectionID int64 `pathParam:"style=simple,explode=false,name=collectionId"` + // The item to move + ItemID int64 `pathParam:"style=simple,explode=false,name=itemId"` + // The item to move this item after. If not provided, this item will be moved to the beginning + After *int64 `queryParam:"style=form,explode=true,name=after"` +} + +func (m MoveCollectionItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MoveCollectionItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"collectionId", "itemId"}); err != nil { + return err + } + return nil +} + +func (m *MoveCollectionItemRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MoveCollectionItemRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MoveCollectionItemRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MoveCollectionItemRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MoveCollectionItemRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MoveCollectionItemRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MoveCollectionItemRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MoveCollectionItemRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MoveCollectionItemRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MoveCollectionItemRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MoveCollectionItemRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MoveCollectionItemRequest) GetCollectionID() int64 { + if m == nil { + return 0 + } + return m.CollectionID +} + +func (m *MoveCollectionItemRequest) GetItemID() int64 { + if m == nil { + return 0 + } + return m.ItemID +} + +func (m *MoveCollectionItemRequest) GetAfter() *int64 { + if m == nil { + return nil + } + return m.After +} + +type MoveCollectionItemResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata +} + +func (m *MoveCollectionItemResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MoveCollectionItemResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MoveCollectionItemResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *MoveCollectionItemResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if m == nil { + return nil + } + return m.MediaContainerWithMetadata +} diff --git a/models/operations/movehub.go b/models/operations/movehub.go new file mode 100644 index 0000000..820811c --- /dev/null +++ b/models/operations/movehub.go @@ -0,0 +1,309 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MoveHubGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MoveHubGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MoveHubGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MoveHubGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MoveHubGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MoveHubGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MoveHubGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MoveHubGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MoveHubGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MoveHubGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MoveHubGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MoveHubGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MoveHubGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MoveHubGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MoveHubRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to reorder + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The identifier of the hub to move + Identifier string `queryParam:"style=form,explode=true,name=identifier"` + // The identifier of the hub to order this hub after (or empty/missing to put this hub first) + After *string `queryParam:"style=form,explode=true,name=after"` +} + +func (m MoveHubRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MoveHubRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"sectionId", "identifier"}); err != nil { + return err + } + return nil +} + +func (m *MoveHubRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MoveHubRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MoveHubRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MoveHubRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MoveHubRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MoveHubRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MoveHubRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MoveHubRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MoveHubRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MoveHubRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MoveHubRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MoveHubRequest) GetSectionID() int64 { + if m == nil { + return 0 + } + return m.SectionID +} + +func (m *MoveHubRequest) GetIdentifier() string { + if m == nil { + return "" + } + return m.Identifier +} + +func (m *MoveHubRequest) GetAfter() *string { + if m == nil { + return nil + } + return m.After +} + +type MoveHubResponse 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 + // OK + GetResponses200 *components.GetResponses200 + Headers map[string][]string +} + +func (m *MoveHubResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MoveHubResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MoveHubResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *MoveHubResponse) GetGetResponses200() *components.GetResponses200 { + if m == nil { + return nil + } + return m.GetResponses200 +} + +func (m *MoveHubResponse) GetHeaders() map[string][]string { + if m == nil { + return map[string][]string{} + } + return m.Headers +} diff --git a/models/operations/moveplaylistitem.go b/models/operations/moveplaylistitem.go new file mode 100644 index 0000000..115e44f --- /dev/null +++ b/models/operations/moveplaylistitem.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MovePlaylistItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MovePlaylistItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MovePlaylistItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MovePlaylistItemGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MovePlaylistItemGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MovePlaylistItemGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MovePlaylistItemGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MovePlaylistItemGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MovePlaylistItemGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MovePlaylistItemGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MovePlaylistItemGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MovePlaylistItemGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MovePlaylistItemGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MovePlaylistItemGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MovePlaylistItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The playlist item ID to move. + PlaylistItemID int64 `pathParam:"style=simple,explode=false,name=playlistItemId"` + // The playlist item ID to insert the new item after. If not provided, item is moved to beginning of playlist + After *int64 `queryParam:"style=form,explode=true,name=after"` +} + +func (m MovePlaylistItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MovePlaylistItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"playlistId", "playlistItemId"}); err != nil { + return err + } + return nil +} + +func (m *MovePlaylistItemRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MovePlaylistItemRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MovePlaylistItemRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MovePlaylistItemRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MovePlaylistItemRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MovePlaylistItemRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MovePlaylistItemRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MovePlaylistItemRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MovePlaylistItemRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MovePlaylistItemRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MovePlaylistItemRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MovePlaylistItemRequest) GetPlaylistID() int64 { + if m == nil { + return 0 + } + return m.PlaylistID +} + +func (m *MovePlaylistItemRequest) GetPlaylistItemID() int64 { + if m == nil { + return 0 + } + return m.PlaylistItemID +} + +func (m *MovePlaylistItemRequest) GetAfter() *int64 { + if m == nil { + return nil + } + return m.After +} + +type MovePlaylistItemResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (m *MovePlaylistItemResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MovePlaylistItemResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MovePlaylistItemResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *MovePlaylistItemResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if m == nil { + return nil + } + return m.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/moveplayqueueitem.go b/models/operations/moveplayqueueitem.go new file mode 100644 index 0000000..f3942db --- /dev/null +++ b/models/operations/moveplayqueueitem.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type MovePlayQueueItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (m MovePlayQueueItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MovePlayQueueItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MovePlayQueueItemGlobals) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MovePlayQueueItemGlobals) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MovePlayQueueItemGlobals) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MovePlayQueueItemGlobals) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MovePlayQueueItemGlobals) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MovePlayQueueItemGlobals) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MovePlayQueueItemGlobals) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MovePlayQueueItemGlobals) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MovePlayQueueItemGlobals) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MovePlayQueueItemGlobals) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MovePlayQueueItemGlobals) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +type MovePlayQueueItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` + // The play queue item ID to delete. + PlayQueueItemID int64 `pathParam:"style=simple,explode=false,name=playQueueItemId"` + // The play queue item ID to insert the new item after. If not present, moves to the beginning. + After *int64 `queryParam:"style=form,explode=true,name=after"` +} + +func (m MovePlayQueueItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MovePlayQueueItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, []string{"playQueueId", "playQueueItemId"}); err != nil { + return err + } + return nil +} + +func (m *MovePlayQueueItemRequest) GetAccepts() *components.Accepts { + if m == nil { + return nil + } + return m.Accepts +} + +func (m *MovePlayQueueItemRequest) GetClientIdentifier() *string { + if m == nil { + return nil + } + return m.ClientIdentifier +} + +func (m *MovePlayQueueItemRequest) GetProduct() *string { + if m == nil { + return nil + } + return m.Product +} + +func (m *MovePlayQueueItemRequest) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MovePlayQueueItemRequest) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MovePlayQueueItemRequest) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MovePlayQueueItemRequest) GetDevice() *string { + if m == nil { + return nil + } + return m.Device +} + +func (m *MovePlayQueueItemRequest) GetModel() *string { + if m == nil { + return nil + } + return m.Model +} + +func (m *MovePlayQueueItemRequest) GetDeviceVendor() *string { + if m == nil { + return nil + } + return m.DeviceVendor +} + +func (m *MovePlayQueueItemRequest) GetDeviceName() *string { + if m == nil { + return nil + } + return m.DeviceName +} + +func (m *MovePlayQueueItemRequest) GetMarketplace() *string { + if m == nil { + return nil + } + return m.Marketplace +} + +func (m *MovePlayQueueItemRequest) GetPlayQueueID() int64 { + if m == nil { + return 0 + } + return m.PlayQueueID +} + +func (m *MovePlayQueueItemRequest) GetPlayQueueItemID() int64 { + if m == nil { + return 0 + } + return m.PlayQueueItemID +} + +func (m *MovePlayQueueItemRequest) GetAfter() *int64 { + if m == nil { + return nil + } + return m.After +} + +type MovePlayQueueItemResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (m *MovePlayQueueItemResponse) GetContentType() string { + if m == nil { + return "" + } + return m.ContentType +} + +func (m *MovePlayQueueItemResponse) GetStatusCode() int { + if m == nil { + return 0 + } + return m.StatusCode +} + +func (m *MovePlayQueueItemResponse) GetRawResponse() *http.Response { + if m == nil { + return nil + } + return m.RawResponse +} + +func (m *MovePlayQueueItemResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if m == nil { + return nil + } + return m.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/optimizedatabase.go b/models/operations/optimizedatabase.go new file mode 100644 index 0000000..6c877bb --- /dev/null +++ b/models/operations/optimizedatabase.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type OptimizeDatabaseGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (o OptimizeDatabaseGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OptimizeDatabaseGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OptimizeDatabaseGlobals) GetAccepts() *components.Accepts { + if o == nil { + return nil + } + return o.Accepts +} + +func (o *OptimizeDatabaseGlobals) GetClientIdentifier() *string { + if o == nil { + return nil + } + return o.ClientIdentifier +} + +func (o *OptimizeDatabaseGlobals) GetProduct() *string { + if o == nil { + return nil + } + return o.Product +} + +func (o *OptimizeDatabaseGlobals) GetVersion() *string { + if o == nil { + return nil + } + return o.Version +} + +func (o *OptimizeDatabaseGlobals) GetPlatform() *string { + if o == nil { + return nil + } + return o.Platform +} + +func (o *OptimizeDatabaseGlobals) GetPlatformVersion() *string { + if o == nil { + return nil + } + return o.PlatformVersion +} + +func (o *OptimizeDatabaseGlobals) GetDevice() *string { + if o == nil { + return nil + } + return o.Device +} + +func (o *OptimizeDatabaseGlobals) GetModel() *string { + if o == nil { + return nil + } + return o.Model +} + +func (o *OptimizeDatabaseGlobals) GetDeviceVendor() *string { + if o == nil { + return nil + } + return o.DeviceVendor +} + +func (o *OptimizeDatabaseGlobals) GetDeviceName() *string { + if o == nil { + return nil + } + return o.DeviceName +} + +func (o *OptimizeDatabaseGlobals) GetMarketplace() *string { + if o == nil { + return nil + } + return o.Marketplace +} + +type OptimizeDatabaseRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // If set, don't wait for completion but return an activity + Async *components.BoolInt `queryParam:"style=form,explode=true,name=async"` +} + +func (o OptimizeDatabaseRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OptimizeDatabaseRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OptimizeDatabaseRequest) GetAccepts() *components.Accepts { + if o == nil { + return nil + } + return o.Accepts +} + +func (o *OptimizeDatabaseRequest) GetClientIdentifier() *string { + if o == nil { + return nil + } + return o.ClientIdentifier +} + +func (o *OptimizeDatabaseRequest) GetProduct() *string { + if o == nil { + return nil + } + return o.Product +} + +func (o *OptimizeDatabaseRequest) GetVersion() *string { + if o == nil { + return nil + } + return o.Version +} + +func (o *OptimizeDatabaseRequest) GetPlatform() *string { + if o == nil { + return nil + } + return o.Platform +} + +func (o *OptimizeDatabaseRequest) GetPlatformVersion() *string { + if o == nil { + return nil + } + return o.PlatformVersion +} + +func (o *OptimizeDatabaseRequest) GetDevice() *string { + if o == nil { + return nil + } + return o.Device +} + +func (o *OptimizeDatabaseRequest) GetModel() *string { + if o == nil { + return nil + } + return o.Model +} + +func (o *OptimizeDatabaseRequest) GetDeviceVendor() *string { + if o == nil { + return nil + } + return o.DeviceVendor +} + +func (o *OptimizeDatabaseRequest) GetDeviceName() *string { + if o == nil { + return nil + } + return o.DeviceName +} + +func (o *OptimizeDatabaseRequest) GetMarketplace() *string { + if o == nil { + return nil + } + return o.Marketplace +} + +func (o *OptimizeDatabaseRequest) GetAsync() *components.BoolInt { + if o == nil { + return nil + } + return o.Async +} + +type OptimizeDatabaseResponse 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 *OptimizeDatabaseResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *OptimizeDatabaseResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *OptimizeDatabaseResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/options.go b/models/operations/options.go index 17468c9..40ad463 100644 --- a/models/operations/options.go +++ b/models/operations/options.go @@ -21,10 +21,15 @@ const ( type AcceptHeaderEnum string const ( - AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" - AcceptHeaderEnumImageJpeg AcceptHeaderEnum = "image/jpeg" - AcceptHeaderEnumWildcardRootWildcard AcceptHeaderEnum = "*/*" - AcceptHeaderEnumApplicationXml AcceptHeaderEnum = "application/xml" + AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" + AcceptHeaderEnumApplicationOctetStream AcceptHeaderEnum = "application/octet-stream" + AcceptHeaderEnumWildcardRootWildcard AcceptHeaderEnum = "*/*" + AcceptHeaderEnumAudioMpeg3 AcceptHeaderEnum = "audio/mpeg3" + AcceptHeaderEnumImageJpeg AcceptHeaderEnum = "image/jpeg" + AcceptHeaderEnumTextPlain AcceptHeaderEnum = "text/plain" + AcceptHeaderEnumImagePng AcceptHeaderEnum = "image/png" + AcceptHeaderEnumImageXPortablePixmap AcceptHeaderEnum = "image/x-portable-pixmap" + AcceptHeaderEnumVideoXMatroska AcceptHeaderEnum = "video/x-matroska" ) func (e AcceptHeaderEnum) ToPointer() *AcceptHeaderEnum { diff --git a/models/operations/performsearch.go b/models/operations/performsearch.go deleted file mode 100644 index dc27e5c..0000000 --- a/models/operations/performsearch.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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, []string{"query"}); err != nil { - return err - } - return nil -} - -func (p *PerformSearchRequest) GetQuery() string { - if p == nil { - return "" - } - return p.Query -} - -func (p *PerformSearchRequest) GetSectionID() *float64 { - if p == nil { - return nil - } - return p.SectionID -} - -func (p *PerformSearchRequest) GetLimit() *float64 { - if p == nil { - return nil - } - return p.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 (p *PerformSearchResponse) GetContentType() string { - if p == nil { - return "" - } - return p.ContentType -} - -func (p *PerformSearchResponse) GetStatusCode() int { - if p == nil { - return 0 - } - return p.StatusCode -} - -func (p *PerformSearchResponse) GetRawResponse() *http.Response { - if p == nil { - return nil - } - return p.RawResponse -} diff --git a/models/operations/performvoicesearch.go b/models/operations/performvoicesearch.go deleted file mode 100644 index 9910dd5..0000000 --- a/models/operations/performvoicesearch.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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, []string{"query"}); err != nil { - return err - } - return nil -} - -func (p *PerformVoiceSearchRequest) GetQuery() string { - if p == nil { - return "" - } - return p.Query -} - -func (p *PerformVoiceSearchRequest) GetSectionID() *float64 { - if p == nil { - return nil - } - return p.SectionID -} - -func (p *PerformVoiceSearchRequest) GetLimit() *float64 { - if p == nil { - return nil - } - return p.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 (p *PerformVoiceSearchResponse) GetContentType() string { - if p == nil { - return "" - } - return p.ContentType -} - -func (p *PerformVoiceSearchResponse) GetStatusCode() int { - if p == nil { - return 0 - } - return p.StatusCode -} - -func (p *PerformVoiceSearchResponse) GetRawResponse() *http.Response { - if p == nil { - return nil - } - return p.RawResponse -} diff --git a/models/operations/postmediaarts.go b/models/operations/postmediaarts.go deleted file mode 100644 index 2a7016c..0000000 --- a/models/operations/postmediaarts.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type PostMediaArtsRequest struct { - // the id of the library item to return the posters of. - RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"` - // The URL of the image, if uploading a remote image - URL *string `queryParam:"style=form,explode=true,name=url"` - // The contents of the image, if uploading a local file - // This field accepts []byte data or io.Reader implementations, such as *os.File. - RequestBody *any `request:"mediaType=image/*"` -} - -func (p *PostMediaArtsRequest) GetRatingKey() int64 { - if p == nil { - return 0 - } - return p.RatingKey -} - -func (p *PostMediaArtsRequest) GetURL() *string { - if p == nil { - return nil - } - return p.URL -} - -func (p *PostMediaArtsRequest) GetRequestBody() *any { - if p == nil { - return nil - } - return p.RequestBody -} - -type PostMediaArtsResponse 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 (p *PostMediaArtsResponse) GetContentType() string { - if p == nil { - return "" - } - return p.ContentType -} - -func (p *PostMediaArtsResponse) GetStatusCode() int { - if p == nil { - return 0 - } - return p.StatusCode -} - -func (p *PostMediaArtsResponse) GetRawResponse() *http.Response { - if p == nil { - return nil - } - return p.RawResponse -} diff --git a/models/operations/postmediaposter.go b/models/operations/postmediaposter.go deleted file mode 100644 index 64cbc2a..0000000 --- a/models/operations/postmediaposter.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type PostMediaPosterRequest struct { - // the id of the library item to return the posters of. - RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"` - // The URL of the image, if uploading a remote image - URL *string `queryParam:"style=form,explode=true,name=url"` - // The contents of the image, if uploading a local file - // This field accepts []byte data or io.Reader implementations, such as *os.File. - RequestBody *any `request:"mediaType=image/*"` -} - -func (p *PostMediaPosterRequest) GetRatingKey() int64 { - if p == nil { - return 0 - } - return p.RatingKey -} - -func (p *PostMediaPosterRequest) GetURL() *string { - if p == nil { - return nil - } - return p.URL -} - -func (p *PostMediaPosterRequest) GetRequestBody() *any { - if p == nil { - return nil - } - return p.RequestBody -} - -type PostMediaPosterResponse 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 (p *PostMediaPosterResponse) GetContentType() string { - if p == nil { - return "" - } - return p.ContentType -} - -func (p *PostMediaPosterResponse) GetStatusCode() int { - if p == nil { - return 0 - } - return p.StatusCode -} - -func (p *PostMediaPosterResponse) GetRawResponse() *http.Response { - if p == nil { - return nil - } - return p.RawResponse -} diff --git a/models/operations/postuserssignindata.go b/models/operations/postuserssignindata.go deleted file mode 100644 index 8a8b4ef..0000000 --- a/models/operations/postuserssignindata.go +++ /dev/null @@ -1,1143 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/LukeHagar/plexgo/internal/utils" - "net/http" -) - -var PostUsersSignInDataServerList = []string{ - "https://plex.tv/api/v2", -} - -// PostUsersSignInDataRequestBody - Login credentials -type PostUsersSignInDataRequestBody struct { - Login string `form:"name=login"` - Password string `form:"name=password"` - RememberMe *bool `default:"false" form:"name=rememberMe"` - VerificationCode *string `form:"name=verificationCode"` -} - -func (p PostUsersSignInDataRequestBody) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PostUsersSignInDataRequestBody) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"login", "password"}); err != nil { - return err - } - return nil -} - -func (p *PostUsersSignInDataRequestBody) GetLogin() string { - if p == nil { - return "" - } - return p.Login -} - -func (p *PostUsersSignInDataRequestBody) GetPassword() string { - if p == nil { - return "" - } - return p.Password -} - -func (p *PostUsersSignInDataRequestBody) GetRememberMe() *bool { - if p == nil { - return nil - } - return p.RememberMe -} - -func (p *PostUsersSignInDataRequestBody) GetVerificationCode() *string { - if p == nil { - return nil - } - return p.VerificationCode -} - -type PostUsersSignInDataRequest struct { - // An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` - // The name of the client application. (Plex Web, Plex Media Server, etc.) - ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"` - // A relatively friendly name for the client device - DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"` - // The version of the client application. - ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"` - // The platform of the client application. - Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` - // Login credentials - RequestBody *PostUsersSignInDataRequestBody `request:"mediaType=application/x-www-form-urlencoded"` -} - -func (p *PostUsersSignInDataRequest) GetClientID() string { - if p == nil { - return "" - } - return p.ClientID -} - -func (p *PostUsersSignInDataRequest) GetClientName() *string { - if p == nil { - return nil - } - return p.ClientName -} - -func (p *PostUsersSignInDataRequest) GetDeviceNickname() *string { - if p == nil { - return nil - } - return p.DeviceNickname -} - -func (p *PostUsersSignInDataRequest) GetClientVersion() *string { - if p == nil { - return nil - } - return p.ClientVersion -} - -func (p *PostUsersSignInDataRequest) GetPlatform() *string { - if p == nil { - return nil - } - return p.Platform -} - -func (p *PostUsersSignInDataRequest) GetRequestBody() *PostUsersSignInDataRequestBody { - if p == nil { - return nil - } - return p.RequestBody -} - -// PostUsersSignInDataMailingListStatus - Your current mailing list status (active or unsubscribed) -type PostUsersSignInDataMailingListStatus string - -const ( - PostUsersSignInDataMailingListStatusActive PostUsersSignInDataMailingListStatus = "active" - PostUsersSignInDataMailingListStatusUnsubscribed PostUsersSignInDataMailingListStatus = "unsubscribed" -) - -func (e PostUsersSignInDataMailingListStatus) ToPointer() *PostUsersSignInDataMailingListStatus { - return &e -} - -// PostUsersSignInDataAutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) -type PostUsersSignInDataAutoSelectSubtitle int - -const ( - PostUsersSignInDataAutoSelectSubtitleDisable PostUsersSignInDataAutoSelectSubtitle = 0 - PostUsersSignInDataAutoSelectSubtitleEnable PostUsersSignInDataAutoSelectSubtitle = 1 -) - -func (e PostUsersSignInDataAutoSelectSubtitle) ToPointer() *PostUsersSignInDataAutoSelectSubtitle { - return &e -} -func (e *PostUsersSignInDataAutoSelectSubtitle) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = PostUsersSignInDataAutoSelectSubtitle(v) - return nil - default: - return fmt.Errorf("invalid value for PostUsersSignInDataAutoSelectSubtitle: %v", v) - } -} - -// PostUsersSignInDataDefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) -type PostUsersSignInDataDefaultSubtitleAccessibility int - -const ( - PostUsersSignInDataDefaultSubtitleAccessibilityDisable PostUsersSignInDataDefaultSubtitleAccessibility = 0 - PostUsersSignInDataDefaultSubtitleAccessibilityEnable PostUsersSignInDataDefaultSubtitleAccessibility = 1 -) - -func (e PostUsersSignInDataDefaultSubtitleAccessibility) ToPointer() *PostUsersSignInDataDefaultSubtitleAccessibility { - return &e -} -func (e *PostUsersSignInDataDefaultSubtitleAccessibility) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = PostUsersSignInDataDefaultSubtitleAccessibility(v) - return nil - default: - return fmt.Errorf("invalid value for PostUsersSignInDataDefaultSubtitleAccessibility: %v", v) - } -} - -// PostUsersSignInDataDefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) -type PostUsersSignInDataDefaultSubtitleForced int - -const ( - PostUsersSignInDataDefaultSubtitleForcedDisable PostUsersSignInDataDefaultSubtitleForced = 0 - PostUsersSignInDataDefaultSubtitleForcedEnable PostUsersSignInDataDefaultSubtitleForced = 1 -) - -func (e PostUsersSignInDataDefaultSubtitleForced) ToPointer() *PostUsersSignInDataDefaultSubtitleForced { - return &e -} -func (e *PostUsersSignInDataDefaultSubtitleForced) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = PostUsersSignInDataDefaultSubtitleForced(v) - return nil - default: - return fmt.Errorf("invalid value for PostUsersSignInDataDefaultSubtitleForced: %v", v) - } -} - -// PostUsersSignInDataWatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media) -type PostUsersSignInDataWatchedIndicator int - -const ( - PostUsersSignInDataWatchedIndicatorDisable PostUsersSignInDataWatchedIndicator = 0 - PostUsersSignInDataWatchedIndicatorEnable PostUsersSignInDataWatchedIndicator = 1 -) - -func (e PostUsersSignInDataWatchedIndicator) ToPointer() *PostUsersSignInDataWatchedIndicator { - return &e -} -func (e *PostUsersSignInDataWatchedIndicator) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = PostUsersSignInDataWatchedIndicator(v) - return nil - default: - return fmt.Errorf("invalid value for PostUsersSignInDataWatchedIndicator: %v", v) - } -} - -// PostUsersSignInDataMediaReviewsVisibility - Whether or not the account has media reviews visibility enabled -type PostUsersSignInDataMediaReviewsVisibility int - -const ( - PostUsersSignInDataMediaReviewsVisibilityDisable PostUsersSignInDataMediaReviewsVisibility = 0 - PostUsersSignInDataMediaReviewsVisibilityEnable PostUsersSignInDataMediaReviewsVisibility = 1 -) - -func (e PostUsersSignInDataMediaReviewsVisibility) ToPointer() *PostUsersSignInDataMediaReviewsVisibility { - return &e -} -func (e *PostUsersSignInDataMediaReviewsVisibility) UnmarshalJSON(data []byte) error { - var v int - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case 0: - fallthrough - case 1: - *e = PostUsersSignInDataMediaReviewsVisibility(v) - return nil - default: - return fmt.Errorf("invalid value for PostUsersSignInDataMediaReviewsVisibility: %v", v) - } -} - -type PostUsersSignInDataUserProfile struct { - // If the account has automatically select audio and subtitle tracks enabled - AutoSelectAudio *bool `default:"true" json:"autoSelectAudio"` - // The preferred audio language for the account - DefaultAudioLanguage *string `json:"defaultAudioLanguage"` - // The preferred subtitle language for the account - DefaultSubtitleLanguage *string `json:"defaultSubtitleLanguage"` - AutoSelectSubtitle *PostUsersSignInDataAutoSelectSubtitle `default:"0" json:"autoSelectSubtitle"` - DefaultSubtitleAccessibility *PostUsersSignInDataDefaultSubtitleAccessibility `default:"0" json:"defaultSubtitleAccessibility"` - DefaultSubtitleForced *PostUsersSignInDataDefaultSubtitleForced `default:"0" json:"defaultSubtitleForced"` - WatchedIndicator *PostUsersSignInDataWatchedIndicator `default:"0" json:"watchedIndicator"` - MediaReviewsVisibility *PostUsersSignInDataMediaReviewsVisibility `default:"0" json:"mediaReviewsVisibility"` -} - -func (p PostUsersSignInDataUserProfile) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PostUsersSignInDataUserProfile) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { - return err - } - return nil -} - -func (p *PostUsersSignInDataUserProfile) GetAutoSelectAudio() *bool { - if p == nil { - return nil - } - return p.AutoSelectAudio -} - -func (p *PostUsersSignInDataUserProfile) GetDefaultAudioLanguage() *string { - if p == nil { - return nil - } - return p.DefaultAudioLanguage -} - -func (p *PostUsersSignInDataUserProfile) GetDefaultSubtitleLanguage() *string { - if p == nil { - return nil - } - return p.DefaultSubtitleLanguage -} - -func (p *PostUsersSignInDataUserProfile) GetAutoSelectSubtitle() *PostUsersSignInDataAutoSelectSubtitle { - if p == nil { - return nil - } - return p.AutoSelectSubtitle -} - -func (p *PostUsersSignInDataUserProfile) GetDefaultSubtitleAccessibility() *PostUsersSignInDataDefaultSubtitleAccessibility { - if p == nil { - return nil - } - return p.DefaultSubtitleAccessibility -} - -func (p *PostUsersSignInDataUserProfile) GetDefaultSubtitleForced() *PostUsersSignInDataDefaultSubtitleForced { - if p == nil { - return nil - } - return p.DefaultSubtitleForced -} - -func (p *PostUsersSignInDataUserProfile) GetWatchedIndicator() *PostUsersSignInDataWatchedIndicator { - if p == nil { - return nil - } - return p.WatchedIndicator -} - -func (p *PostUsersSignInDataUserProfile) GetMediaReviewsVisibility() *PostUsersSignInDataMediaReviewsVisibility { - if p == nil { - return nil - } - return p.MediaReviewsVisibility -} - -type PostUsersSignInDataStatus string - -const ( - PostUsersSignInDataStatusOnline PostUsersSignInDataStatus = "online" - PostUsersSignInDataStatusOffline PostUsersSignInDataStatus = "offline" -) - -func (e PostUsersSignInDataStatus) ToPointer() *PostUsersSignInDataStatus { - return &e -} - -type PostUsersSignInDataServices struct { - Identifier string `json:"identifier"` - Endpoint string `json:"endpoint"` - Token *string `json:"token"` - Secret *string `json:"secret"` - Status PostUsersSignInDataStatus `json:"status"` -} - -func (p *PostUsersSignInDataServices) GetIdentifier() string { - if p == nil { - return "" - } - return p.Identifier -} - -func (p *PostUsersSignInDataServices) GetEndpoint() string { - if p == nil { - return "" - } - return p.Endpoint -} - -func (p *PostUsersSignInDataServices) GetToken() *string { - if p == nil { - return nil - } - return p.Token -} - -func (p *PostUsersSignInDataServices) GetSecret() *string { - if p == nil { - return nil - } - return p.Secret -} - -func (p *PostUsersSignInDataServices) GetStatus() PostUsersSignInDataStatus { - if p == nil { - return PostUsersSignInDataStatus("") - } - return p.Status -} - -// PostUsersSignInDataAuthenticationStatus - String representation of subscriptionActive -type PostUsersSignInDataAuthenticationStatus string - -const ( - PostUsersSignInDataAuthenticationStatusInactive PostUsersSignInDataAuthenticationStatus = "Inactive" - PostUsersSignInDataAuthenticationStatusActive PostUsersSignInDataAuthenticationStatus = "Active" -) - -func (e PostUsersSignInDataAuthenticationStatus) ToPointer() *PostUsersSignInDataAuthenticationStatus { - return &e -} - -// PostUsersSignInDataSubscription - If the account’s Plex Pass subscription is active -type PostUsersSignInDataSubscription struct { - // List of features allowed on your Plex Pass subscription - Features []string `json:"features,omitempty"` - // If the account's Plex Pass subscription is active - Active *bool `json:"active,omitempty"` - // Date the account subscribed to Plex Pass - SubscribedAt *string `json:"subscribedAt,omitempty"` - // String representation of subscriptionActive - Status *PostUsersSignInDataAuthenticationStatus `json:"status,omitempty"` - // Payment service used for your Plex Pass subscription - PaymentService *string `json:"paymentService,omitempty"` - // Name of Plex Pass subscription plan - Plan *string `json:"plan,omitempty"` -} - -func (p *PostUsersSignInDataSubscription) GetFeatures() []string { - if p == nil { - return nil - } - return p.Features -} - -func (p *PostUsersSignInDataSubscription) GetActive() *bool { - if p == nil { - return nil - } - return p.Active -} - -func (p *PostUsersSignInDataSubscription) GetSubscribedAt() *string { - if p == nil { - return nil - } - return p.SubscribedAt -} - -func (p *PostUsersSignInDataSubscription) GetStatus() *PostUsersSignInDataAuthenticationStatus { - if p == nil { - return nil - } - return p.Status -} - -func (p *PostUsersSignInDataSubscription) GetPaymentService() *string { - if p == nil { - return nil - } - return p.PaymentService -} - -func (p *PostUsersSignInDataSubscription) GetPlan() *string { - if p == nil { - return nil - } - return p.Plan -} - -// PostUsersSignInDataAuthenticationResponseStatus - String representation of subscriptionActive -type PostUsersSignInDataAuthenticationResponseStatus string - -const ( - PostUsersSignInDataAuthenticationResponseStatusInactive PostUsersSignInDataAuthenticationResponseStatus = "Inactive" - PostUsersSignInDataAuthenticationResponseStatusActive PostUsersSignInDataAuthenticationResponseStatus = "Active" -) - -func (e PostUsersSignInDataAuthenticationResponseStatus) ToPointer() *PostUsersSignInDataAuthenticationResponseStatus { - return &e -} - -type PostUsersSignInDataAuthenticationSubscription struct { - // List of features allowed on your Plex Pass subscription - Features []string `json:"features,omitempty"` - // If the account's Plex Pass subscription is active - Active *bool `json:"active,omitempty"` - // Date the account subscribed to Plex Pass - SubscribedAt *string `json:"subscribedAt,omitempty"` - // String representation of subscriptionActive - Status *PostUsersSignInDataAuthenticationResponseStatus `json:"status,omitempty"` - // Payment service used for your Plex Pass subscription - PaymentService *string `json:"paymentService,omitempty"` - // Name of Plex Pass subscription plan - Plan *string `json:"plan,omitempty"` -} - -func (p *PostUsersSignInDataAuthenticationSubscription) GetFeatures() []string { - if p == nil { - return nil - } - return p.Features -} - -func (p *PostUsersSignInDataAuthenticationSubscription) GetActive() *bool { - if p == nil { - return nil - } - return p.Active -} - -func (p *PostUsersSignInDataAuthenticationSubscription) GetSubscribedAt() *string { - if p == nil { - return nil - } - return p.SubscribedAt -} - -func (p *PostUsersSignInDataAuthenticationSubscription) GetStatus() *PostUsersSignInDataAuthenticationResponseStatus { - if p == nil { - return nil - } - return p.Status -} - -func (p *PostUsersSignInDataAuthenticationSubscription) GetPaymentService() *string { - if p == nil { - return nil - } - return p.PaymentService -} - -func (p *PostUsersSignInDataAuthenticationSubscription) GetPlan() *string { - if p == nil { - return nil - } - return p.Plan -} - -type PostUsersSignInDataState string - -const ( - PostUsersSignInDataStateEnded PostUsersSignInDataState = "ended" -) - -func (e PostUsersSignInDataState) ToPointer() *PostUsersSignInDataState { - return &e -} - -type InternalPaymentMethod struct { -} - -type Billing struct { - InternalPaymentMethod InternalPaymentMethod `json:"internalPaymentMethod"` - PaymentMethodID *int64 `json:"paymentMethodId"` -} - -func (b *Billing) GetInternalPaymentMethod() InternalPaymentMethod { - if b == nil { - return InternalPaymentMethod{} - } - return b.InternalPaymentMethod -} - -func (b *Billing) GetPaymentMethodID() *int64 { - if b == nil { - return nil - } - return b.PaymentMethodID -} - -type PastSubscription struct { - ID *string `json:"id"` - Mode *string `json:"mode"` - RenewsAt *int64 `json:"renewsAt"` - EndsAt *int64 `json:"endsAt"` - Canceled *bool `default:"false" json:"canceled"` - GracePeriod *bool `default:"false" json:"gracePeriod"` - OnHold *bool `default:"false" json:"onHold"` - CanReactivate *bool `default:"false" json:"canReactivate"` - CanUpgrade *bool `default:"false" json:"canUpgrade"` - CanDowngrade *bool `default:"false" json:"canDowngrade"` - CanConvert *bool `default:"false" json:"canConvert"` - Type string `json:"type"` - Transfer *string `json:"transfer"` - State PostUsersSignInDataState `json:"state"` - Billing Billing `json:"billing"` -} - -func (p PastSubscription) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PastSubscription) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type", "state", "billing"}); err != nil { - return err - } - return nil -} - -func (p *PastSubscription) GetID() *string { - if p == nil { - return nil - } - return p.ID -} - -func (p *PastSubscription) GetMode() *string { - if p == nil { - return nil - } - return p.Mode -} - -func (p *PastSubscription) GetRenewsAt() *int64 { - if p == nil { - return nil - } - return p.RenewsAt -} - -func (p *PastSubscription) GetEndsAt() *int64 { - if p == nil { - return nil - } - return p.EndsAt -} - -func (p *PastSubscription) GetCanceled() *bool { - if p == nil { - return nil - } - return p.Canceled -} - -func (p *PastSubscription) GetGracePeriod() *bool { - if p == nil { - return nil - } - return p.GracePeriod -} - -func (p *PastSubscription) GetOnHold() *bool { - if p == nil { - return nil - } - return p.OnHold -} - -func (p *PastSubscription) GetCanReactivate() *bool { - if p == nil { - return nil - } - return p.CanReactivate -} - -func (p *PastSubscription) GetCanUpgrade() *bool { - if p == nil { - return nil - } - return p.CanUpgrade -} - -func (p *PastSubscription) GetCanDowngrade() *bool { - if p == nil { - return nil - } - return p.CanDowngrade -} - -func (p *PastSubscription) GetCanConvert() *bool { - if p == nil { - return nil - } - return p.CanConvert -} - -func (p *PastSubscription) GetType() string { - if p == nil { - return "" - } - return p.Type -} - -func (p *PastSubscription) GetTransfer() *string { - if p == nil { - return nil - } - return p.Transfer -} - -func (p *PastSubscription) GetState() PostUsersSignInDataState { - if p == nil { - return PostUsersSignInDataState("") - } - return p.State -} - -func (p *PastSubscription) GetBilling() Billing { - if p == nil { - return Billing{} - } - return p.Billing -} - -type Trials struct { -} - -// PostUsersSignInDataUserPlexAccount - Returns the user account data with a valid auth token -type PostUsersSignInDataUserPlexAccount struct { - // Unknown - AdsConsent *bool `json:"adsConsent"` - AdsConsentReminderAt *int64 `json:"adsConsentReminderAt"` - AdsConsentSetAt *int64 `json:"adsConsentSetAt"` - // Unknown - Anonymous *bool `default:"false" json:"anonymous"` - // The account token - AuthToken string `json:"authToken"` - // If the two-factor authentication backup codes have been created - BackupCodesCreated *bool `default:"false" json:"backupCodesCreated"` - // If the account has been confirmed - Confirmed *bool `default:"false" json:"confirmed"` - // The account country - Country string `json:"country"` - // The account email address - Email string `json:"email"` - // If login with email only is enabled - EmailOnlyAuth *bool `default:"false" json:"emailOnlyAuth"` - // If experimental features are enabled - ExperimentalFeatures *bool `default:"false" json:"experimentalFeatures"` - // Your account full name - FriendlyName string `json:"friendlyName"` - // List of devices your allowed to use with this account - Entitlements []string `json:"entitlements"` - // If the account is a Plex Home guest user - Guest *bool `default:"false" json:"guest"` - // If the account has a password - HasPassword *bool `default:"true" json:"hasPassword"` - // If the account is a Plex Home user - Home *bool `default:"false" json:"home"` - // If the account is the Plex Home admin - HomeAdmin *bool `default:"false" json:"homeAdmin"` - // The number of accounts in the Plex Home - HomeSize int `json:"homeSize"` - // The Plex account ID - ID int `json:"id"` - // Unix epoch datetime in seconds - JoinedAt int64 `json:"joinedAt"` - // The account locale - Locale *string `json:"locale"` - // If you are subscribed to the Plex newsletter - MailingListActive *bool `default:"false" json:"mailingListActive"` - // Your current mailing list status (active or unsubscribed) - MailingListStatus PostUsersSignInDataMailingListStatus `json:"mailingListStatus"` - // The maximum number of accounts allowed in the Plex Home - MaxHomeSize int `json:"maxHomeSize"` - // [Might be removed] The hashed Plex Home PIN - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Pin *string `json:"pin,omitempty"` - Profile PostUsersSignInDataUserProfile `json:"profile"` - // If the account has a Plex Home PIN enabled - Protected *bool `default:"false" json:"protected"` - // Unix epoch datetime in seconds - RememberExpiresAt int64 `json:"rememberExpiresAt"` - // If the account is a Plex Home managed user - Restricted *bool `default:"false" json:"restricted"` - // [Might be removed] List of account roles. Plexpass membership listed here - Roles []string `json:"roles,omitempty"` - // Unknown - ScrobbleTypes string `json:"scrobbleTypes"` - Services []PostUsersSignInDataServices `json:"services"` - // If the account’s Plex Pass subscription is active - Subscription PostUsersSignInDataSubscription `json:"subscription"` - // Description of the Plex Pass subscription - SubscriptionDescription *string `json:"subscriptionDescription"` - Subscriptions []PostUsersSignInDataAuthenticationSubscription `json:"subscriptions,omitempty"` - // URL of the account thumbnail - Thumb string `json:"thumb"` - // The title of the account (username or friendly name) - Title string `json:"title"` - // If two-factor authentication is enabled - TwoFactorEnabled *bool `default:"false" json:"twoFactorEnabled"` - // The account username - Username string `json:"username"` - // The account UUID - UUID string `json:"uuid"` - AttributionPartner *string `json:"attributionPartner"` - PastSubscriptions []PastSubscription `json:"pastSubscriptions"` - Trials []Trials `json:"trials"` -} - -func (p PostUsersSignInDataUserPlexAccount) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PostUsersSignInDataUserPlexAccount) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"authToken", "country", "email", "friendlyName", "entitlements", "homeSize", "id", "joinedAt", "mailingListStatus", "maxHomeSize", "profile", "rememberExpiresAt", "scrobbleTypes", "services", "subscription", "thumb", "title", "username", "uuid", "pastSubscriptions", "trials"}); err != nil { - return err - } - return nil -} - -func (p *PostUsersSignInDataUserPlexAccount) GetAdsConsent() *bool { - if p == nil { - return nil - } - return p.AdsConsent -} - -func (p *PostUsersSignInDataUserPlexAccount) GetAdsConsentReminderAt() *int64 { - if p == nil { - return nil - } - return p.AdsConsentReminderAt -} - -func (p *PostUsersSignInDataUserPlexAccount) GetAdsConsentSetAt() *int64 { - if p == nil { - return nil - } - return p.AdsConsentSetAt -} - -func (p *PostUsersSignInDataUserPlexAccount) GetAnonymous() *bool { - if p == nil { - return nil - } - return p.Anonymous -} - -func (p *PostUsersSignInDataUserPlexAccount) GetAuthToken() string { - if p == nil { - return "" - } - return p.AuthToken -} - -func (p *PostUsersSignInDataUserPlexAccount) GetBackupCodesCreated() *bool { - if p == nil { - return nil - } - return p.BackupCodesCreated -} - -func (p *PostUsersSignInDataUserPlexAccount) GetConfirmed() *bool { - if p == nil { - return nil - } - return p.Confirmed -} - -func (p *PostUsersSignInDataUserPlexAccount) GetCountry() string { - if p == nil { - return "" - } - return p.Country -} - -func (p *PostUsersSignInDataUserPlexAccount) GetEmail() string { - if p == nil { - return "" - } - return p.Email -} - -func (p *PostUsersSignInDataUserPlexAccount) GetEmailOnlyAuth() *bool { - if p == nil { - return nil - } - return p.EmailOnlyAuth -} - -func (p *PostUsersSignInDataUserPlexAccount) GetExperimentalFeatures() *bool { - if p == nil { - return nil - } - return p.ExperimentalFeatures -} - -func (p *PostUsersSignInDataUserPlexAccount) GetFriendlyName() string { - if p == nil { - return "" - } - return p.FriendlyName -} - -func (p *PostUsersSignInDataUserPlexAccount) GetEntitlements() []string { - if p == nil { - return []string{} - } - return p.Entitlements -} - -func (p *PostUsersSignInDataUserPlexAccount) GetGuest() *bool { - if p == nil { - return nil - } - return p.Guest -} - -func (p *PostUsersSignInDataUserPlexAccount) GetHasPassword() *bool { - if p == nil { - return nil - } - return p.HasPassword -} - -func (p *PostUsersSignInDataUserPlexAccount) GetHome() *bool { - if p == nil { - return nil - } - return p.Home -} - -func (p *PostUsersSignInDataUserPlexAccount) GetHomeAdmin() *bool { - if p == nil { - return nil - } - return p.HomeAdmin -} - -func (p *PostUsersSignInDataUserPlexAccount) GetHomeSize() int { - if p == nil { - return 0 - } - return p.HomeSize -} - -func (p *PostUsersSignInDataUserPlexAccount) GetID() int { - if p == nil { - return 0 - } - return p.ID -} - -func (p *PostUsersSignInDataUserPlexAccount) GetJoinedAt() int64 { - if p == nil { - return 0 - } - return p.JoinedAt -} - -func (p *PostUsersSignInDataUserPlexAccount) GetLocale() *string { - if p == nil { - return nil - } - return p.Locale -} - -func (p *PostUsersSignInDataUserPlexAccount) GetMailingListActive() *bool { - if p == nil { - return nil - } - return p.MailingListActive -} - -func (p *PostUsersSignInDataUserPlexAccount) GetMailingListStatus() PostUsersSignInDataMailingListStatus { - if p == nil { - return PostUsersSignInDataMailingListStatus("") - } - return p.MailingListStatus -} - -func (p *PostUsersSignInDataUserPlexAccount) GetMaxHomeSize() int { - if p == nil { - return 0 - } - return p.MaxHomeSize -} - -func (p *PostUsersSignInDataUserPlexAccount) GetPin() *string { - if p == nil { - return nil - } - return p.Pin -} - -func (p *PostUsersSignInDataUserPlexAccount) GetProfile() PostUsersSignInDataUserProfile { - if p == nil { - return PostUsersSignInDataUserProfile{} - } - return p.Profile -} - -func (p *PostUsersSignInDataUserPlexAccount) GetProtected() *bool { - if p == nil { - return nil - } - return p.Protected -} - -func (p *PostUsersSignInDataUserPlexAccount) GetRememberExpiresAt() int64 { - if p == nil { - return 0 - } - return p.RememberExpiresAt -} - -func (p *PostUsersSignInDataUserPlexAccount) GetRestricted() *bool { - if p == nil { - return nil - } - return p.Restricted -} - -func (p *PostUsersSignInDataUserPlexAccount) GetRoles() []string { - if p == nil { - return nil - } - return p.Roles -} - -func (p *PostUsersSignInDataUserPlexAccount) GetScrobbleTypes() string { - if p == nil { - return "" - } - return p.ScrobbleTypes -} - -func (p *PostUsersSignInDataUserPlexAccount) GetServices() []PostUsersSignInDataServices { - if p == nil { - return []PostUsersSignInDataServices{} - } - return p.Services -} - -func (p *PostUsersSignInDataUserPlexAccount) GetSubscription() PostUsersSignInDataSubscription { - if p == nil { - return PostUsersSignInDataSubscription{} - } - return p.Subscription -} - -func (p *PostUsersSignInDataUserPlexAccount) GetSubscriptionDescription() *string { - if p == nil { - return nil - } - return p.SubscriptionDescription -} - -func (p *PostUsersSignInDataUserPlexAccount) GetSubscriptions() []PostUsersSignInDataAuthenticationSubscription { - if p == nil { - return nil - } - return p.Subscriptions -} - -func (p *PostUsersSignInDataUserPlexAccount) GetThumb() string { - if p == nil { - return "" - } - return p.Thumb -} - -func (p *PostUsersSignInDataUserPlexAccount) GetTitle() string { - if p == nil { - return "" - } - return p.Title -} - -func (p *PostUsersSignInDataUserPlexAccount) GetTwoFactorEnabled() *bool { - if p == nil { - return nil - } - return p.TwoFactorEnabled -} - -func (p *PostUsersSignInDataUserPlexAccount) GetUsername() string { - if p == nil { - return "" - } - return p.Username -} - -func (p *PostUsersSignInDataUserPlexAccount) GetUUID() string { - if p == nil { - return "" - } - return p.UUID -} - -func (p *PostUsersSignInDataUserPlexAccount) GetAttributionPartner() *string { - if p == nil { - return nil - } - return p.AttributionPartner -} - -func (p *PostUsersSignInDataUserPlexAccount) GetPastSubscriptions() []PastSubscription { - if p == nil { - return []PastSubscription{} - } - return p.PastSubscriptions -} - -func (p *PostUsersSignInDataUserPlexAccount) GetTrials() []Trials { - if p == nil { - return []Trials{} - } - return p.Trials -} - -type PostUsersSignInDataResponse 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 - // Returns the user account data with a valid auth token - UserPlexAccount *PostUsersSignInDataUserPlexAccount -} - -func (p *PostUsersSignInDataResponse) GetContentType() string { - if p == nil { - return "" - } - return p.ContentType -} - -func (p *PostUsersSignInDataResponse) GetStatusCode() int { - if p == nil { - return 0 - } - return p.StatusCode -} - -func (p *PostUsersSignInDataResponse) GetRawResponse() *http.Response { - if p == nil { - return nil - } - return p.RawResponse -} - -func (p *PostUsersSignInDataResponse) GetUserPlexAccount() *PostUsersSignInDataUserPlexAccount { - if p == nil { - return nil - } - return p.UserPlexAccount -} diff --git a/models/operations/processsubscriptions.go b/models/operations/processsubscriptions.go new file mode 100644 index 0000000..950d9a3 --- /dev/null +++ b/models/operations/processsubscriptions.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type ProcessSubscriptionsResponse 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 + Headers map[string][]string +} + +func (p *ProcessSubscriptionsResponse) GetContentType() string { + if p == nil { + return "" + } + return p.ContentType +} + +func (p *ProcessSubscriptionsResponse) GetStatusCode() int { + if p == nil { + return 0 + } + return p.StatusCode +} + +func (p *ProcessSubscriptionsResponse) GetRawResponse() *http.Response { + if p == nil { + return nil + } + return p.RawResponse +} + +func (p *ProcessSubscriptionsResponse) GetHeaders() map[string][]string { + if p == nil { + return map[string][]string{} + } + return p.Headers +} diff --git a/models/operations/refreshitemsmetadata.go b/models/operations/refreshitemsmetadata.go new file mode 100644 index 0000000..330ca03 --- /dev/null +++ b/models/operations/refreshitemsmetadata.go @@ -0,0 +1,289 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RefreshItemsMetadataGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RefreshItemsMetadataGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshItemsMetadataGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RefreshItemsMetadataGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshItemsMetadataGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshItemsMetadataGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshItemsMetadataGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshItemsMetadataGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshItemsMetadataGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshItemsMetadataGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshItemsMetadataGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshItemsMetadataGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshItemsMetadataGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshItemsMetadataGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RefreshItemsMetadataRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Agent *string `queryParam:"style=form,explode=true,name=agent"` + MarkUpdated *components.BoolInt `queryParam:"style=form,explode=true,name=markUpdated"` +} + +func (r RefreshItemsMetadataRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshItemsMetadataRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (r *RefreshItemsMetadataRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshItemsMetadataRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshItemsMetadataRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshItemsMetadataRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshItemsMetadataRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshItemsMetadataRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshItemsMetadataRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshItemsMetadataRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshItemsMetadataRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshItemsMetadataRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshItemsMetadataRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RefreshItemsMetadataRequest) GetIds() string { + if r == nil { + return "" + } + return r.Ids +} + +func (r *RefreshItemsMetadataRequest) GetAgent() *string { + if r == nil { + return nil + } + return r.Agent +} + +func (r *RefreshItemsMetadataRequest) GetMarkUpdated() *components.BoolInt { + if r == nil { + return nil + } + return r.MarkUpdated +} + +type RefreshItemsMetadataResponse 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 (r *RefreshItemsMetadataResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RefreshItemsMetadataResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RefreshItemsMetadataResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/refreshplaylist.go b/models/operations/refreshplaylist.go new file mode 100644 index 0000000..50cad9d --- /dev/null +++ b/models/operations/refreshplaylist.go @@ -0,0 +1,333 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RefreshPlaylistGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RefreshPlaylistGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshPlaylistGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RefreshPlaylistGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshPlaylistGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshPlaylistGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshPlaylistGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshPlaylistGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshPlaylistGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshPlaylistGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshPlaylistGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshPlaylistGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshPlaylistGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshPlaylistGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +// Action - The action to perform for this item on this optimizer queue +type Action string + +const ( + ActionReprocess Action = "reprocess" + ActionDisable Action = "disable" + ActionEnable Action = "enable" +) + +func (e Action) ToPointer() *Action { + return &e +} +func (e *Action) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "reprocess": + fallthrough + case "disable": + fallthrough + case "enable": + *e = Action(v) + return nil + default: + return fmt.Errorf("invalid value for Action: %v", v) + } +} + +type RefreshPlaylistRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` + // The generator item ID to act on + GeneratorID int64 `pathParam:"style=simple,explode=false,name=generatorId"` + // The metadata item ID to act on + MetadataID int64 `pathParam:"style=simple,explode=false,name=metadataId"` + // The action to perform for this item on this optimizer queue + Action Action `pathParam:"style=simple,explode=false,name=action"` +} + +func (r RefreshPlaylistRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshPlaylistRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"playlistId", "generatorId", "metadataId", "action"}); err != nil { + return err + } + return nil +} + +func (r *RefreshPlaylistRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshPlaylistRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshPlaylistRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshPlaylistRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshPlaylistRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshPlaylistRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshPlaylistRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshPlaylistRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshPlaylistRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshPlaylistRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshPlaylistRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RefreshPlaylistRequest) GetPlaylistID() int64 { + if r == nil { + return 0 + } + return r.PlaylistID +} + +func (r *RefreshPlaylistRequest) GetGeneratorID() int64 { + if r == nil { + return 0 + } + return r.GeneratorID +} + +func (r *RefreshPlaylistRequest) GetMetadataID() int64 { + if r == nil { + return 0 + } + return r.MetadataID +} + +func (r *RefreshPlaylistRequest) GetAction() Action { + if r == nil { + return Action("") + } + return r.Action +} + +type RefreshPlaylistResponse 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 (r *RefreshPlaylistResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RefreshPlaylistResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RefreshPlaylistResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/refreshproviders.go b/models/operations/refreshproviders.go new file mode 100644 index 0000000..76d4642 --- /dev/null +++ b/models/operations/refreshproviders.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type RefreshProvidersResponse 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 (r *RefreshProvidersResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RefreshProvidersResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RefreshProvidersResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/refreshsection.go b/models/operations/refreshsection.go new file mode 100644 index 0000000..0ad34f8 --- /dev/null +++ b/models/operations/refreshsection.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RefreshSectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RefreshSectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshSectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RefreshSectionGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshSectionGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshSectionGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshSectionGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshSectionGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshSectionGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshSectionGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshSectionGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshSectionGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshSectionGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshSectionGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RefreshSectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Whether the update of metadata and items should be performed even if modification dates indicate the items have not change + Force *components.BoolInt `queryParam:"style=form,explode=true,name=force"` + // Restrict refresh to the specified path + Path *string `queryParam:"style=form,explode=true,name=path"` +} + +func (r RefreshSectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshSectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (r *RefreshSectionRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshSectionRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshSectionRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshSectionRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshSectionRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshSectionRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshSectionRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshSectionRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshSectionRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshSectionRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshSectionRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RefreshSectionRequest) GetSectionID() int64 { + if r == nil { + return 0 + } + return r.SectionID +} + +func (r *RefreshSectionRequest) GetForce() *components.BoolInt { + if r == nil { + return nil + } + return r.Force +} + +func (r *RefreshSectionRequest) GetPath() *string { + if r == nil { + return nil + } + return r.Path +} + +type RefreshSectionResponse 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 (r *RefreshSectionResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RefreshSectionResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RefreshSectionResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/refreshsectionsmetadata.go b/models/operations/refreshsectionsmetadata.go new file mode 100644 index 0000000..197740a --- /dev/null +++ b/models/operations/refreshsectionsmetadata.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RefreshSectionsMetadataGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RefreshSectionsMetadataGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshSectionsMetadataGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RefreshSectionsMetadataGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshSectionsMetadataGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshSectionsMetadataGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshSectionsMetadataGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshSectionsMetadataGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshSectionsMetadataGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshSectionsMetadataGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshSectionsMetadataGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshSectionsMetadataGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshSectionsMetadataGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshSectionsMetadataGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RefreshSectionsMetadataRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Force refresh of metadata + Force *bool `queryParam:"style=form,explode=true,name=force"` +} + +func (r RefreshSectionsMetadataRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RefreshSectionsMetadataRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RefreshSectionsMetadataRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RefreshSectionsMetadataRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RefreshSectionsMetadataRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RefreshSectionsMetadataRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RefreshSectionsMetadataRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RefreshSectionsMetadataRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RefreshSectionsMetadataRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RefreshSectionsMetadataRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RefreshSectionsMetadataRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RefreshSectionsMetadataRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RefreshSectionsMetadataRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RefreshSectionsMetadataRequest) GetForce() *bool { + if r == nil { + return nil + } + return r.Force +} + +type RefreshSectionsMetadataResponse 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 (r *RefreshSectionsMetadataResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RefreshSectionsMetadataResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RefreshSectionsMetadataResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/reloadguide.go b/models/operations/reloadguide.go new file mode 100644 index 0000000..cd2d933 --- /dev/null +++ b/models/operations/reloadguide.go @@ -0,0 +1,282 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ReloadGuideGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r ReloadGuideGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReloadGuideGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ReloadGuideGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ReloadGuideGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ReloadGuideGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ReloadGuideGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ReloadGuideGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ReloadGuideGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ReloadGuideGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ReloadGuideGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ReloadGuideGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ReloadGuideGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ReloadGuideGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type ReloadGuideRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` +} + +func (r ReloadGuideRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReloadGuideRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"dvrId"}); err != nil { + return err + } + return nil +} + +func (r *ReloadGuideRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ReloadGuideRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ReloadGuideRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ReloadGuideRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ReloadGuideRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ReloadGuideRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ReloadGuideRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ReloadGuideRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ReloadGuideRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ReloadGuideRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ReloadGuideRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *ReloadGuideRequest) GetDvrID() int64 { + if r == nil { + return 0 + } + return r.DvrID +} + +type ReloadGuideResponse 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 + Headers map[string][]string +} + +func (r *ReloadGuideResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *ReloadGuideResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *ReloadGuideResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} + +func (r *ReloadGuideResponse) GetHeaders() map[string][]string { + if r == nil { + return map[string][]string{} + } + return r.Headers +} diff --git a/models/operations/removedevice.go b/models/operations/removedevice.go new file mode 100644 index 0000000..34928d3 --- /dev/null +++ b/models/operations/removedevice.go @@ -0,0 +1,361 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RemoveDeviceGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RemoveDeviceGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RemoveDeviceGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RemoveDeviceGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RemoveDeviceGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RemoveDeviceGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RemoveDeviceGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RemoveDeviceGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RemoveDeviceGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RemoveDeviceGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDeviceGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RemoveDeviceGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RemoveDeviceGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RemoveDeviceGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RemoveDeviceRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` +} + +func (r RemoveDeviceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RemoveDeviceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (r *RemoveDeviceRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RemoveDeviceRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RemoveDeviceRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RemoveDeviceRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RemoveDeviceRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RemoveDeviceRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RemoveDeviceRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDeviceRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RemoveDeviceRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RemoveDeviceRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RemoveDeviceRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RemoveDeviceRequest) GetDeviceID() int64 { + if r == nil { + return 0 + } + return r.DeviceID +} + +// RemoveDeviceMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type RemoveDeviceMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Message *string `json:"message,omitempty"` + Status *int64 `json:"status,omitempty"` +} + +func (r *RemoveDeviceMediaContainer) GetIdentifier() *string { + if r == nil { + return nil + } + return r.Identifier +} + +func (r *RemoveDeviceMediaContainer) GetOffset() *int64 { + if r == nil { + return nil + } + return r.Offset +} + +func (r *RemoveDeviceMediaContainer) GetSize() *int64 { + if r == nil { + return nil + } + return r.Size +} + +func (r *RemoveDeviceMediaContainer) GetTotalSize() *int64 { + if r == nil { + return nil + } + return r.TotalSize +} + +func (r *RemoveDeviceMediaContainer) GetMessage() *string { + if r == nil { + return nil + } + return r.Message +} + +func (r *RemoveDeviceMediaContainer) GetStatus() *int64 { + if r == nil { + return nil + } + return r.Status +} + +// RemoveDeviceResponseBody - OK +type RemoveDeviceResponseBody struct { + MediaContainer *RemoveDeviceMediaContainer `json:"MediaContainer,omitempty"` +} + +func (r *RemoveDeviceResponseBody) GetMediaContainer() *RemoveDeviceMediaContainer { + if r == nil { + return nil + } + return r.MediaContainer +} + +type RemoveDeviceResponse 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 + // OK + Object *RemoveDeviceResponseBody + Headers map[string][]string +} + +func (r *RemoveDeviceResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RemoveDeviceResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RemoveDeviceResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} + +func (r *RemoveDeviceResponse) GetObject() *RemoveDeviceResponseBody { + if r == nil { + return nil + } + return r.Object +} + +func (r *RemoveDeviceResponse) GetHeaders() map[string][]string { + if r == nil { + return map[string][]string{} + } + return r.Headers +} diff --git a/models/operations/removedevicefromdvr.go b/models/operations/removedevicefromdvr.go new file mode 100644 index 0000000..9f35e84 --- /dev/null +++ b/models/operations/removedevicefromdvr.go @@ -0,0 +1,425 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RemoveDeviceFromDVRGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RemoveDeviceFromDVRGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RemoveDeviceFromDVRGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RemoveDeviceFromDVRGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RemoveDeviceFromDVRGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RemoveDeviceFromDVRGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RemoveDeviceFromDVRGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RemoveDeviceFromDVRGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RemoveDeviceFromDVRGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RemoveDeviceFromDVRGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDeviceFromDVRGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RemoveDeviceFromDVRGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RemoveDeviceFromDVRGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RemoveDeviceFromDVRGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RemoveDeviceFromDVRRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` + // The ID of the device to add. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` +} + +func (r RemoveDeviceFromDVRRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RemoveDeviceFromDVRRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"dvrId", "deviceId"}); err != nil { + return err + } + return nil +} + +func (r *RemoveDeviceFromDVRRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RemoveDeviceFromDVRRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RemoveDeviceFromDVRRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RemoveDeviceFromDVRRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RemoveDeviceFromDVRRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RemoveDeviceFromDVRRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RemoveDeviceFromDVRRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDeviceFromDVRRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RemoveDeviceFromDVRRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RemoveDeviceFromDVRRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RemoveDeviceFromDVRRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RemoveDeviceFromDVRRequest) GetDvrID() int64 { + if r == nil { + return 0 + } + return r.DvrID +} + +func (r *RemoveDeviceFromDVRRequest) GetDeviceID() int64 { + if r == nil { + return 0 + } + return r.DeviceID +} + +// RemoveDeviceFromDVRDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type RemoveDeviceFromDVRDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (r *RemoveDeviceFromDVRDVRsMediaContainer) GetIdentifier() *string { + if r == nil { + return nil + } + return r.Identifier +} + +func (r *RemoveDeviceFromDVRDVRsMediaContainer) GetOffset() *int64 { + if r == nil { + return nil + } + return r.Offset +} + +func (r *RemoveDeviceFromDVRDVRsMediaContainer) GetSize() *int64 { + if r == nil { + return nil + } + return r.Size +} + +func (r *RemoveDeviceFromDVRDVRsMediaContainer) GetTotalSize() *int64 { + if r == nil { + return nil + } + return r.TotalSize +} + +func (r *RemoveDeviceFromDVRDVRsMediaContainer) GetStatus() *int64 { + if r == nil { + return nil + } + return r.Status +} + +type RemoveDeviceFromDVRDVR struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (r *RemoveDeviceFromDVRDVR) GetDevice() []components.Device { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDeviceFromDVRDVR) GetKey() *string { + if r == nil { + return nil + } + return r.Key +} + +func (r *RemoveDeviceFromDVRDVR) GetLanguage() *string { + if r == nil { + return nil + } + return r.Language +} + +func (r *RemoveDeviceFromDVRDVR) GetLineup() *string { + if r == nil { + return nil + } + return r.Lineup +} + +func (r *RemoveDeviceFromDVRDVR) GetUUID() *string { + if r == nil { + return nil + } + return r.UUID +} + +type RemoveDeviceFromDVRMediaContainer struct { + MediaContainer *RemoveDeviceFromDVRDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []RemoveDeviceFromDVRDVR `json:"DVR,omitempty"` +} + +func (r *RemoveDeviceFromDVRMediaContainer) GetMediaContainer() *RemoveDeviceFromDVRDVRsMediaContainer { + if r == nil { + return nil + } + return r.MediaContainer +} + +func (r *RemoveDeviceFromDVRMediaContainer) GetDvr() []RemoveDeviceFromDVRDVR { + if r == nil { + return nil + } + return r.Dvr +} + +// RemoveDeviceFromDVRResponseBody - OK +type RemoveDeviceFromDVRResponseBody struct { + MediaContainer *RemoveDeviceFromDVRMediaContainer `json:"MediaContainer,omitempty"` +} + +func (r *RemoveDeviceFromDVRResponseBody) GetMediaContainer() *RemoveDeviceFromDVRMediaContainer { + if r == nil { + return nil + } + return r.MediaContainer +} + +type RemoveDeviceFromDVRResponse 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 + // OK + Object *RemoveDeviceFromDVRResponseBody + Headers map[string][]string +} + +func (r *RemoveDeviceFromDVRResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RemoveDeviceFromDVRResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RemoveDeviceFromDVRResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} + +func (r *RemoveDeviceFromDVRResponse) GetObject() *RemoveDeviceFromDVRResponseBody { + if r == nil { + return nil + } + return r.Object +} + +func (r *RemoveDeviceFromDVRResponse) GetHeaders() map[string][]string { + if r == nil { + return map[string][]string{} + } + return r.Headers +} diff --git a/models/operations/removedownloadqueueitems.go b/models/operations/removedownloadqueueitems.go new file mode 100644 index 0000000..11366d4 --- /dev/null +++ b/models/operations/removedownloadqueueitems.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RemoveDownloadQueueItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RemoveDownloadQueueItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RemoveDownloadQueueItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RemoveDownloadQueueItemsGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RemoveDownloadQueueItemsGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RemoveDownloadQueueItemsGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RemoveDownloadQueueItemsGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RemoveDownloadQueueItemsGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RemoveDownloadQueueItemsGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RemoveDownloadQueueItemsGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDownloadQueueItemsGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RemoveDownloadQueueItemsGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RemoveDownloadQueueItemsGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RemoveDownloadQueueItemsGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RemoveDownloadQueueItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` + // The item id + ItemID []int64 `pathParam:"style=simple,explode=false,name=itemId"` +} + +func (r RemoveDownloadQueueItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RemoveDownloadQueueItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"queueId", "itemId"}); err != nil { + return err + } + return nil +} + +func (r *RemoveDownloadQueueItemsRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RemoveDownloadQueueItemsRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RemoveDownloadQueueItemsRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RemoveDownloadQueueItemsRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RemoveDownloadQueueItemsRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RemoveDownloadQueueItemsRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RemoveDownloadQueueItemsRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RemoveDownloadQueueItemsRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RemoveDownloadQueueItemsRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RemoveDownloadQueueItemsRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RemoveDownloadQueueItemsRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RemoveDownloadQueueItemsRequest) GetQueueID() int64 { + if r == nil { + return 0 + } + return r.QueueID +} + +func (r *RemoveDownloadQueueItemsRequest) GetItemID() []int64 { + if r == nil { + return []int64{} + } + return r.ItemID +} + +type RemoveDownloadQueueItemsResponse 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 (r *RemoveDownloadQueueItemsResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RemoveDownloadQueueItemsResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RemoveDownloadQueueItemsResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/reordersubscription.go b/models/operations/reordersubscription.go new file mode 100644 index 0000000..a19cc9a --- /dev/null +++ b/models/operations/reordersubscription.go @@ -0,0 +1,291 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ReorderSubscriptionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r ReorderSubscriptionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReorderSubscriptionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ReorderSubscriptionGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ReorderSubscriptionGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ReorderSubscriptionGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ReorderSubscriptionGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ReorderSubscriptionGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ReorderSubscriptionGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ReorderSubscriptionGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ReorderSubscriptionGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ReorderSubscriptionGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ReorderSubscriptionGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ReorderSubscriptionGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type ReorderSubscriptionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + SubscriptionID int64 `pathParam:"style=simple,explode=false,name=subscriptionId"` + // The subscription to move this sub after. If missing will insert at the beginning of the list + After *int64 `queryParam:"style=form,explode=true,name=after"` +} + +func (r ReorderSubscriptionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReorderSubscriptionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"subscriptionId"}); err != nil { + return err + } + return nil +} + +func (r *ReorderSubscriptionRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ReorderSubscriptionRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ReorderSubscriptionRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ReorderSubscriptionRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ReorderSubscriptionRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ReorderSubscriptionRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ReorderSubscriptionRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ReorderSubscriptionRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ReorderSubscriptionRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ReorderSubscriptionRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ReorderSubscriptionRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *ReorderSubscriptionRequest) GetSubscriptionID() int64 { + if r == nil { + return 0 + } + return r.SubscriptionID +} + +func (r *ReorderSubscriptionRequest) GetAfter() *int64 { + if r == nil { + return nil + } + return r.After +} + +type ReorderSubscriptionResponse 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 + // OK + MediaContainerWithSubscription *components.MediaContainerWithSubscription +} + +func (r *ReorderSubscriptionResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *ReorderSubscriptionResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *ReorderSubscriptionResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} + +func (r *ReorderSubscriptionResponse) GetMediaContainerWithSubscription() *components.MediaContainerWithSubscription { + if r == nil { + return nil + } + return r.MediaContainerWithSubscription +} diff --git a/models/operations/report.go b/models/operations/report.go new file mode 100644 index 0000000..07b55fb --- /dev/null +++ b/models/operations/report.go @@ -0,0 +1,954 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ReportGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r ReportGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ReportGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ReportGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ReportGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ReportGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ReportGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ReportGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ReportGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ReportGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ReportGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ReportGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ReportGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +// State - The current state of the media. +type State string + +const ( + StateStopped State = "stopped" + StateBuffering State = "buffering" + StatePlaying State = "playing" + StatePaused State = "paused" +) + +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 "stopped": + fallthrough + case "buffering": + fallthrough + case "playing": + fallthrough + case "paused": + *e = State(v) + return nil + default: + return fmt.Errorf("invalid value for State: %v", v) + } +} + +type ReportRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The details key for the item. + Key *string `queryParam:"style=form,explode=true,name=key"` + // The rating key attribute for the item. + RatingKey *string `queryParam:"style=form,explode=true,name=ratingKey"` + // The current state of the media. + State *State `queryParam:"style=form,explode=true,name=state"` + // If playing media from a play queue, the play queue's ID. + PlayQueueItemID *string `queryParam:"style=form,explode=true,name=playQueueItemID"` + // The current time offset of playback in ms. + Time *int64 `queryParam:"style=form,explode=true,name=time"` + // The total duration of the item in ms. + Duration *int64 `queryParam:"style=form,explode=true,name=duration"` + // When state is `stopped`, a flag indicating whether or not the client is going to continue playing anothe item. + Continuing *components.BoolInt `queryParam:"style=form,explode=true,name=continuing"` + // Used when a sync client comes online and is syncing media timelines, holds the time at which the playback state was last updated. + Updated *int64 `queryParam:"style=form,explode=true,name=updated"` + // Also used by sync clients, used to indicate that a timeline is being synced from being offline, as opposed to being "live". + Offline *components.BoolInt `queryParam:"style=form,explode=true,name=offline"` + // Time in seconds till first frame is displayed. Sent only on the first playing timeline request. + TimeToFirstFrame *int64 `queryParam:"style=form,explode=true,name=timeToFirstFrame"` + // Time in seconds spent buffering since last request. + TimeStalled *int64 `queryParam:"style=form,explode=true,name=timeStalled"` + // Bandwidth in kbps as estimated by the client. + Bandwidth *int64 `queryParam:"style=form,explode=true,name=bandwidth"` + // Amount of time in seconds buffered by client. Omit if computed by `bufferedSize` below. + BufferedTime *int64 `queryParam:"style=form,explode=true,name=bufferedTime"` + // Size in kilobytes of data buffered by client. Omit if computed by `bufferedTime` above + BufferedSize *int64 `queryParam:"style=form,explode=true,name=bufferedSize"` + // Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) + XPlexSessionIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Session-Identifier"` +} + +func (r ReportRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ReportRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ReportRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ReportRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ReportRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ReportRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ReportRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ReportRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ReportRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ReportRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ReportRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ReportRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *ReportRequest) GetKey() *string { + if r == nil { + return nil + } + return r.Key +} + +func (r *ReportRequest) GetRatingKey() *string { + if r == nil { + return nil + } + return r.RatingKey +} + +func (r *ReportRequest) GetState() *State { + if r == nil { + return nil + } + return r.State +} + +func (r *ReportRequest) GetPlayQueueItemID() *string { + if r == nil { + return nil + } + return r.PlayQueueItemID +} + +func (r *ReportRequest) GetTime() *int64 { + if r == nil { + return nil + } + return r.Time +} + +func (r *ReportRequest) GetDuration() *int64 { + if r == nil { + return nil + } + return r.Duration +} + +func (r *ReportRequest) GetContinuing() *components.BoolInt { + if r == nil { + return nil + } + return r.Continuing +} + +func (r *ReportRequest) GetUpdated() *int64 { + if r == nil { + return nil + } + return r.Updated +} + +func (r *ReportRequest) GetOffline() *components.BoolInt { + if r == nil { + return nil + } + return r.Offline +} + +func (r *ReportRequest) GetTimeToFirstFrame() *int64 { + if r == nil { + return nil + } + return r.TimeToFirstFrame +} + +func (r *ReportRequest) GetTimeStalled() *int64 { + if r == nil { + return nil + } + return r.TimeStalled +} + +func (r *ReportRequest) GetBandwidth() *int64 { + if r == nil { + return nil + } + return r.Bandwidth +} + +func (r *ReportRequest) GetBufferedTime() *int64 { + if r == nil { + return nil + } + return r.BufferedTime +} + +func (r *ReportRequest) GetBufferedSize() *int64 { + if r == nil { + return nil + } + return r.BufferedSize +} + +func (r *ReportRequest) GetXPlexSessionIdentifier() *string { + if r == nil { + return nil + } + return r.XPlexSessionIdentifier +} + +type Bandwidth struct { + // The bandwidth at this time in kbps + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The user-friendly resolution at this time + Resolution *string `json:"resolution,omitempty"` + // Media playback time where this bandwidth started + Time *int64 `json:"time,omitempty"` +} + +func (b *Bandwidth) GetBandwidth() *int64 { + if b == nil { + return nil + } + return b.Bandwidth +} + +func (b *Bandwidth) GetResolution() *string { + if b == nil { + return nil + } + return b.Resolution +} + +func (b *Bandwidth) GetTime() *int64 { + if b == nil { + return nil + } + return b.Time +} + +// Bandwidths - A list of media times and bandwidths when trascoding is using with auto adjustment of bandwidth +type Bandwidths struct { + Bandwidth []Bandwidth `json:"Bandwidth,omitempty"` +} + +func (b *Bandwidths) GetBandwidth() []Bandwidth { + if b == nil { + return nil + } + return b.Bandwidth +} + +// MediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type MediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,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 *int64 `json:"livetv,omitempty"` + MachineIdentifier any `json:"machineIdentifier,omitempty"` + MediaProviders *bool `json:"mediaProviders,omitempty"` + Multiuser *bool `json:"multiuser,omitempty"` + MusicAnalysis *int64 `json:"musicAnalysis,omitempty"` + MyPlex *bool `json:"myPlex,omitempty"` + MyPlexMappingState any `json:"myPlexMappingState,omitempty"` + MyPlexSigninState any `json:"myPlexSigninState,omitempty"` + MyPlexSubscription *bool `json:"myPlexSubscription,omitempty"` + MyPlexUsername *string `json:"myPlexUsername,omitempty"` + OfflineTranscode any `json:"offlineTranscode,omitempty"` + // A comma-separated list of features which are enabled for the server owner + OwnerFeatures *string `json:"ownerFeatures,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 *int64 `json:"streamingBrainABRVersion,omitempty"` + StreamingBrainVersion *int64 `json:"streamingBrainVersion,omitempty"` + Sync *bool `json:"sync,omitempty"` + TranscoderActiveVideoSessions *int64 `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"` + // The suggested video quality bitrates to present to the user + TranscoderVideoBitrates any `json:"transcoderVideoBitrates,omitempty"` + TranscoderVideoQualities *string `json:"transcoderVideoQualities,omitempty"` + // The suggested video resolutions to the above quality bitrates + TranscoderVideoResolutions any `json:"transcoderVideoResolutions,omitempty"` + UpdatedAt *int64 `json:"updatedAt,omitempty"` + Updater *bool `json:"updater,omitempty"` + Version *string `json:"version,omitempty"` + VoiceSearch *bool `json:"voiceSearch,omitempty"` + // A list of media times and bandwidths when trascoding is using with auto adjustment of bandwidth + Bandwidths *Bandwidths `json:"Bandwidths,omitempty"` + // A code describing why the session was terminated by the server. + TerminationCode *int64 `json:"terminationCode,omitempty"` + // A user friendly and localized text describing why the session was terminated by the server. + TerminationText *string `json:"terminationText,omitempty"` +} + +func (m *MediaContainer) GetIdentifier() *string { + if m == nil { + return nil + } + return m.Identifier +} + +func (m *MediaContainer) GetOffset() *int64 { + if m == nil { + return nil + } + return m.Offset +} + +func (m *MediaContainer) GetSize() *int64 { + if m == nil { + return nil + } + return m.Size +} + +func (m *MediaContainer) GetTotalSize() *int64 { + if m == nil { + return nil + } + return m.TotalSize +} + +func (m *MediaContainer) GetAllowCameraUpload() *bool { + if m == nil { + return nil + } + return m.AllowCameraUpload +} + +func (m *MediaContainer) GetAllowChannelAccess() *bool { + if m == nil { + return nil + } + return m.AllowChannelAccess +} + +func (m *MediaContainer) GetAllowMediaDeletion() *bool { + if m == nil { + return nil + } + return m.AllowMediaDeletion +} + +func (m *MediaContainer) GetAllowSharing() *bool { + if m == nil { + return nil + } + return m.AllowSharing +} + +func (m *MediaContainer) GetAllowSync() *bool { + if m == nil { + return nil + } + return m.AllowSync +} + +func (m *MediaContainer) GetAllowTuners() *bool { + if m == nil { + return nil + } + return m.AllowTuners +} + +func (m *MediaContainer) GetBackgroundProcessing() *bool { + if m == nil { + return nil + } + return m.BackgroundProcessing +} + +func (m *MediaContainer) GetCertificate() *bool { + if m == nil { + return nil + } + return m.Certificate +} + +func (m *MediaContainer) GetCompanionProxy() *bool { + if m == nil { + return nil + } + return m.CompanionProxy +} + +func (m *MediaContainer) GetCountryCode() *string { + if m == nil { + return nil + } + return m.CountryCode +} + +func (m *MediaContainer) GetDiagnostics() *string { + if m == nil { + return nil + } + return m.Diagnostics +} + +func (m *MediaContainer) GetEventStream() *bool { + if m == nil { + return nil + } + return m.EventStream +} + +func (m *MediaContainer) GetFriendlyName() *string { + if m == nil { + return nil + } + return m.FriendlyName +} + +func (m *MediaContainer) GetHubSearch() *bool { + if m == nil { + return nil + } + return m.HubSearch +} + +func (m *MediaContainer) GetItemClusters() *bool { + if m == nil { + return nil + } + return m.ItemClusters +} + +func (m *MediaContainer) GetLivetv() *int64 { + if m == nil { + return nil + } + return m.Livetv +} + +func (m *MediaContainer) GetMachineIdentifier() any { + if m == nil { + return nil + } + return m.MachineIdentifier +} + +func (m *MediaContainer) GetMediaProviders() *bool { + if m == nil { + return nil + } + return m.MediaProviders +} + +func (m *MediaContainer) GetMultiuser() *bool { + if m == nil { + return nil + } + return m.Multiuser +} + +func (m *MediaContainer) GetMusicAnalysis() *int64 { + if m == nil { + return nil + } + return m.MusicAnalysis +} + +func (m *MediaContainer) GetMyPlex() *bool { + if m == nil { + return nil + } + return m.MyPlex +} + +func (m *MediaContainer) GetMyPlexMappingState() any { + if m == nil { + return nil + } + return m.MyPlexMappingState +} + +func (m *MediaContainer) GetMyPlexSigninState() any { + if m == nil { + return nil + } + return m.MyPlexSigninState +} + +func (m *MediaContainer) GetMyPlexSubscription() *bool { + if m == nil { + return nil + } + return m.MyPlexSubscription +} + +func (m *MediaContainer) GetMyPlexUsername() *string { + if m == nil { + return nil + } + return m.MyPlexUsername +} + +func (m *MediaContainer) GetOfflineTranscode() any { + if m == nil { + return nil + } + return m.OfflineTranscode +} + +func (m *MediaContainer) GetOwnerFeatures() *string { + if m == nil { + return nil + } + return m.OwnerFeatures +} + +func (m *MediaContainer) GetPlatform() *string { + if m == nil { + return nil + } + return m.Platform +} + +func (m *MediaContainer) GetPlatformVersion() *string { + if m == nil { + return nil + } + return m.PlatformVersion +} + +func (m *MediaContainer) GetPluginHost() *bool { + if m == nil { + return nil + } + return m.PluginHost +} + +func (m *MediaContainer) GetPushNotifications() *bool { + if m == nil { + return nil + } + return m.PushNotifications +} + +func (m *MediaContainer) GetReadOnlyLibraries() *bool { + if m == nil { + return nil + } + return m.ReadOnlyLibraries +} + +func (m *MediaContainer) GetStreamingBrainABRVersion() *int64 { + if m == nil { + return nil + } + return m.StreamingBrainABRVersion +} + +func (m *MediaContainer) GetStreamingBrainVersion() *int64 { + if m == nil { + return nil + } + return m.StreamingBrainVersion +} + +func (m *MediaContainer) GetSync() *bool { + if m == nil { + return nil + } + return m.Sync +} + +func (m *MediaContainer) GetTranscoderActiveVideoSessions() *int64 { + if m == nil { + return nil + } + return m.TranscoderActiveVideoSessions +} + +func (m *MediaContainer) GetTranscoderAudio() *bool { + if m == nil { + return nil + } + return m.TranscoderAudio +} + +func (m *MediaContainer) GetTranscoderLyrics() *bool { + if m == nil { + return nil + } + return m.TranscoderLyrics +} + +func (m *MediaContainer) GetTranscoderPhoto() *bool { + if m == nil { + return nil + } + return m.TranscoderPhoto +} + +func (m *MediaContainer) GetTranscoderSubtitles() *bool { + if m == nil { + return nil + } + return m.TranscoderSubtitles +} + +func (m *MediaContainer) GetTranscoderVideo() *bool { + if m == nil { + return nil + } + return m.TranscoderVideo +} + +func (m *MediaContainer) GetTranscoderVideoBitrates() any { + if m == nil { + return nil + } + return m.TranscoderVideoBitrates +} + +func (m *MediaContainer) GetTranscoderVideoQualities() *string { + if m == nil { + return nil + } + return m.TranscoderVideoQualities +} + +func (m *MediaContainer) GetTranscoderVideoResolutions() any { + if m == nil { + return nil + } + return m.TranscoderVideoResolutions +} + +func (m *MediaContainer) GetUpdatedAt() *int64 { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *MediaContainer) GetUpdater() *bool { + if m == nil { + return nil + } + return m.Updater +} + +func (m *MediaContainer) GetVersion() *string { + if m == nil { + return nil + } + return m.Version +} + +func (m *MediaContainer) GetVoiceSearch() *bool { + if m == nil { + return nil + } + return m.VoiceSearch +} + +func (m *MediaContainer) GetBandwidths() *Bandwidths { + if m == nil { + return nil + } + return m.Bandwidths +} + +func (m *MediaContainer) GetTerminationCode() *int64 { + if m == nil { + return nil + } + return m.TerminationCode +} + +func (m *MediaContainer) GetTerminationText() *string { + if m == nil { + return nil + } + return m.TerminationText +} + +// ReportResponseBody - OK +type ReportResponseBody struct { + MediaContainer *MediaContainer `json:"MediaContainer,omitempty"` +} + +func (r *ReportResponseBody) GetMediaContainer() *MediaContainer { + if r == nil { + return nil + } + return r.MediaContainer +} + +type ReportResponse 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 + // OK + Object *ReportResponseBody +} + +func (r *ReportResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *ReportResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *ReportResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} + +func (r *ReportResponse) GetObject() *ReportResponseBody { + if r == nil { + return nil + } + return r.Object +} diff --git a/models/operations/resetplayqueue.go b/models/operations/resetplayqueue.go new file mode 100644 index 0000000..88010c2 --- /dev/null +++ b/models/operations/resetplayqueue.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ResetPlayQueueGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r ResetPlayQueueGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ResetPlayQueueGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ResetPlayQueueGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ResetPlayQueueGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ResetPlayQueueGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ResetPlayQueueGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ResetPlayQueueGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ResetPlayQueueGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ResetPlayQueueGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ResetPlayQueueGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ResetPlayQueueGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ResetPlayQueueGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ResetPlayQueueGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type ResetPlayQueueRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` +} + +func (r ResetPlayQueueRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ResetPlayQueueRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"playQueueId"}); err != nil { + return err + } + return nil +} + +func (r *ResetPlayQueueRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ResetPlayQueueRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ResetPlayQueueRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ResetPlayQueueRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ResetPlayQueueRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ResetPlayQueueRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ResetPlayQueueRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ResetPlayQueueRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ResetPlayQueueRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ResetPlayQueueRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ResetPlayQueueRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *ResetPlayQueueRequest) GetPlayQueueID() int64 { + if r == nil { + return 0 + } + return r.PlayQueueID +} + +type ResetPlayQueueResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (r *ResetPlayQueueResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *ResetPlayQueueResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *ResetPlayQueueResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} + +func (r *ResetPlayQueueResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if r == nil { + return nil + } + return r.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/resetsectiondefaults.go b/models/operations/resetsectiondefaults.go new file mode 100644 index 0000000..76d5ec7 --- /dev/null +++ b/models/operations/resetsectiondefaults.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ResetSectionDefaultsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r ResetSectionDefaultsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ResetSectionDefaultsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ResetSectionDefaultsGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ResetSectionDefaultsGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ResetSectionDefaultsGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ResetSectionDefaultsGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ResetSectionDefaultsGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ResetSectionDefaultsGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ResetSectionDefaultsGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ResetSectionDefaultsGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ResetSectionDefaultsGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ResetSectionDefaultsGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ResetSectionDefaultsGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type ResetSectionDefaultsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to reorder + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (r ResetSectionDefaultsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ResetSectionDefaultsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (r *ResetSectionDefaultsRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *ResetSectionDefaultsRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *ResetSectionDefaultsRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *ResetSectionDefaultsRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *ResetSectionDefaultsRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *ResetSectionDefaultsRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *ResetSectionDefaultsRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *ResetSectionDefaultsRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *ResetSectionDefaultsRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *ResetSectionDefaultsRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *ResetSectionDefaultsRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *ResetSectionDefaultsRequest) GetSectionID() int64 { + if r == nil { + return 0 + } + return r.SectionID +} + +type ResetSectionDefaultsResponse 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 (r *ResetSectionDefaultsResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *ResetSectionDefaultsResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *ResetSectionDefaultsResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/restartprocessingdownloadqueueitems.go b/models/operations/restartprocessingdownloadqueueitems.go new file mode 100644 index 0000000..cda08d2 --- /dev/null +++ b/models/operations/restartprocessingdownloadqueueitems.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type RestartProcessingDownloadQueueItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (r RestartProcessingDownloadQueueItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RestartProcessingDownloadQueueItemsGlobals) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +type RestartProcessingDownloadQueueItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The queue id + QueueID int64 `pathParam:"style=simple,explode=false,name=queueId"` + // The item ids + ItemID []int64 `pathParam:"style=simple,explode=false,name=itemId"` +} + +func (r RestartProcessingDownloadQueueItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RestartProcessingDownloadQueueItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, []string{"queueId", "itemId"}); err != nil { + return err + } + return nil +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetAccepts() *components.Accepts { + if r == nil { + return nil + } + return r.Accepts +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetClientIdentifier() *string { + if r == nil { + return nil + } + return r.ClientIdentifier +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetProduct() *string { + if r == nil { + return nil + } + return r.Product +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetVersion() *string { + if r == nil { + return nil + } + return r.Version +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetPlatform() *string { + if r == nil { + return nil + } + return r.Platform +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetPlatformVersion() *string { + if r == nil { + return nil + } + return r.PlatformVersion +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetDevice() *string { + if r == nil { + return nil + } + return r.Device +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetModel() *string { + if r == nil { + return nil + } + return r.Model +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetDeviceVendor() *string { + if r == nil { + return nil + } + return r.DeviceVendor +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetDeviceName() *string { + if r == nil { + return nil + } + return r.DeviceName +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetMarketplace() *string { + if r == nil { + return nil + } + return r.Marketplace +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetQueueID() int64 { + if r == nil { + return 0 + } + return r.QueueID +} + +func (r *RestartProcessingDownloadQueueItemsRequest) GetItemID() []int64 { + if r == nil { + return []int64{} + } + return r.ItemID +} + +type RestartProcessingDownloadQueueItemsResponse 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 (r *RestartProcessingDownloadQueueItemsResponse) GetContentType() string { + if r == nil { + return "" + } + return r.ContentType +} + +func (r *RestartProcessingDownloadQueueItemsResponse) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + +func (r *RestartProcessingDownloadQueueItemsResponse) GetRawResponse() *http.Response { + if r == nil { + return nil + } + return r.RawResponse +} diff --git a/models/operations/scan.go b/models/operations/scan.go new file mode 100644 index 0000000..8396860 --- /dev/null +++ b/models/operations/scan.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ScanGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s ScanGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ScanGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ScanGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *ScanGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *ScanGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *ScanGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *ScanGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *ScanGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *ScanGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *ScanGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *ScanGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *ScanGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *ScanGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type ScanRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` + // A valid source for the scan + Source *string `queryParam:"style=form,explode=true,name=source"` +} + +func (s ScanRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ScanRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (s *ScanRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *ScanRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *ScanRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *ScanRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *ScanRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *ScanRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *ScanRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *ScanRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *ScanRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *ScanRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *ScanRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *ScanRequest) GetDeviceID() int64 { + if s == nil { + return 0 + } + return s.DeviceID +} + +func (s *ScanRequest) GetSource() *string { + if s == nil { + return nil + } + return s.Source +} + +type ScanResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice + Headers map[string][]string +} + +func (s *ScanResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *ScanResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *ScanResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *ScanResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if s == nil { + return nil + } + return s.MediaContainerWithDevice +} + +func (s *ScanResponse) GetHeaders() map[string][]string { + if s == nil { + return map[string][]string{} + } + return s.Headers +} diff --git a/models/operations/searchhubs.go b/models/operations/searchhubs.go new file mode 100644 index 0000000..bee2212 --- /dev/null +++ b/models/operations/searchhubs.go @@ -0,0 +1,371 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SearchHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SearchHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SearchHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SearchHubsGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SearchHubsGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SearchHubsGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SearchHubsGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SearchHubsGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SearchHubsGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SearchHubsGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SearchHubsGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SearchHubsGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SearchHubsGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SearchHubsGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SearchHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 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 *int64 `queryParam:"style=form,explode=true,name=sectionId"` + // The number of items to return per hub. 3 if not specified + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` +} + +func (s SearchHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SearchHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"query"}); err != nil { + return err + } + return nil +} + +func (s *SearchHubsRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SearchHubsRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SearchHubsRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SearchHubsRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SearchHubsRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SearchHubsRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SearchHubsRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SearchHubsRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SearchHubsRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SearchHubsRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SearchHubsRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SearchHubsRequest) GetQuery() string { + if s == nil { + return "" + } + return s.Query +} + +func (s *SearchHubsRequest) GetSectionID() *int64 { + if s == nil { + return nil + } + return s.SectionID +} + +func (s *SearchHubsRequest) GetLimit() *int64 { + if s == nil { + return nil + } + return s.Limit +} + +// SearchHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type SearchHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (s *SearchHubsMediaContainer) GetIdentifier() *string { + if s == nil { + return nil + } + return s.Identifier +} + +func (s *SearchHubsMediaContainer) GetOffset() *int64 { + if s == nil { + return nil + } + return s.Offset +} + +func (s *SearchHubsMediaContainer) GetSize() *int64 { + if s == nil { + return nil + } + return s.Size +} + +func (s *SearchHubsMediaContainer) GetTotalSize() *int64 { + if s == nil { + return nil + } + return s.TotalSize +} + +func (s *SearchHubsMediaContainer) GetHub() []components.Hub { + if s == nil { + return nil + } + return s.Hub +} + +// SearchHubsResponseBody - OK +type SearchHubsResponseBody struct { + MediaContainer *SearchHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (s *SearchHubsResponseBody) GetMediaContainer() *SearchHubsMediaContainer { + if s == nil { + return nil + } + return s.MediaContainer +} + +type SearchHubsResponse 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 + // OK + Object *SearchHubsResponseBody + Headers map[string][]string +} + +func (s *SearchHubsResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SearchHubsResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SearchHubsResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *SearchHubsResponse) GetObject() *SearchHubsResponseBody { + if s == nil { + return nil + } + return s.Object +} + +func (s *SearchHubsResponse) GetHeaders() map[string][]string { + if s == nil { + return map[string][]string{} + } + return s.Headers +} diff --git a/models/operations/setchannelmap.go b/models/operations/setchannelmap.go new file mode 100644 index 0000000..e6e296f --- /dev/null +++ b/models/operations/setchannelmap.go @@ -0,0 +1,318 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetChannelmapGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetChannelmapGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetChannelmapGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetChannelmapGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetChannelmapGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetChannelmapGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetChannelmapGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetChannelmapGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetChannelmapGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetChannelmapGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetChannelmapGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetChannelmapGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetChannelmapGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetChannelmapGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +// ChannelMapping - The mapping of changes, passed as a map of device channel to lineup VCN. +type ChannelMapping struct { +} + +// ChannelMappingByKey - The mapping of changes, passed as a map of device channel to lineup key. +type ChannelMappingByKey struct { +} + +type SetChannelmapRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` + // The mapping of changes, passed as a map of device channel to lineup VCN. + ChannelMapping *ChannelMapping `queryParam:"style=deepObject,explode=true,name=channelMapping"` + // The mapping of changes, passed as a map of device channel to lineup key. + ChannelMappingByKey *ChannelMappingByKey `queryParam:"style=deepObject,explode=true,name=channelMappingByKey"` + // The channels which are enabled. + ChannelsEnabled []string `queryParam:"style=form,explode=true,name=channelsEnabled"` +} + +func (s SetChannelmapRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetChannelmapRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (s *SetChannelmapRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetChannelmapRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetChannelmapRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetChannelmapRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetChannelmapRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetChannelmapRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetChannelmapRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetChannelmapRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetChannelmapRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetChannelmapRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetChannelmapRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetChannelmapRequest) GetDeviceID() int64 { + if s == nil { + return 0 + } + return s.DeviceID +} + +func (s *SetChannelmapRequest) GetChannelMapping() *ChannelMapping { + if s == nil { + return nil + } + return s.ChannelMapping +} + +func (s *SetChannelmapRequest) GetChannelMappingByKey() *ChannelMappingByKey { + if s == nil { + return nil + } + return s.ChannelMappingByKey +} + +func (s *SetChannelmapRequest) GetChannelsEnabled() []string { + if s == nil { + return nil + } + return s.ChannelsEnabled +} + +type SetChannelmapResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice +} + +func (s *SetChannelmapResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetChannelmapResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetChannelmapResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *SetChannelmapResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if s == nil { + return nil + } + return s.MediaContainerWithDevice +} diff --git a/models/operations/setdevicepreferences.go b/models/operations/setdevicepreferences.go new file mode 100644 index 0000000..c6a5f06 --- /dev/null +++ b/models/operations/setdevicepreferences.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetDevicePreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetDevicePreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetDevicePreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetDevicePreferencesGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetDevicePreferencesGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetDevicePreferencesGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetDevicePreferencesGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetDevicePreferencesGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetDevicePreferencesGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetDevicePreferencesGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetDevicePreferencesGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetDevicePreferencesGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetDevicePreferencesGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetDevicePreferencesGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SetDevicePreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` + // The preference names and values. + Name *string `queryParam:"style=form,explode=true,name=name"` +} + +func (s SetDevicePreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetDevicePreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (s *SetDevicePreferencesRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetDevicePreferencesRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetDevicePreferencesRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetDevicePreferencesRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetDevicePreferencesRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetDevicePreferencesRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetDevicePreferencesRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetDevicePreferencesRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetDevicePreferencesRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetDevicePreferencesRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetDevicePreferencesRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetDevicePreferencesRequest) GetDeviceID() int64 { + if s == nil { + return 0 + } + return s.DeviceID +} + +func (s *SetDevicePreferencesRequest) GetName() *string { + if s == nil { + return nil + } + return s.Name +} + +type SetDevicePreferencesResponse 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 (s *SetDevicePreferencesResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetDevicePreferencesResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetDevicePreferencesResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setdvrpreferences.go b/models/operations/setdvrpreferences.go new file mode 100644 index 0000000..d528597 --- /dev/null +++ b/models/operations/setdvrpreferences.go @@ -0,0 +1,425 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetDVRPreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetDVRPreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetDVRPreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetDVRPreferencesGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetDVRPreferencesGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetDVRPreferencesGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetDVRPreferencesGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetDVRPreferencesGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetDVRPreferencesGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetDVRPreferencesGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetDVRPreferencesGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetDVRPreferencesGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetDVRPreferencesGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetDVRPreferencesGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SetDVRPreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` + // Set the `name` preference to the provided value + Name *string `queryParam:"style=form,explode=true,name=name"` +} + +func (s SetDVRPreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetDVRPreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"dvrId"}); err != nil { + return err + } + return nil +} + +func (s *SetDVRPreferencesRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetDVRPreferencesRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetDVRPreferencesRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetDVRPreferencesRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetDVRPreferencesRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetDVRPreferencesRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetDVRPreferencesRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetDVRPreferencesRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetDVRPreferencesRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetDVRPreferencesRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetDVRPreferencesRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetDVRPreferencesRequest) GetDvrID() int64 { + if s == nil { + return 0 + } + return s.DvrID +} + +func (s *SetDVRPreferencesRequest) GetName() *string { + if s == nil { + return nil + } + return s.Name +} + +// SetDVRPreferencesDVRsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type SetDVRPreferencesDVRsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + // A status indicator. If present and non-zero, indicates an error + Status *int64 `json:"status,omitempty"` +} + +func (s *SetDVRPreferencesDVRsMediaContainer) GetIdentifier() *string { + if s == nil { + return nil + } + return s.Identifier +} + +func (s *SetDVRPreferencesDVRsMediaContainer) GetOffset() *int64 { + if s == nil { + return nil + } + return s.Offset +} + +func (s *SetDVRPreferencesDVRsMediaContainer) GetSize() *int64 { + if s == nil { + return nil + } + return s.Size +} + +func (s *SetDVRPreferencesDVRsMediaContainer) GetTotalSize() *int64 { + if s == nil { + return nil + } + return s.TotalSize +} + +func (s *SetDVRPreferencesDVRsMediaContainer) GetStatus() *int64 { + if s == nil { + return nil + } + return s.Status +} + +type SetDVRPreferencesDVR struct { + Device []components.Device `json:"Device,omitempty"` + Key *string `json:"key,omitempty"` + Language *string `json:"language,omitempty"` + Lineup *string `json:"lineup,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +func (s *SetDVRPreferencesDVR) GetDevice() []components.Device { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetDVRPreferencesDVR) GetKey() *string { + if s == nil { + return nil + } + return s.Key +} + +func (s *SetDVRPreferencesDVR) GetLanguage() *string { + if s == nil { + return nil + } + return s.Language +} + +func (s *SetDVRPreferencesDVR) GetLineup() *string { + if s == nil { + return nil + } + return s.Lineup +} + +func (s *SetDVRPreferencesDVR) GetUUID() *string { + if s == nil { + return nil + } + return s.UUID +} + +type SetDVRPreferencesMediaContainer struct { + MediaContainer *SetDVRPreferencesDVRsMediaContainer `json:"MediaContainer,omitempty"` + Dvr []SetDVRPreferencesDVR `json:"DVR,omitempty"` +} + +func (s *SetDVRPreferencesMediaContainer) GetMediaContainer() *SetDVRPreferencesDVRsMediaContainer { + if s == nil { + return nil + } + return s.MediaContainer +} + +func (s *SetDVRPreferencesMediaContainer) GetDvr() []SetDVRPreferencesDVR { + if s == nil { + return nil + } + return s.Dvr +} + +// SetDVRPreferencesResponseBody - OK +type SetDVRPreferencesResponseBody struct { + MediaContainer *SetDVRPreferencesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (s *SetDVRPreferencesResponseBody) GetMediaContainer() *SetDVRPreferencesMediaContainer { + if s == nil { + return nil + } + return s.MediaContainer +} + +type SetDVRPreferencesResponse 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 + // OK + Object *SetDVRPreferencesResponseBody + Headers map[string][]string +} + +func (s *SetDVRPreferencesResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetDVRPreferencesResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetDVRPreferencesResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *SetDVRPreferencesResponse) GetObject() *SetDVRPreferencesResponseBody { + if s == nil { + return nil + } + return s.Object +} + +func (s *SetDVRPreferencesResponse) GetHeaders() map[string][]string { + if s == nil { + return map[string][]string{} + } + return s.Headers +} diff --git a/models/operations/setitemartwork.go b/models/operations/setitemartwork.go new file mode 100644 index 0000000..c860345 --- /dev/null +++ b/models/operations/setitemartwork.go @@ -0,0 +1,330 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetItemArtworkGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetItemArtworkGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetItemArtworkGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetItemArtworkGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetItemArtworkGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetItemArtworkGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetItemArtworkGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetItemArtworkGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetItemArtworkGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetItemArtworkGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetItemArtworkGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetItemArtworkGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetItemArtworkGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetItemArtworkGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type Element string + +const ( + ElementThumb Element = "thumb" + ElementArt Element = "art" + ElementClearLogo Element = "clearLogo" + ElementBanner Element = "banner" + ElementPoster Element = "poster" + ElementTheme Element = "theme" +) + +func (e Element) ToPointer() *Element { + return &e +} +func (e *Element) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "thumb": + fallthrough + case "art": + fallthrough + case "clearLogo": + fallthrough + case "banner": + fallthrough + case "poster": + fallthrough + case "theme": + *e = Element(v) + return nil + default: + return fmt.Errorf("invalid value for Element: %v", v) + } +} + +type SetItemArtworkRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Element Element `pathParam:"style=simple,explode=false,name=element"` + // The url of the new asset. If not provided, the binary of the asset must be provided in the post body. + URL *string `queryParam:"style=form,explode=true,name=url"` +} + +func (s SetItemArtworkRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetItemArtworkRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"ids", "element"}); err != nil { + return err + } + return nil +} + +func (s *SetItemArtworkRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetItemArtworkRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetItemArtworkRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetItemArtworkRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetItemArtworkRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetItemArtworkRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetItemArtworkRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetItemArtworkRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetItemArtworkRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetItemArtworkRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetItemArtworkRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetItemArtworkRequest) GetIds() string { + if s == nil { + return "" + } + return s.Ids +} + +func (s *SetItemArtworkRequest) GetElement() Element { + if s == nil { + return Element("") + } + return s.Element +} + +func (s *SetItemArtworkRequest) GetURL() *string { + if s == nil { + return nil + } + return s.URL +} + +type SetItemArtworkResponse 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 (s *SetItemArtworkResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetItemArtworkResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetItemArtworkResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setitempreferences.go b/models/operations/setitempreferences.go new file mode 100644 index 0000000..51610f3 --- /dev/null +++ b/models/operations/setitempreferences.go @@ -0,0 +1,284 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetItemPreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetItemPreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetItemPreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetItemPreferencesGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetItemPreferencesGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetItemPreferencesGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetItemPreferencesGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetItemPreferencesGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetItemPreferencesGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetItemPreferencesGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetItemPreferencesGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetItemPreferencesGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetItemPreferencesGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetItemPreferencesGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type QueryParamArgs struct { +} + +type SetItemPreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Args *QueryParamArgs `queryParam:"style=form,explode=true,name=args"` +} + +func (s SetItemPreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetItemPreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (s *SetItemPreferencesRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetItemPreferencesRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetItemPreferencesRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetItemPreferencesRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetItemPreferencesRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetItemPreferencesRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetItemPreferencesRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetItemPreferencesRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetItemPreferencesRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetItemPreferencesRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetItemPreferencesRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetItemPreferencesRequest) GetIds() string { + if s == nil { + return "" + } + return s.Ids +} + +func (s *SetItemPreferencesRequest) GetArgs() *QueryParamArgs { + if s == nil { + return nil + } + return s.Args +} + +type SetItemPreferencesResponse 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 (s *SetItemPreferencesResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetItemPreferencesResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetItemPreferencesResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setpreferences.go b/models/operations/setpreferences.go new file mode 100644 index 0000000..af453cf --- /dev/null +++ b/models/operations/setpreferences.go @@ -0,0 +1,276 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetPreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetPreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetPreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetPreferencesGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetPreferencesGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetPreferencesGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetPreferencesGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetPreferencesGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetPreferencesGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetPreferencesGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetPreferencesGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetPreferencesGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetPreferencesGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetPreferencesGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type Prefs struct { +} + +type SetPreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Prefs Prefs `queryParam:"style=form,explode=true,name=prefs"` +} + +func (s SetPreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetPreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"prefs"}); err != nil { + return err + } + return nil +} + +func (s *SetPreferencesRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetPreferencesRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetPreferencesRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetPreferencesRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetPreferencesRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetPreferencesRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetPreferencesRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetPreferencesRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetPreferencesRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetPreferencesRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetPreferencesRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetPreferencesRequest) GetPrefs() Prefs { + if s == nil { + return Prefs{} + } + return s.Prefs +} + +type SetPreferencesResponse 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 (s *SetPreferencesResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetPreferencesResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetPreferencesResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setrating.go b/models/operations/setrating.go new file mode 100644 index 0000000..0ec1d5c --- /dev/null +++ b/models/operations/setrating.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetRatingGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetRatingGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetRatingGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetRatingGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetRatingGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetRatingGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetRatingGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetRatingGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetRatingGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetRatingGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetRatingGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetRatingGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetRatingGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetRatingGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SetRatingRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library` + Identifier string `queryParam:"style=form,explode=true,name=identifier"` + // The key of the item to rate. This is the `ratingKey` found in metadata items + Key string `queryParam:"style=form,explode=true,name=key"` + // The rating to give the item. + Rating float64 `queryParam:"style=form,explode=true,name=rating"` + // The time when the rating occurred. If not present, interpreted as now. + RatedAt *int64 `queryParam:"style=form,explode=true,name=ratedAt"` +} + +func (s SetRatingRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetRatingRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"identifier", "key", "rating"}); err != nil { + return err + } + return nil +} + +func (s *SetRatingRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetRatingRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetRatingRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetRatingRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetRatingRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetRatingRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetRatingRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetRatingRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetRatingRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetRatingRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetRatingRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetRatingRequest) GetIdentifier() string { + if s == nil { + return "" + } + return s.Identifier +} + +func (s *SetRatingRequest) GetKey() string { + if s == nil { + return "" + } + return s.Key +} + +func (s *SetRatingRequest) GetRating() float64 { + if s == nil { + return 0.0 + } + return s.Rating +} + +func (s *SetRatingRequest) GetRatedAt() *int64 { + if s == nil { + return nil + } + return s.RatedAt +} + +type SetRatingResponse 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 (s *SetRatingResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetRatingResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetRatingResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setsectionpreferences.go b/models/operations/setsectionpreferences.go new file mode 100644 index 0000000..7fa8189 --- /dev/null +++ b/models/operations/setsectionpreferences.go @@ -0,0 +1,285 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetSectionPreferencesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetSectionPreferencesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetSectionPreferencesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetSectionPreferencesGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetSectionPreferencesGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetSectionPreferencesGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetSectionPreferencesGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetSectionPreferencesGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetSectionPreferencesGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetSectionPreferencesGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetSectionPreferencesGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetSectionPreferencesGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetSectionPreferencesGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetSectionPreferencesGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SetSectionPreferencesQueryParamPrefs struct { +} + +type SetSectionPreferencesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + Prefs SetSectionPreferencesQueryParamPrefs `queryParam:"style=form,explode=true,name=prefs"` +} + +func (s SetSectionPreferencesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetSectionPreferencesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"sectionId", "prefs"}); err != nil { + return err + } + return nil +} + +func (s *SetSectionPreferencesRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetSectionPreferencesRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetSectionPreferencesRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetSectionPreferencesRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetSectionPreferencesRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetSectionPreferencesRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetSectionPreferencesRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetSectionPreferencesRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetSectionPreferencesRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetSectionPreferencesRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetSectionPreferencesRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetSectionPreferencesRequest) GetSectionID() int64 { + if s == nil { + return 0 + } + return s.SectionID +} + +func (s *SetSectionPreferencesRequest) GetPrefs() SetSectionPreferencesQueryParamPrefs { + if s == nil { + return SetSectionPreferencesQueryParamPrefs{} + } + return s.Prefs +} + +type SetSectionPreferencesResponse 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 (s *SetSectionPreferencesResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetSectionPreferencesResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetSectionPreferencesResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setstreamoffset.go b/models/operations/setstreamoffset.go new file mode 100644 index 0000000..6efffe6 --- /dev/null +++ b/models/operations/setstreamoffset.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetStreamOffsetGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetStreamOffsetGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetStreamOffsetGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetStreamOffsetGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetStreamOffsetGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetStreamOffsetGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetStreamOffsetGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetStreamOffsetGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetStreamOffsetGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetStreamOffsetGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetStreamOffsetGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetStreamOffsetGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetStreamOffsetGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetStreamOffsetGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SetStreamOffsetRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the stream + StreamID int64 `pathParam:"style=simple,explode=false,name=streamId"` + // This is not a part of this endpoint but documented here to satisfy OpenAPI + Ext string `pathParam:"style=simple,explode=false,name=ext"` + // The offest in ms + Offset *int64 `queryParam:"style=form,explode=true,name=offset"` +} + +func (s SetStreamOffsetRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetStreamOffsetRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"streamId", "ext"}); err != nil { + return err + } + return nil +} + +func (s *SetStreamOffsetRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetStreamOffsetRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetStreamOffsetRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetStreamOffsetRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetStreamOffsetRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetStreamOffsetRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetStreamOffsetRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetStreamOffsetRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetStreamOffsetRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetStreamOffsetRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetStreamOffsetRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetStreamOffsetRequest) GetStreamID() int64 { + if s == nil { + return 0 + } + return s.StreamID +} + +func (s *SetStreamOffsetRequest) GetExt() string { + if s == nil { + return "" + } + return s.Ext +} + +func (s *SetStreamOffsetRequest) GetOffset() *int64 { + if s == nil { + return nil + } + return s.Offset +} + +type SetStreamOffsetResponse 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 (s *SetStreamOffsetResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetStreamOffsetResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetStreamOffsetResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/setstreamselection.go b/models/operations/setstreamselection.go new file mode 100644 index 0000000..0f80123 --- /dev/null +++ b/models/operations/setstreamselection.go @@ -0,0 +1,301 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SetStreamSelectionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SetStreamSelectionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetStreamSelectionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SetStreamSelectionGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetStreamSelectionGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetStreamSelectionGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetStreamSelectionGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetStreamSelectionGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetStreamSelectionGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetStreamSelectionGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetStreamSelectionGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetStreamSelectionGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetStreamSelectionGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetStreamSelectionGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SetStreamSelectionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the part to select streams on + PartID int64 `pathParam:"style=simple,explode=false,name=partId"` + // The id of the audio stream to select in this part + AudioStreamID *int64 `queryParam:"style=form,explode=true,name=audioStreamID"` + // The id of the subtitle stream to select in this part. Specify 0 to select no subtitle + SubtitleStreamID *int64 `queryParam:"style=form,explode=true,name=subtitleStreamID"` + // Perform the same for all parts of this media selecting similar streams in each + AllParts *components.BoolInt `queryParam:"style=form,explode=true,name=allParts"` +} + +func (s SetStreamSelectionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SetStreamSelectionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"partId"}); err != nil { + return err + } + return nil +} + +func (s *SetStreamSelectionRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SetStreamSelectionRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SetStreamSelectionRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SetStreamSelectionRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SetStreamSelectionRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SetStreamSelectionRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SetStreamSelectionRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SetStreamSelectionRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SetStreamSelectionRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SetStreamSelectionRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SetStreamSelectionRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SetStreamSelectionRequest) GetPartID() int64 { + if s == nil { + return 0 + } + return s.PartID +} + +func (s *SetStreamSelectionRequest) GetAudioStreamID() *int64 { + if s == nil { + return nil + } + return s.AudioStreamID +} + +func (s *SetStreamSelectionRequest) GetSubtitleStreamID() *int64 { + if s == nil { + return nil + } + return s.SubtitleStreamID +} + +func (s *SetStreamSelectionRequest) GetAllParts() *components.BoolInt { + if s == nil { + return nil + } + return s.AllParts +} + +type SetStreamSelectionResponse 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 (s *SetStreamSelectionResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SetStreamSelectionResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SetStreamSelectionResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/shuffle.go b/models/operations/shuffle.go new file mode 100644 index 0000000..4342aa0 --- /dev/null +++ b/models/operations/shuffle.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type ShuffleGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s ShuffleGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShuffleGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShuffleGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *ShuffleGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *ShuffleGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *ShuffleGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *ShuffleGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *ShuffleGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *ShuffleGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *ShuffleGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *ShuffleGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *ShuffleGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *ShuffleGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type ShuffleRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` +} + +func (s ShuffleRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShuffleRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"playQueueId"}); err != nil { + return err + } + return nil +} + +func (s *ShuffleRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *ShuffleRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *ShuffleRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *ShuffleRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *ShuffleRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *ShuffleRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *ShuffleRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *ShuffleRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *ShuffleRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *ShuffleRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *ShuffleRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *ShuffleRequest) GetPlayQueueID() int64 { + if s == nil { + return 0 + } + return s.PlayQueueID +} + +type ShuffleResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (s *ShuffleResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *ShuffleResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *ShuffleResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *ShuffleResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if s == nil { + return nil + } + return s.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/splititem.go b/models/operations/splititem.go new file mode 100644 index 0000000..32cff79 --- /dev/null +++ b/models/operations/splititem.go @@ -0,0 +1,273 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type SplitItemGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s SplitItemGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SplitItemGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SplitItemGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SplitItemGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SplitItemGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SplitItemGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SplitItemGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SplitItemGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SplitItemGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SplitItemGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SplitItemGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SplitItemGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SplitItemGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type SplitItemRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (s SplitItemRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SplitItemRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (s *SplitItemRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *SplitItemRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *SplitItemRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *SplitItemRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *SplitItemRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *SplitItemRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *SplitItemRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *SplitItemRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SplitItemRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *SplitItemRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *SplitItemRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *SplitItemRequest) GetIds() string { + if s == nil { + return "" + } + return s.Ids +} + +type SplitItemResponse 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 (s *SplitItemResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *SplitItemResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *SplitItemResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/startalltasks.go b/models/operations/startalltasks.go deleted file mode 100644 index c2af97c..0000000 --- a/models/operations/startalltasks.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (s *StartAllTasksResponse) GetContentType() string { - if s == nil { - return "" - } - return s.ContentType -} - -func (s *StartAllTasksResponse) GetStatusCode() int { - if s == nil { - return 0 - } - return s.StatusCode -} - -func (s *StartAllTasksResponse) GetRawResponse() *http.Response { - if s == nil { - return nil - } - return s.RawResponse -} diff --git a/models/operations/startanalysis.go b/models/operations/startanalysis.go new file mode 100644 index 0000000..51b51fd --- /dev/null +++ b/models/operations/startanalysis.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type StartAnalysisGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StartAnalysisGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartAnalysisGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StartAnalysisGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartAnalysisGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartAnalysisGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartAnalysisGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartAnalysisGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartAnalysisGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartAnalysisGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartAnalysisGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartAnalysisGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartAnalysisGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartAnalysisGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type StartAnalysisRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Section identifier + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (s StartAnalysisRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartAnalysisRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (s *StartAnalysisRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartAnalysisRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartAnalysisRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartAnalysisRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartAnalysisRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartAnalysisRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartAnalysisRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartAnalysisRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartAnalysisRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartAnalysisRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartAnalysisRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StartAnalysisRequest) GetSectionID() int64 { + if s == nil { + return 0 + } + return s.SectionID +} + +type StartAnalysisResponse 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 (s *StartAnalysisResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StartAnalysisResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StartAnalysisResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/startbifgeneration.go b/models/operations/startbifgeneration.go new file mode 100644 index 0000000..3c94c91 --- /dev/null +++ b/models/operations/startbifgeneration.go @@ -0,0 +1,281 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type StartBifGenerationGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StartBifGenerationGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartBifGenerationGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StartBifGenerationGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartBifGenerationGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartBifGenerationGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartBifGenerationGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartBifGenerationGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartBifGenerationGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartBifGenerationGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartBifGenerationGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartBifGenerationGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartBifGenerationGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartBifGenerationGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type StartBifGenerationRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Force *components.BoolInt `queryParam:"style=form,explode=true,name=force"` +} + +func (s StartBifGenerationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartBifGenerationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (s *StartBifGenerationRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartBifGenerationRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartBifGenerationRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartBifGenerationRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartBifGenerationRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartBifGenerationRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartBifGenerationRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartBifGenerationRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartBifGenerationRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartBifGenerationRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartBifGenerationRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StartBifGenerationRequest) GetIds() string { + if s == nil { + return "" + } + return s.Ids +} + +func (s *StartBifGenerationRequest) GetForce() *components.BoolInt { + if s == nil { + return nil + } + return s.Force +} + +type StartBifGenerationResponse 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 (s *StartBifGenerationResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StartBifGenerationResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StartBifGenerationResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/starttask.go b/models/operations/starttask.go index 35f1bc4..3c608eb 100644 --- a/models/operations/starttask.go +++ b/models/operations/starttask.go @@ -3,43 +3,333 @@ package operations import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -// TaskName - the name of the task to be started. -type TaskName string +type StartTaskGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StartTaskGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartTaskGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StartTaskGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartTaskGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartTaskGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartTaskGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartTaskGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartTaskGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartTaskGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartTaskGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartTaskGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartTaskGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartTaskGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +// PathParamTask - The task name +type PathParamTask 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" + PathParamTaskAutomaticUpdates PathParamTask = "AutomaticUpdates" + PathParamTaskBackupDatabase PathParamTask = "BackupDatabase" + PathParamTaskButlerTaskGenerateAdMarkers PathParamTask = "ButlerTaskGenerateAdMarkers" + PathParamTaskButlerTaskGenerateCreditsMarkers PathParamTask = "ButlerTaskGenerateCreditsMarkers" + PathParamTaskButlerTaskGenerateIntroMarkers PathParamTask = "ButlerTaskGenerateIntroMarkers" + PathParamTaskButlerTaskGenerateVoiceActivity PathParamTask = "ButlerTaskGenerateVoiceActivity" + PathParamTaskCleanOldBundles PathParamTask = "CleanOldBundles" + PathParamTaskCleanOldCacheFiles PathParamTask = "CleanOldCacheFiles" + PathParamTaskDeepMediaAnalysis PathParamTask = "DeepMediaAnalysis" + PathParamTaskGarbageCollectBlobs PathParamTask = "GarbageCollectBlobs" + PathParamTaskGarbageCollectLibraryMedia PathParamTask = "GarbageCollectLibraryMedia" + PathParamTaskGenerateBlurHashes PathParamTask = "GenerateBlurHashes" + PathParamTaskGenerateChapterThumbs PathParamTask = "GenerateChapterThumbs" + PathParamTaskGenerateMediaIndexFiles PathParamTask = "GenerateMediaIndexFiles" + PathParamTaskLoudnessAnalysis PathParamTask = "LoudnessAnalysis" + PathParamTaskMusicAnalysis PathParamTask = "MusicAnalysis" + PathParamTaskOptimizeDatabase PathParamTask = "OptimizeDatabase" + PathParamTaskRefreshEpgGuides PathParamTask = "RefreshEpgGuides" + PathParamTaskRefreshLibraries PathParamTask = "RefreshLibraries" + PathParamTaskRefreshLocalMedia PathParamTask = "RefreshLocalMedia" + PathParamTaskRefreshPeriodicMetadata PathParamTask = "RefreshPeriodicMetadata" + PathParamTaskUpgradeMediaAnalysis PathParamTask = "UpgradeMediaAnalysis" ) -func (e TaskName) ToPointer() *TaskName { +func (e PathParamTask) ToPointer() *PathParamTask { return &e } +func (e *PathParamTask) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AutomaticUpdates": + fallthrough + case "BackupDatabase": + fallthrough + case "ButlerTaskGenerateAdMarkers": + fallthrough + case "ButlerTaskGenerateCreditsMarkers": + fallthrough + case "ButlerTaskGenerateIntroMarkers": + fallthrough + case "ButlerTaskGenerateVoiceActivity": + fallthrough + case "CleanOldBundles": + fallthrough + case "CleanOldCacheFiles": + fallthrough + case "DeepMediaAnalysis": + fallthrough + case "GarbageCollectBlobs": + fallthrough + case "GarbageCollectLibraryMedia": + fallthrough + case "GenerateBlurHashes": + fallthrough + case "GenerateChapterThumbs": + fallthrough + case "GenerateMediaIndexFiles": + fallthrough + case "LoudnessAnalysis": + fallthrough + case "MusicAnalysis": + fallthrough + case "OptimizeDatabase": + fallthrough + case "RefreshEpgGuides": + fallthrough + case "RefreshLibraries": + fallthrough + case "RefreshLocalMedia": + fallthrough + case "RefreshPeriodicMetadata": + fallthrough + case "UpgradeMediaAnalysis": + *e = PathParamTask(v) + return nil + default: + return fmt.Errorf("invalid value for PathParamTask: %v", v) + } +} type StartTaskRequest struct { - // the name of the task to be started. - TaskName TaskName `pathParam:"style=simple,explode=false,name=taskName"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The task name + Task PathParamTask `pathParam:"style=simple,explode=false,name=task"` } -func (s *StartTaskRequest) GetTaskName() TaskName { - if s == nil { - return TaskName("") +func (s StartTaskRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartTaskRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"task"}); err != nil { + return err } - return s.TaskName + return nil +} + +func (s *StartTaskRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartTaskRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartTaskRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartTaskRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartTaskRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartTaskRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartTaskRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartTaskRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartTaskRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartTaskRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartTaskRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StartTaskRequest) GetTask() PathParamTask { + if s == nil { + return PathParamTask("") + } + return s.Task } type StartTaskResponse struct { diff --git a/models/operations/starttasks.go b/models/operations/starttasks.go new file mode 100644 index 0000000..956b1fc --- /dev/null +++ b/models/operations/starttasks.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type StartTasksResponse 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 (s *StartTasksResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StartTasksResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StartTasksResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/starttranscodesession.go b/models/operations/starttranscodesession.go new file mode 100644 index 0000000..6f6d53d --- /dev/null +++ b/models/operations/starttranscodesession.go @@ -0,0 +1,699 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type StartTranscodeSessionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StartTranscodeSessionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartTranscodeSessionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StartTranscodeSessionGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartTranscodeSessionGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartTranscodeSessionGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartTranscodeSessionGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartTranscodeSessionGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartTranscodeSessionGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartTranscodeSessionGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartTranscodeSessionGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartTranscodeSessionGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartTranscodeSessionGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartTranscodeSessionGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +// Extension +type Extension string + +const ( + ExtensionM3u8 Extension = "m3u8" + ExtensionMpd Extension = "mpd" +) + +func (e Extension) ToPointer() *Extension { + return &e +} +func (e *Extension) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "m3u8": + fallthrough + case "mpd": + *e = Extension(v) + return nil + default: + return fmt.Errorf("invalid value for Extension: %v", v) + } +} + +// StartTranscodeSessionQueryParamLocation - Network type of the client, can be used to help determine target bitrate. +type StartTranscodeSessionQueryParamLocation string + +const ( + StartTranscodeSessionQueryParamLocationLan StartTranscodeSessionQueryParamLocation = "lan" + StartTranscodeSessionQueryParamLocationWan StartTranscodeSessionQueryParamLocation = "wan" + StartTranscodeSessionQueryParamLocationCellular StartTranscodeSessionQueryParamLocation = "cellular" +) + +func (e StartTranscodeSessionQueryParamLocation) ToPointer() *StartTranscodeSessionQueryParamLocation { + return &e +} +func (e *StartTranscodeSessionQueryParamLocation) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "lan": + fallthrough + case "wan": + fallthrough + case "cellular": + *e = StartTranscodeSessionQueryParamLocation(v) + return nil + default: + return fmt.Errorf("invalid value for StartTranscodeSessionQueryParamLocation: %v", v) + } +} + +// StartTranscodeSessionQueryParamProtocol - Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) +type StartTranscodeSessionQueryParamProtocol string + +const ( + StartTranscodeSessionQueryParamProtocolHTTP StartTranscodeSessionQueryParamProtocol = "http" + StartTranscodeSessionQueryParamProtocolHls StartTranscodeSessionQueryParamProtocol = "hls" + StartTranscodeSessionQueryParamProtocolDash StartTranscodeSessionQueryParamProtocol = "dash" +) + +func (e StartTranscodeSessionQueryParamProtocol) ToPointer() *StartTranscodeSessionQueryParamProtocol { + return &e +} +func (e *StartTranscodeSessionQueryParamProtocol) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "http": + fallthrough + case "hls": + fallthrough + case "dash": + *e = StartTranscodeSessionQueryParamProtocol(v) + return nil + default: + return fmt.Errorf("invalid value for StartTranscodeSessionQueryParamProtocol: %v", v) + } +} + +// StartTranscodeSessionQueryParamSubtitles - Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream +type StartTranscodeSessionQueryParamSubtitles string + +const ( + StartTranscodeSessionQueryParamSubtitlesAuto StartTranscodeSessionQueryParamSubtitles = "auto" + StartTranscodeSessionQueryParamSubtitlesBurn StartTranscodeSessionQueryParamSubtitles = "burn" + StartTranscodeSessionQueryParamSubtitlesNone StartTranscodeSessionQueryParamSubtitles = "none" + StartTranscodeSessionQueryParamSubtitlesSidecar StartTranscodeSessionQueryParamSubtitles = "sidecar" + StartTranscodeSessionQueryParamSubtitlesEmbedded StartTranscodeSessionQueryParamSubtitles = "embedded" + StartTranscodeSessionQueryParamSubtitlesSegmented StartTranscodeSessionQueryParamSubtitles = "segmented" + StartTranscodeSessionQueryParamSubtitlesUnknown StartTranscodeSessionQueryParamSubtitles = "unknown" +) + +func (e StartTranscodeSessionQueryParamSubtitles) ToPointer() *StartTranscodeSessionQueryParamSubtitles { + return &e +} +func (e *StartTranscodeSessionQueryParamSubtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + fallthrough + case "burn": + fallthrough + case "none": + fallthrough + case "sidecar": + fallthrough + case "embedded": + fallthrough + case "segmented": + fallthrough + case "unknown": + *e = StartTranscodeSessionQueryParamSubtitles(v) + return nil + default: + return fmt.Errorf("invalid value for StartTranscodeSessionQueryParamSubtitles: %v", v) + } +} + +type StartTranscodeSessionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Type of transcode media + TranscodeType components.TranscodeType `pathParam:"style=simple,explode=false,name=transcodeType"` + // Transcode session UUID + TranscodeSessionID *string `queryParam:"style=form,explode=true,name=transcodeSessionId"` + // Extension + // + Extension Extension `pathParam:"style=simple,explode=false,name=extension"` + // Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost + // + AdvancedSubtitles *components.AdvancedSubtitles `queryParam:"style=form,explode=true,name=advancedSubtitles"` + // Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) + AudioBoost *int64 `queryParam:"style=form,explode=true,name=audioBoost"` + // Target video number of audio channels. + AudioChannelCount *int64 `queryParam:"style=form,explode=true,name=audioChannelCount"` + // Indicates the client supports ABR. + AutoAdjustQuality *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustQuality"` + // Indicates if the server should adjust subtitles based on Voice Activity Data. + AutoAdjustSubtitle *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustSubtitle"` + // Indicates the client supports direct playing the indicated content. + DirectPlay *components.BoolInt `queryParam:"style=form,explode=true,name=directPlay"` + // Indicates the client supports direct streaming the video of the indicated content. + DirectStream *components.BoolInt `queryParam:"style=form,explode=true,name=directStream"` + // Indicates the client supports direct streaming the audio of the indicated content. + DirectStreamAudio *components.BoolInt `queryParam:"style=form,explode=true,name=directStreamAudio"` + // Indicates if resolution should be adjusted for orientation. + DisableResolutionRotation *components.BoolInt `queryParam:"style=form,explode=true,name=disableResolutionRotation"` + // Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 + HasMDE *components.BoolInt `queryParam:"style=form,explode=true,name=hasMDE"` + // Network type of the client, can be used to help determine target bitrate. + Location *StartTranscodeSessionQueryParamLocation `queryParam:"style=form,explode=true,name=location"` + // Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. + MediaBufferSize *int64 `queryParam:"style=form,explode=true,name=mediaBufferSize"` + // Index of the media to transcode. -1 or not specified indicates let the server choose. + MediaIndex *int64 `queryParam:"style=form,explode=true,name=mediaIndex"` + // Target bitrate for audio only files (in kbps, used to transcode). + MusicBitrate *int64 `queryParam:"style=form,explode=true,name=musicBitrate"` + // Offset from the start of the media (in seconds). + Offset *float64 `queryParam:"style=form,explode=true,name=offset"` + // Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode + PartIndex *int64 `queryParam:"style=form,explode=true,name=partIndex"` + // Internal PMS path of the media to transcode. + Path *string `queryParam:"style=form,explode=true,name=path"` + // Maximum bitrate (in kbps) to use in ABR. + PeakBitrate *int64 `queryParam:"style=form,explode=true,name=peakBitrate"` + // Target photo resolution. + PhotoResolution *string `queryParam:"style=form,explode=true,name=photoResolution"` + // Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + // + Protocol *StartTranscodeSessionQueryParamProtocol `queryParam:"style=form,explode=true,name=protocol"` + // Number of seconds to include in each transcoded segment + SecondsPerSegment *int64 `queryParam:"style=form,explode=true,name=secondsPerSegment"` + // Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) + SubtitleSize *int64 `queryParam:"style=form,explode=true,name=subtitleSize"` + // Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + // + Subtitles *StartTranscodeSessionQueryParamSubtitles `queryParam:"style=form,explode=true,name=subtitles"` + // Target video bitrate (in kbps). + VideoBitrate *int64 `queryParam:"style=form,explode=true,name=videoBitrate"` + // Target photo quality. + VideoQuality *int64 `queryParam:"style=form,explode=true,name=videoQuality"` + // Target maximum video resolution. + VideoResolution *string `queryParam:"style=form,explode=true,name=videoResolution"` + // See [Profile Augmentations](#section/API-Info/Profile-Augmentations) . + XPlexClientProfileExtra *string `header:"style=simple,explode=false,name=X-Plex-Client-Profile-Extra"` + // Which built in Client Profile to use in the decision. Generally should only be used to specify the Generic profile. + XPlexClientProfileName *string `header:"style=simple,explode=false,name=X-Plex-Client-Profile-Name"` + // Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) + XPlexSessionIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Session-Identifier"` +} + +func (s StartTranscodeSessionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StartTranscodeSessionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"transcodeType", "extension"}); err != nil { + return err + } + return nil +} + +func (s *StartTranscodeSessionRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StartTranscodeSessionRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StartTranscodeSessionRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StartTranscodeSessionRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StartTranscodeSessionRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StartTranscodeSessionRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StartTranscodeSessionRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StartTranscodeSessionRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StartTranscodeSessionRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StartTranscodeSessionRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StartTranscodeSessionRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StartTranscodeSessionRequest) GetTranscodeType() components.TranscodeType { + if s == nil { + return components.TranscodeType("") + } + return s.TranscodeType +} + +func (s *StartTranscodeSessionRequest) GetTranscodeSessionID() *string { + if s == nil { + return nil + } + return s.TranscodeSessionID +} + +func (s *StartTranscodeSessionRequest) GetExtension() Extension { + if s == nil { + return Extension("") + } + return s.Extension +} + +func (s *StartTranscodeSessionRequest) GetAdvancedSubtitles() *components.AdvancedSubtitles { + if s == nil { + return nil + } + return s.AdvancedSubtitles +} + +func (s *StartTranscodeSessionRequest) GetAudioBoost() *int64 { + if s == nil { + return nil + } + return s.AudioBoost +} + +func (s *StartTranscodeSessionRequest) GetAudioChannelCount() *int64 { + if s == nil { + return nil + } + return s.AudioChannelCount +} + +func (s *StartTranscodeSessionRequest) GetAutoAdjustQuality() *components.BoolInt { + if s == nil { + return nil + } + return s.AutoAdjustQuality +} + +func (s *StartTranscodeSessionRequest) GetAutoAdjustSubtitle() *components.BoolInt { + if s == nil { + return nil + } + return s.AutoAdjustSubtitle +} + +func (s *StartTranscodeSessionRequest) GetDirectPlay() *components.BoolInt { + if s == nil { + return nil + } + return s.DirectPlay +} + +func (s *StartTranscodeSessionRequest) GetDirectStream() *components.BoolInt { + if s == nil { + return nil + } + return s.DirectStream +} + +func (s *StartTranscodeSessionRequest) GetDirectStreamAudio() *components.BoolInt { + if s == nil { + return nil + } + return s.DirectStreamAudio +} + +func (s *StartTranscodeSessionRequest) GetDisableResolutionRotation() *components.BoolInt { + if s == nil { + return nil + } + return s.DisableResolutionRotation +} + +func (s *StartTranscodeSessionRequest) GetHasMDE() *components.BoolInt { + if s == nil { + return nil + } + return s.HasMDE +} + +func (s *StartTranscodeSessionRequest) GetLocation() *StartTranscodeSessionQueryParamLocation { + if s == nil { + return nil + } + return s.Location +} + +func (s *StartTranscodeSessionRequest) GetMediaBufferSize() *int64 { + if s == nil { + return nil + } + return s.MediaBufferSize +} + +func (s *StartTranscodeSessionRequest) GetMediaIndex() *int64 { + if s == nil { + return nil + } + return s.MediaIndex +} + +func (s *StartTranscodeSessionRequest) GetMusicBitrate() *int64 { + if s == nil { + return nil + } + return s.MusicBitrate +} + +func (s *StartTranscodeSessionRequest) GetOffset() *float64 { + if s == nil { + return nil + } + return s.Offset +} + +func (s *StartTranscodeSessionRequest) GetPartIndex() *int64 { + if s == nil { + return nil + } + return s.PartIndex +} + +func (s *StartTranscodeSessionRequest) GetPath() *string { + if s == nil { + return nil + } + return s.Path +} + +func (s *StartTranscodeSessionRequest) GetPeakBitrate() *int64 { + if s == nil { + return nil + } + return s.PeakBitrate +} + +func (s *StartTranscodeSessionRequest) GetPhotoResolution() *string { + if s == nil { + return nil + } + return s.PhotoResolution +} + +func (s *StartTranscodeSessionRequest) GetProtocol() *StartTranscodeSessionQueryParamProtocol { + if s == nil { + return nil + } + return s.Protocol +} + +func (s *StartTranscodeSessionRequest) GetSecondsPerSegment() *int64 { + if s == nil { + return nil + } + return s.SecondsPerSegment +} + +func (s *StartTranscodeSessionRequest) GetSubtitleSize() *int64 { + if s == nil { + return nil + } + return s.SubtitleSize +} + +func (s *StartTranscodeSessionRequest) GetSubtitles() *StartTranscodeSessionQueryParamSubtitles { + if s == nil { + return nil + } + return s.Subtitles +} + +func (s *StartTranscodeSessionRequest) GetVideoBitrate() *int64 { + if s == nil { + return nil + } + return s.VideoBitrate +} + +func (s *StartTranscodeSessionRequest) GetVideoQuality() *int64 { + if s == nil { + return nil + } + return s.VideoQuality +} + +func (s *StartTranscodeSessionRequest) GetVideoResolution() *string { + if s == nil { + return nil + } + return s.VideoResolution +} + +func (s *StartTranscodeSessionRequest) GetXPlexClientProfileExtra() *string { + if s == nil { + return nil + } + return s.XPlexClientProfileExtra +} + +func (s *StartTranscodeSessionRequest) GetXPlexClientProfileName() *string { + if s == nil { + return nil + } + return s.XPlexClientProfileName +} + +func (s *StartTranscodeSessionRequest) GetXPlexSessionIdentifier() *string { + if s == nil { + return nil + } + return s.XPlexSessionIdentifier +} + +type StartTranscodeSessionResponse 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 + // MPD file (see ISO/IEC 23009-1:2022), m3u8 file (see RFC 8216), or binary http stream + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser +} + +func (s *StartTranscodeSessionResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StartTranscodeSessionResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StartTranscodeSessionResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *StartTranscodeSessionResponse) GetResponseStream() io.ReadCloser { + if s == nil { + return nil + } + return s.ResponseStream +} diff --git a/models/operations/startuniversaltranscode.go b/models/operations/startuniversaltranscode.go deleted file mode 100644 index 477d45b..0000000 --- a/models/operations/startuniversaltranscode.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (s *StartUniversalTranscodeRequest) GetHasMDE() float64 { - if s == nil { - return 0.0 - } - return s.HasMDE -} - -func (s *StartUniversalTranscodeRequest) GetPath() string { - if s == nil { - return "" - } - return s.Path -} - -func (s *StartUniversalTranscodeRequest) GetMediaIndex() float64 { - if s == nil { - return 0.0 - } - return s.MediaIndex -} - -func (s *StartUniversalTranscodeRequest) GetPartIndex() float64 { - if s == nil { - return 0.0 - } - return s.PartIndex -} - -func (s *StartUniversalTranscodeRequest) GetProtocol() string { - if s == nil { - return "" - } - return s.Protocol -} - -func (s *StartUniversalTranscodeRequest) GetFastSeek() *float64 { - if s == nil { - return nil - } - return s.FastSeek -} - -func (s *StartUniversalTranscodeRequest) GetDirectPlay() *float64 { - if s == nil { - return nil - } - return s.DirectPlay -} - -func (s *StartUniversalTranscodeRequest) GetDirectStream() *float64 { - if s == nil { - return nil - } - return s.DirectStream -} - -func (s *StartUniversalTranscodeRequest) GetSubtitleSize() *float64 { - if s == nil { - return nil - } - return s.SubtitleSize -} - -func (s *StartUniversalTranscodeRequest) GetSubtites() *string { - if s == nil { - return nil - } - return s.Subtites -} - -func (s *StartUniversalTranscodeRequest) GetAudioBoost() *float64 { - if s == nil { - return nil - } - return s.AudioBoost -} - -func (s *StartUniversalTranscodeRequest) GetLocation() *string { - if s == nil { - return nil - } - return s.Location -} - -func (s *StartUniversalTranscodeRequest) GetMediaBufferSize() *float64 { - if s == nil { - return nil - } - return s.MediaBufferSize -} - -func (s *StartUniversalTranscodeRequest) GetSession() *string { - if s == nil { - return nil - } - return s.Session -} - -func (s *StartUniversalTranscodeRequest) GetAddDebugOverlay() *float64 { - if s == nil { - return nil - } - return s.AddDebugOverlay -} - -func (s *StartUniversalTranscodeRequest) GetAutoAdjustQuality() *float64 { - if s == nil { - return nil - } - return s.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 (s *StartUniversalTranscodeResponse) GetContentType() string { - if s == nil { - return "" - } - return s.ContentType -} - -func (s *StartUniversalTranscodeResponse) GetStatusCode() int { - if s == nil { - return 0 - } - return s.StatusCode -} - -func (s *StartUniversalTranscodeResponse) GetRawResponse() *http.Response { - if s == nil { - return nil - } - return s.RawResponse -} diff --git a/models/operations/stopallrefreshes.go b/models/operations/stopallrefreshes.go new file mode 100644 index 0000000..bd30f68 --- /dev/null +++ b/models/operations/stopallrefreshes.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type StopAllRefreshesResponse 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 + // OK + RequestHandlerSlashGetResponses200 *components.RequestHandlerSlashGetResponses200 +} + +func (s *StopAllRefreshesResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StopAllRefreshesResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StopAllRefreshesResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *StopAllRefreshesResponse) GetRequestHandlerSlashGetResponses200() *components.RequestHandlerSlashGetResponses200 { + if s == nil { + return nil + } + return s.RequestHandlerSlashGetResponses200 +} diff --git a/models/operations/stopalltasks.go b/models/operations/stopalltasks.go deleted file mode 100644 index b417742..0000000 --- a/models/operations/stopalltasks.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (s *StopAllTasksResponse) GetContentType() string { - if s == nil { - return "" - } - return s.ContentType -} - -func (s *StopAllTasksResponse) GetStatusCode() int { - if s == nil { - return 0 - } - return s.StatusCode -} - -func (s *StopAllTasksResponse) GetRawResponse() *http.Response { - if s == nil { - return nil - } - return s.RawResponse -} diff --git a/models/operations/stopdvrreload.go b/models/operations/stopdvrreload.go new file mode 100644 index 0000000..33fc396 --- /dev/null +++ b/models/operations/stopdvrreload.go @@ -0,0 +1,274 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type StopDVRReloadGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StopDVRReloadGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopDVRReloadGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopDVRReloadGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StopDVRReloadGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StopDVRReloadGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StopDVRReloadGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StopDVRReloadGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StopDVRReloadGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StopDVRReloadGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StopDVRReloadGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StopDVRReloadGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StopDVRReloadGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StopDVRReloadGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type StopDVRReloadRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` +} + +func (s StopDVRReloadRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopDVRReloadRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"dvrId"}); err != nil { + return err + } + return nil +} + +func (s *StopDVRReloadRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StopDVRReloadRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StopDVRReloadRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StopDVRReloadRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StopDVRReloadRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StopDVRReloadRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StopDVRReloadRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StopDVRReloadRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StopDVRReloadRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StopDVRReloadRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StopDVRReloadRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StopDVRReloadRequest) GetDvrID() int64 { + if s == nil { + return 0 + } + return s.DvrID +} + +type StopDVRReloadResponse 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 (s *StopDVRReloadResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StopDVRReloadResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StopDVRReloadResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/stopscan.go b/models/operations/stopscan.go new file mode 100644 index 0000000..0632157 --- /dev/null +++ b/models/operations/stopscan.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type StopScanGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StopScanGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopScanGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopScanGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StopScanGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StopScanGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StopScanGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StopScanGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StopScanGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StopScanGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StopScanGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StopScanGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StopScanGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StopScanGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +type StopScanRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the device. + DeviceID int64 `pathParam:"style=simple,explode=false,name=deviceId"` +} + +func (s StopScanRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopScanRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"deviceId"}); err != nil { + return err + } + return nil +} + +func (s *StopScanRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StopScanRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StopScanRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StopScanRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StopScanRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StopScanRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StopScanRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StopScanRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StopScanRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StopScanRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StopScanRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StopScanRequest) GetDeviceID() int64 { + if s == nil { + return 0 + } + return s.DeviceID +} + +type StopScanResponse 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 + // OK + MediaContainerWithDevice *components.MediaContainerWithDevice +} + +func (s *StopScanResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StopScanResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StopScanResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} + +func (s *StopScanResponse) GetMediaContainerWithDevice() *components.MediaContainerWithDevice { + if s == nil { + return nil + } + return s.MediaContainerWithDevice +} diff --git a/models/operations/stoptask.go b/models/operations/stoptask.go index 343bbba..2f57db4 100644 --- a/models/operations/stoptask.go +++ b/models/operations/stoptask.go @@ -3,43 +3,333 @@ package operations import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -// PathParamTaskName - The name of the task to be started. -type PathParamTaskName string +type StopTaskGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (s StopTaskGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopTaskGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopTaskGlobals) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StopTaskGlobals) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StopTaskGlobals) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StopTaskGlobals) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StopTaskGlobals) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StopTaskGlobals) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StopTaskGlobals) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StopTaskGlobals) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StopTaskGlobals) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StopTaskGlobals) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StopTaskGlobals) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +// Task - The task name +type Task 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" + TaskAutomaticUpdates Task = "AutomaticUpdates" + TaskBackupDatabase Task = "BackupDatabase" + TaskButlerTaskGenerateAdMarkers Task = "ButlerTaskGenerateAdMarkers" + TaskButlerTaskGenerateCreditsMarkers Task = "ButlerTaskGenerateCreditsMarkers" + TaskButlerTaskGenerateIntroMarkers Task = "ButlerTaskGenerateIntroMarkers" + TaskButlerTaskGenerateVoiceActivity Task = "ButlerTaskGenerateVoiceActivity" + TaskCleanOldBundles Task = "CleanOldBundles" + TaskCleanOldCacheFiles Task = "CleanOldCacheFiles" + TaskDeepMediaAnalysis Task = "DeepMediaAnalysis" + TaskGarbageCollectBlobs Task = "GarbageCollectBlobs" + TaskGarbageCollectLibraryMedia Task = "GarbageCollectLibraryMedia" + TaskGenerateBlurHashes Task = "GenerateBlurHashes" + TaskGenerateChapterThumbs Task = "GenerateChapterThumbs" + TaskGenerateMediaIndexFiles Task = "GenerateMediaIndexFiles" + TaskLoudnessAnalysis Task = "LoudnessAnalysis" + TaskMusicAnalysis Task = "MusicAnalysis" + TaskOptimizeDatabase Task = "OptimizeDatabase" + TaskRefreshEpgGuides Task = "RefreshEpgGuides" + TaskRefreshLibraries Task = "RefreshLibraries" + TaskRefreshLocalMedia Task = "RefreshLocalMedia" + TaskRefreshPeriodicMetadata Task = "RefreshPeriodicMetadata" + TaskUpgradeMediaAnalysis Task = "UpgradeMediaAnalysis" ) -func (e PathParamTaskName) ToPointer() *PathParamTaskName { +func (e Task) ToPointer() *Task { return &e } +func (e *Task) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AutomaticUpdates": + fallthrough + case "BackupDatabase": + fallthrough + case "ButlerTaskGenerateAdMarkers": + fallthrough + case "ButlerTaskGenerateCreditsMarkers": + fallthrough + case "ButlerTaskGenerateIntroMarkers": + fallthrough + case "ButlerTaskGenerateVoiceActivity": + fallthrough + case "CleanOldBundles": + fallthrough + case "CleanOldCacheFiles": + fallthrough + case "DeepMediaAnalysis": + fallthrough + case "GarbageCollectBlobs": + fallthrough + case "GarbageCollectLibraryMedia": + fallthrough + case "GenerateBlurHashes": + fallthrough + case "GenerateChapterThumbs": + fallthrough + case "GenerateMediaIndexFiles": + fallthrough + case "LoudnessAnalysis": + fallthrough + case "MusicAnalysis": + fallthrough + case "OptimizeDatabase": + fallthrough + case "RefreshEpgGuides": + fallthrough + case "RefreshLibraries": + fallthrough + case "RefreshLocalMedia": + fallthrough + case "RefreshPeriodicMetadata": + fallthrough + case "UpgradeMediaAnalysis": + *e = Task(v) + return nil + default: + return fmt.Errorf("invalid value for Task: %v", v) + } +} type StopTaskRequest struct { - // The name of the task to be started. - TaskName PathParamTaskName `pathParam:"style=simple,explode=false,name=taskName"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The task name + Task Task `pathParam:"style=simple,explode=false,name=task"` } -func (s *StopTaskRequest) GetTaskName() PathParamTaskName { - if s == nil { - return PathParamTaskName("") +func (s StopTaskRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopTaskRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"task"}); err != nil { + return err } - return s.TaskName + return nil +} + +func (s *StopTaskRequest) GetAccepts() *components.Accepts { + if s == nil { + return nil + } + return s.Accepts +} + +func (s *StopTaskRequest) GetClientIdentifier() *string { + if s == nil { + return nil + } + return s.ClientIdentifier +} + +func (s *StopTaskRequest) GetProduct() *string { + if s == nil { + return nil + } + return s.Product +} + +func (s *StopTaskRequest) GetVersion() *string { + if s == nil { + return nil + } + return s.Version +} + +func (s *StopTaskRequest) GetPlatform() *string { + if s == nil { + return nil + } + return s.Platform +} + +func (s *StopTaskRequest) GetPlatformVersion() *string { + if s == nil { + return nil + } + return s.PlatformVersion +} + +func (s *StopTaskRequest) GetDevice() *string { + if s == nil { + return nil + } + return s.Device +} + +func (s *StopTaskRequest) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *StopTaskRequest) GetDeviceVendor() *string { + if s == nil { + return nil + } + return s.DeviceVendor +} + +func (s *StopTaskRequest) GetDeviceName() *string { + if s == nil { + return nil + } + return s.DeviceName +} + +func (s *StopTaskRequest) GetMarketplace() *string { + if s == nil { + return nil + } + return s.Marketplace +} + +func (s *StopTaskRequest) GetTask() Task { + if s == nil { + return Task("") + } + return s.Task } type StopTaskResponse struct { diff --git a/models/operations/stoptasks.go b/models/operations/stoptasks.go new file mode 100644 index 0000000..0ff30b9 --- /dev/null +++ b/models/operations/stoptasks.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type StopTasksResponse 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 (s *StopTasksResponse) GetContentType() string { + if s == nil { + return "" + } + return s.ContentType +} + +func (s *StopTasksResponse) GetStatusCode() int { + if s == nil { + return 0 + } + return s.StatusCode +} + +func (s *StopTasksResponse) GetRawResponse() *http.Response { + if s == nil { + return nil + } + return s.RawResponse +} diff --git a/models/operations/stoptranscodesession.go b/models/operations/stoptranscodesession.go deleted file mode 100644 index f2a21cf..0000000 --- a/models/operations/stoptranscodesession.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (s *StopTranscodeSessionRequest) GetSessionKey() string { - if s == nil { - return "" - } - return s.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 (s *StopTranscodeSessionResponse) GetContentType() string { - if s == nil { - return "" - } - return s.ContentType -} - -func (s *StopTranscodeSessionResponse) GetStatusCode() int { - if s == nil { - return 0 - } - return s.StatusCode -} - -func (s *StopTranscodeSessionResponse) GetRawResponse() *http.Response { - if s == nil { - return nil - } - return s.RawResponse -} diff --git a/models/operations/terminatesession.go b/models/operations/terminatesession.go new file mode 100644 index 0000000..fc9564d --- /dev/null +++ b/models/operations/terminatesession.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type TerminateSessionGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (t TerminateSessionGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TerminateSessionGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TerminateSessionGlobals) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TerminateSessionGlobals) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TerminateSessionGlobals) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TerminateSessionGlobals) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TerminateSessionGlobals) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TerminateSessionGlobals) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TerminateSessionGlobals) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TerminateSessionGlobals) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TerminateSessionGlobals) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TerminateSessionGlobals) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TerminateSessionGlobals) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +type TerminateSessionRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The session id (found in the `Session` element in [/status/sessions](#tag/Status/operation/statusGetSlash)) + SessionID string `queryParam:"style=form,explode=true,name=sessionId"` + // The reason to give to the user (typically displayed in the client) + Reason *string `queryParam:"style=form,explode=true,name=reason"` +} + +func (t TerminateSessionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TerminateSessionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, []string{"sessionId"}); err != nil { + return err + } + return nil +} + +func (t *TerminateSessionRequest) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TerminateSessionRequest) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TerminateSessionRequest) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TerminateSessionRequest) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TerminateSessionRequest) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TerminateSessionRequest) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TerminateSessionRequest) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TerminateSessionRequest) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TerminateSessionRequest) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TerminateSessionRequest) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TerminateSessionRequest) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +func (t *TerminateSessionRequest) GetSessionID() string { + if t == nil { + return "" + } + return t.SessionID +} + +func (t *TerminateSessionRequest) GetReason() *string { + if t == nil { + return nil + } + return t.Reason +} + +type TerminateSessionResponse 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 (t *TerminateSessionResponse) GetContentType() string { + if t == nil { + return "" + } + return t.ContentType +} + +func (t *TerminateSessionResponse) GetStatusCode() int { + if t == nil { + return 0 + } + return t.StatusCode +} + +func (t *TerminateSessionResponse) GetRawResponse() *http.Response { + if t == nil { + return nil + } + return t.RawResponse +} diff --git a/models/operations/transcodeimage.go b/models/operations/transcodeimage.go new file mode 100644 index 0000000..2dc6034 --- /dev/null +++ b/models/operations/transcodeimage.go @@ -0,0 +1,501 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "io" + "net/http" +) + +type TranscodeImageGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (t TranscodeImageGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TranscodeImageGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TranscodeImageGlobals) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TranscodeImageGlobals) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TranscodeImageGlobals) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TranscodeImageGlobals) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TranscodeImageGlobals) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TranscodeImageGlobals) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TranscodeImageGlobals) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TranscodeImageGlobals) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TranscodeImageGlobals) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TranscodeImageGlobals) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TranscodeImageGlobals) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +// Format - The output format for the image; defaults to jpg +type Format string + +const ( + FormatJpg Format = "jpg" + FormatJpeg Format = "jpeg" + FormatPng Format = "png" + FormatPpm Format = "ppm" +) + +func (e Format) ToPointer() *Format { + return &e +} +func (e *Format) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "jpg": + fallthrough + case "jpeg": + fallthrough + case "png": + fallthrough + case "ppm": + *e = Format(v) + return nil + default: + return fmt.Errorf("invalid value for Format: %v", v) + } +} + +// ChromaSubsampling - Use the specified chroma subsambling. +// - 0: 411 +// - 1: 420 +// - 2: 422 +// - 3: 444 +// +// Defaults to 3 (444) +type ChromaSubsampling int64 + +const ( + ChromaSubsamplingZero ChromaSubsampling = 0 + ChromaSubsamplingOne ChromaSubsampling = 1 + ChromaSubsamplingTwo ChromaSubsampling = 2 + ChromaSubsamplingThree ChromaSubsampling = 3 +) + +func (e ChromaSubsampling) ToPointer() *ChromaSubsampling { + return &e +} +func (e *ChromaSubsampling) 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: + *e = ChromaSubsampling(v) + return nil + default: + return fmt.Errorf("invalid value for ChromaSubsampling: %v", v) + } +} + +type TranscodeImageRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The source URL for the image to transcode. Note, if this URL requires a token such as `X-Plex-Token`, it should be given as a query parameter to this url. + URL *string `queryParam:"style=form,explode=true,name=url"` + // The output format for the image; defaults to jpg + Format *Format `queryParam:"style=form,explode=true,name=format"` + // The desired width of the output image + Width *int64 `queryParam:"style=form,explode=true,name=width"` + // The desired height of the output image + Height *int64 `queryParam:"style=form,explode=true,name=height"` + // The desired quality of the output. -1 means the highest quality. Defaults to -1 + Quality *int64 `queryParam:"style=form,explode=true,name=quality"` + // The background color to apply before painting the image. Only really applicable if image has transparency. Defaults to none + Background *string `queryParam:"style=form,explode=true,name=background"` + // Indicates if image should be upscaled to the desired width/height. Defaults to false + Upscale *components.BoolInt `queryParam:"style=form,explode=true,name=upscale"` + // Indicates if image should be scaled to fit the smaller dimension. By default (false) the image is scaled to fit within the width/height specified but if this parameter is true, it will allow overflowing one dimension to fit the other. Essentially it is making the width/height minimum sizes of the image or sizing the image to fill the entire width/height even if it overflows one dimension. + MinSize *components.BoolInt `queryParam:"style=form,explode=true,name=minSize"` + // Obey the rotation values specified in EXIF data. Defaults to true. + Rotate *components.BoolInt `queryParam:"style=form,explode=true,name=rotate"` + // Apply a blur to the image, Defaults to 0 (none) + Blur *int64 `queryParam:"style=form,explode=true,name=blur"` + // Scale the image saturation by the specified percentage. Defaults to 100 + Saturation *int64 `queryParam:"style=form,explode=true,name=saturation"` + // Render the image at the specified opacity percentage. Defaults to 100 + Opacity *int64 `queryParam:"style=form,explode=true,name=opacity"` + // Use the specified chroma subsambling. + // - 0: 411 + // - 1: 420 + // - 2: 422 + // - 3: 444 + // Defaults to 3 (444) + ChromaSubsampling *ChromaSubsampling `queryParam:"style=form,explode=true,name=chromaSubsampling"` + // The color to blend with the image. Defaults to none + BlendColor *string `queryParam:"style=form,explode=true,name=blendColor"` +} + +func (t TranscodeImageRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TranscodeImageRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TranscodeImageRequest) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TranscodeImageRequest) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TranscodeImageRequest) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TranscodeImageRequest) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TranscodeImageRequest) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TranscodeImageRequest) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TranscodeImageRequest) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TranscodeImageRequest) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TranscodeImageRequest) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TranscodeImageRequest) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TranscodeImageRequest) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +func (t *TranscodeImageRequest) GetURL() *string { + if t == nil { + return nil + } + return t.URL +} + +func (t *TranscodeImageRequest) GetFormat() *Format { + if t == nil { + return nil + } + return t.Format +} + +func (t *TranscodeImageRequest) GetWidth() *int64 { + if t == nil { + return nil + } + return t.Width +} + +func (t *TranscodeImageRequest) GetHeight() *int64 { + if t == nil { + return nil + } + return t.Height +} + +func (t *TranscodeImageRequest) GetQuality() *int64 { + if t == nil { + return nil + } + return t.Quality +} + +func (t *TranscodeImageRequest) GetBackground() *string { + if t == nil { + return nil + } + return t.Background +} + +func (t *TranscodeImageRequest) GetUpscale() *components.BoolInt { + if t == nil { + return nil + } + return t.Upscale +} + +func (t *TranscodeImageRequest) GetMinSize() *components.BoolInt { + if t == nil { + return nil + } + return t.MinSize +} + +func (t *TranscodeImageRequest) GetRotate() *components.BoolInt { + if t == nil { + return nil + } + return t.Rotate +} + +func (t *TranscodeImageRequest) GetBlur() *int64 { + if t == nil { + return nil + } + return t.Blur +} + +func (t *TranscodeImageRequest) GetSaturation() *int64 { + if t == nil { + return nil + } + return t.Saturation +} + +func (t *TranscodeImageRequest) GetOpacity() *int64 { + if t == nil { + return nil + } + return t.Opacity +} + +func (t *TranscodeImageRequest) GetChromaSubsampling() *ChromaSubsampling { + if t == nil { + return nil + } + return t.ChromaSubsampling +} + +func (t *TranscodeImageRequest) GetBlendColor() *string { + if t == nil { + return nil + } + return t.BlendColor +} + +type TranscodeImageResponse 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 resulting image + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredImageJpegResponseStream io.ReadCloser + // The resulting image + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredImagePngResponseStream io.ReadCloser + // The resulting image + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + TwoHundredImageXPortablePixmapResponseStream io.ReadCloser +} + +func (t *TranscodeImageResponse) GetContentType() string { + if t == nil { + return "" + } + return t.ContentType +} + +func (t *TranscodeImageResponse) GetStatusCode() int { + if t == nil { + return 0 + } + return t.StatusCode +} + +func (t *TranscodeImageResponse) GetRawResponse() *http.Response { + if t == nil { + return nil + } + return t.RawResponse +} + +func (t *TranscodeImageResponse) GetTwoHundredImageJpegResponseStream() io.ReadCloser { + if t == nil { + return nil + } + return t.TwoHundredImageJpegResponseStream +} + +func (t *TranscodeImageResponse) GetTwoHundredImagePngResponseStream() io.ReadCloser { + if t == nil { + return nil + } + return t.TwoHundredImagePngResponseStream +} + +func (t *TranscodeImageResponse) GetTwoHundredImageXPortablePixmapResponseStream() io.ReadCloser { + if t == nil { + return nil + } + return t.TwoHundredImageXPortablePixmapResponseStream +} diff --git a/models/operations/transcodesubtitles.go b/models/operations/transcodesubtitles.go new file mode 100644 index 0000000..986721f --- /dev/null +++ b/models/operations/transcodesubtitles.go @@ -0,0 +1,651 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type TranscodeSubtitlesGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (t TranscodeSubtitlesGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TranscodeSubtitlesGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TranscodeSubtitlesGlobals) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TranscodeSubtitlesGlobals) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TranscodeSubtitlesGlobals) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TranscodeSubtitlesGlobals) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TranscodeSubtitlesGlobals) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TranscodeSubtitlesGlobals) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TranscodeSubtitlesGlobals) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TranscodeSubtitlesGlobals) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TranscodeSubtitlesGlobals) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TranscodeSubtitlesGlobals) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TranscodeSubtitlesGlobals) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +// QueryParamLocation - Network type of the client, can be used to help determine target bitrate. +type QueryParamLocation string + +const ( + QueryParamLocationLan QueryParamLocation = "lan" + QueryParamLocationWan QueryParamLocation = "wan" + QueryParamLocationCellular QueryParamLocation = "cellular" +) + +func (e QueryParamLocation) ToPointer() *QueryParamLocation { + return &e +} +func (e *QueryParamLocation) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "lan": + fallthrough + case "wan": + fallthrough + case "cellular": + *e = QueryParamLocation(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamLocation: %v", v) + } +} + +// QueryParamProtocol - Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) +type QueryParamProtocol string + +const ( + QueryParamProtocolHTTP QueryParamProtocol = "http" + QueryParamProtocolHls QueryParamProtocol = "hls" + QueryParamProtocolDash QueryParamProtocol = "dash" +) + +func (e QueryParamProtocol) ToPointer() *QueryParamProtocol { + return &e +} +func (e *QueryParamProtocol) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "http": + fallthrough + case "hls": + fallthrough + case "dash": + *e = QueryParamProtocol(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamProtocol: %v", v) + } +} + +// QueryParamSubtitles - Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream +type QueryParamSubtitles string + +const ( + QueryParamSubtitlesAuto QueryParamSubtitles = "auto" + QueryParamSubtitlesBurn QueryParamSubtitles = "burn" + QueryParamSubtitlesNone QueryParamSubtitles = "none" + QueryParamSubtitlesSidecar QueryParamSubtitles = "sidecar" + QueryParamSubtitlesEmbedded QueryParamSubtitles = "embedded" + QueryParamSubtitlesSegmented QueryParamSubtitles = "segmented" + QueryParamSubtitlesUnknown QueryParamSubtitles = "unknown" +) + +func (e QueryParamSubtitles) ToPointer() *QueryParamSubtitles { + return &e +} +func (e *QueryParamSubtitles) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + fallthrough + case "burn": + fallthrough + case "none": + fallthrough + case "sidecar": + fallthrough + case "embedded": + fallthrough + case "segmented": + fallthrough + case "unknown": + *e = QueryParamSubtitles(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamSubtitles: %v", v) + } +} + +type TranscodeSubtitlesRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Type of transcode media + TranscodeType components.TranscodeType `pathParam:"style=simple,explode=false,name=transcodeType"` + // Transcode session UUID + TranscodeSessionID *string `queryParam:"style=form,explode=true,name=transcodeSessionId"` + // Indicates how incompatible advanced subtitles (such as ass/ssa) should be included: * 'burn' - Burn incompatible advanced text subtitles into the video stream * 'text' - Transcode incompatible advanced text subtitles to a compatible text format, even if some markup is lost + // + AdvancedSubtitles *components.AdvancedSubtitles `queryParam:"style=form,explode=true,name=advancedSubtitles"` + // Percentage of original audio loudness to use when transcoding (100 is equivalent to original volume, 50 is half, 200 is double, etc) + AudioBoost *int64 `queryParam:"style=form,explode=true,name=audioBoost"` + // Target video number of audio channels. + AudioChannelCount *int64 `queryParam:"style=form,explode=true,name=audioChannelCount"` + // Indicates the client supports ABR. + AutoAdjustQuality *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustQuality"` + // Indicates if the server should adjust subtitles based on Voice Activity Data. + AutoAdjustSubtitle *components.BoolInt `queryParam:"style=form,explode=true,name=autoAdjustSubtitle"` + // Indicates the client supports direct playing the indicated content. + DirectPlay *components.BoolInt `queryParam:"style=form,explode=true,name=directPlay"` + // Indicates the client supports direct streaming the video of the indicated content. + DirectStream *components.BoolInt `queryParam:"style=form,explode=true,name=directStream"` + // Indicates the client supports direct streaming the audio of the indicated content. + DirectStreamAudio *components.BoolInt `queryParam:"style=form,explode=true,name=directStreamAudio"` + // Indicates if resolution should be adjusted for orientation. + DisableResolutionRotation *components.BoolInt `queryParam:"style=form,explode=true,name=disableResolutionRotation"` + // Ignore client profiles when determining if direct play is possible. Only has an effect when directPlay=1 and both mediaIndex and partIndex are specified and neither are -1 + HasMDE *components.BoolInt `queryParam:"style=form,explode=true,name=hasMDE"` + // Network type of the client, can be used to help determine target bitrate. + Location *QueryParamLocation `queryParam:"style=form,explode=true,name=location"` + // Buffer size used in playback (in KB). Clients should specify a lower bound if not known exactly. This value could make the difference between transcoding and direct play on bandwidth constrained networks. + MediaBufferSize *int64 `queryParam:"style=form,explode=true,name=mediaBufferSize"` + // Index of the media to transcode. -1 or not specified indicates let the server choose. + MediaIndex *int64 `queryParam:"style=form,explode=true,name=mediaIndex"` + // Target bitrate for audio only files (in kbps, used to transcode). + MusicBitrate *int64 `queryParam:"style=form,explode=true,name=musicBitrate"` + // Offset from the start of the media (in seconds). + Offset *float64 `queryParam:"style=form,explode=true,name=offset"` + // Index of the part to transcode. -1 or not specified indicates the server should join parts together in a transcode + PartIndex *int64 `queryParam:"style=form,explode=true,name=partIndex"` + // Internal PMS path of the media to transcode. + Path *string `queryParam:"style=form,explode=true,name=path"` + // Maximum bitrate (in kbps) to use in ABR. + PeakBitrate *int64 `queryParam:"style=form,explode=true,name=peakBitrate"` + // Target photo resolution. + PhotoResolution *string `queryParam:"style=form,explode=true,name=photoResolution"` + // Indicates the network streaming protocol to be used for the transcode session: * 'http' - include the file in the http response such as MKV streaming * 'hls' - hls stream (RFC 8216) * 'dash' - dash stream (ISO/IEC 23009-1:2022) + // + Protocol *QueryParamProtocol `queryParam:"style=form,explode=true,name=protocol"` + // Number of seconds to include in each transcoded segment + SecondsPerSegment *int64 `queryParam:"style=form,explode=true,name=secondsPerSegment"` + // Percentage of original subtitle size to use when burning subtitles (100 is equivalent to original size, 50 is half, ect) + SubtitleSize *int64 `queryParam:"style=form,explode=true,name=subtitleSize"` + // Indicates how subtitles should be included: * 'auto' - Compute the appropriate subtitle setting automatically * 'burn' - Burn the selected subtitle; auto if no selected subtitle * 'none' - Ignore all subtitle streams * 'sidecar' - The selected subtitle should be provided as a sidecar * 'embedded' - The selected subtitle should be provided as an embedded stream * 'segmented' - The selected subtitle should be provided as a segmented stream + // + Subtitles *QueryParamSubtitles `queryParam:"style=form,explode=true,name=subtitles"` + // Target video bitrate (in kbps). + VideoBitrate *int64 `queryParam:"style=form,explode=true,name=videoBitrate"` + // Target photo quality. + VideoQuality *int64 `queryParam:"style=form,explode=true,name=videoQuality"` + // Target maximum video resolution. + VideoResolution *string `queryParam:"style=form,explode=true,name=videoResolution"` + // See [Profile Augmentations](#section/API-Info/Profile-Augmentations) . + XPlexClientProfileExtra *string `header:"style=simple,explode=false,name=X-Plex-Client-Profile-Extra"` + // Which built in Client Profile to use in the decision. Generally should only be used to specify the Generic profile. + XPlexClientProfileName *string `header:"style=simple,explode=false,name=X-Plex-Client-Profile-Name"` + // Unique per client playback session. Used if a client can playback multiple items at a time (such as a browser with multiple tabs) + XPlexSessionIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Session-Identifier"` +} + +func (t TranscodeSubtitlesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TranscodeSubtitlesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, []string{"transcodeType"}); err != nil { + return err + } + return nil +} + +func (t *TranscodeSubtitlesRequest) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TranscodeSubtitlesRequest) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TranscodeSubtitlesRequest) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TranscodeSubtitlesRequest) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TranscodeSubtitlesRequest) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TranscodeSubtitlesRequest) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TranscodeSubtitlesRequest) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TranscodeSubtitlesRequest) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TranscodeSubtitlesRequest) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TranscodeSubtitlesRequest) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TranscodeSubtitlesRequest) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +func (t *TranscodeSubtitlesRequest) GetTranscodeType() components.TranscodeType { + if t == nil { + return components.TranscodeType("") + } + return t.TranscodeType +} + +func (t *TranscodeSubtitlesRequest) GetTranscodeSessionID() *string { + if t == nil { + return nil + } + return t.TranscodeSessionID +} + +func (t *TranscodeSubtitlesRequest) GetAdvancedSubtitles() *components.AdvancedSubtitles { + if t == nil { + return nil + } + return t.AdvancedSubtitles +} + +func (t *TranscodeSubtitlesRequest) GetAudioBoost() *int64 { + if t == nil { + return nil + } + return t.AudioBoost +} + +func (t *TranscodeSubtitlesRequest) GetAudioChannelCount() *int64 { + if t == nil { + return nil + } + return t.AudioChannelCount +} + +func (t *TranscodeSubtitlesRequest) GetAutoAdjustQuality() *components.BoolInt { + if t == nil { + return nil + } + return t.AutoAdjustQuality +} + +func (t *TranscodeSubtitlesRequest) GetAutoAdjustSubtitle() *components.BoolInt { + if t == nil { + return nil + } + return t.AutoAdjustSubtitle +} + +func (t *TranscodeSubtitlesRequest) GetDirectPlay() *components.BoolInt { + if t == nil { + return nil + } + return t.DirectPlay +} + +func (t *TranscodeSubtitlesRequest) GetDirectStream() *components.BoolInt { + if t == nil { + return nil + } + return t.DirectStream +} + +func (t *TranscodeSubtitlesRequest) GetDirectStreamAudio() *components.BoolInt { + if t == nil { + return nil + } + return t.DirectStreamAudio +} + +func (t *TranscodeSubtitlesRequest) GetDisableResolutionRotation() *components.BoolInt { + if t == nil { + return nil + } + return t.DisableResolutionRotation +} + +func (t *TranscodeSubtitlesRequest) GetHasMDE() *components.BoolInt { + if t == nil { + return nil + } + return t.HasMDE +} + +func (t *TranscodeSubtitlesRequest) GetLocation() *QueryParamLocation { + if t == nil { + return nil + } + return t.Location +} + +func (t *TranscodeSubtitlesRequest) GetMediaBufferSize() *int64 { + if t == nil { + return nil + } + return t.MediaBufferSize +} + +func (t *TranscodeSubtitlesRequest) GetMediaIndex() *int64 { + if t == nil { + return nil + } + return t.MediaIndex +} + +func (t *TranscodeSubtitlesRequest) GetMusicBitrate() *int64 { + if t == nil { + return nil + } + return t.MusicBitrate +} + +func (t *TranscodeSubtitlesRequest) GetOffset() *float64 { + if t == nil { + return nil + } + return t.Offset +} + +func (t *TranscodeSubtitlesRequest) GetPartIndex() *int64 { + if t == nil { + return nil + } + return t.PartIndex +} + +func (t *TranscodeSubtitlesRequest) GetPath() *string { + if t == nil { + return nil + } + return t.Path +} + +func (t *TranscodeSubtitlesRequest) GetPeakBitrate() *int64 { + if t == nil { + return nil + } + return t.PeakBitrate +} + +func (t *TranscodeSubtitlesRequest) GetPhotoResolution() *string { + if t == nil { + return nil + } + return t.PhotoResolution +} + +func (t *TranscodeSubtitlesRequest) GetProtocol() *QueryParamProtocol { + if t == nil { + return nil + } + return t.Protocol +} + +func (t *TranscodeSubtitlesRequest) GetSecondsPerSegment() *int64 { + if t == nil { + return nil + } + return t.SecondsPerSegment +} + +func (t *TranscodeSubtitlesRequest) GetSubtitleSize() *int64 { + if t == nil { + return nil + } + return t.SubtitleSize +} + +func (t *TranscodeSubtitlesRequest) GetSubtitles() *QueryParamSubtitles { + if t == nil { + return nil + } + return t.Subtitles +} + +func (t *TranscodeSubtitlesRequest) GetVideoBitrate() *int64 { + if t == nil { + return nil + } + return t.VideoBitrate +} + +func (t *TranscodeSubtitlesRequest) GetVideoQuality() *int64 { + if t == nil { + return nil + } + return t.VideoQuality +} + +func (t *TranscodeSubtitlesRequest) GetVideoResolution() *string { + if t == nil { + return nil + } + return t.VideoResolution +} + +func (t *TranscodeSubtitlesRequest) GetXPlexClientProfileExtra() *string { + if t == nil { + return nil + } + return t.XPlexClientProfileExtra +} + +func (t *TranscodeSubtitlesRequest) GetXPlexClientProfileName() *string { + if t == nil { + return nil + } + return t.XPlexClientProfileName +} + +func (t *TranscodeSubtitlesRequest) GetXPlexSessionIdentifier() *string { + if t == nil { + return nil + } + return t.XPlexSessionIdentifier +} + +type TranscodeSubtitlesResponse 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 (t *TranscodeSubtitlesResponse) GetContentType() string { + if t == nil { + return "" + } + return t.ContentType +} + +func (t *TranscodeSubtitlesResponse) GetStatusCode() int { + if t == nil { + return 0 + } + return t.StatusCode +} + +func (t *TranscodeSubtitlesResponse) GetRawResponse() *http.Response { + if t == nil { + return nil + } + return t.RawResponse +} diff --git a/models/operations/triggerfallback.go b/models/operations/triggerfallback.go new file mode 100644 index 0000000..3387c35 --- /dev/null +++ b/models/operations/triggerfallback.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type TriggerFallbackGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (t TriggerFallbackGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TriggerFallbackGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TriggerFallbackGlobals) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TriggerFallbackGlobals) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TriggerFallbackGlobals) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TriggerFallbackGlobals) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TriggerFallbackGlobals) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TriggerFallbackGlobals) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TriggerFallbackGlobals) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TriggerFallbackGlobals) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TriggerFallbackGlobals) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TriggerFallbackGlobals) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TriggerFallbackGlobals) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +type TriggerFallbackRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // Type of transcode media + TranscodeType components.TranscodeType `pathParam:"style=simple,explode=false,name=transcodeType"` + // Transcode session UUID + TranscodeSessionID *string `queryParam:"style=form,explode=true,name=transcodeSessionId"` +} + +func (t TriggerFallbackRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TriggerFallbackRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, []string{"transcodeType"}); err != nil { + return err + } + return nil +} + +func (t *TriggerFallbackRequest) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TriggerFallbackRequest) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TriggerFallbackRequest) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TriggerFallbackRequest) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TriggerFallbackRequest) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TriggerFallbackRequest) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TriggerFallbackRequest) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TriggerFallbackRequest) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TriggerFallbackRequest) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TriggerFallbackRequest) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TriggerFallbackRequest) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +func (t *TriggerFallbackRequest) GetTranscodeType() components.TranscodeType { + if t == nil { + return components.TranscodeType("") + } + return t.TranscodeType +} + +func (t *TriggerFallbackRequest) GetTranscodeSessionID() *string { + if t == nil { + return nil + } + return t.TranscodeSessionID +} + +type TriggerFallbackResponse 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 (t *TriggerFallbackResponse) GetContentType() string { + if t == nil { + return "" + } + return t.ContentType +} + +func (t *TriggerFallbackResponse) GetStatusCode() int { + if t == nil { + return 0 + } + return t.StatusCode +} + +func (t *TriggerFallbackResponse) GetRawResponse() *http.Response { + if t == nil { + return nil + } + return t.RawResponse +} diff --git a/models/operations/tunechannel.go b/models/operations/tunechannel.go new file mode 100644 index 0000000..3b63941 --- /dev/null +++ b/models/operations/tunechannel.go @@ -0,0 +1,300 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type TuneChannelGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (t TuneChannelGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TuneChannelGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TuneChannelGlobals) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TuneChannelGlobals) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TuneChannelGlobals) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TuneChannelGlobals) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TuneChannelGlobals) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TuneChannelGlobals) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TuneChannelGlobals) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TuneChannelGlobals) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TuneChannelGlobals) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TuneChannelGlobals) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TuneChannelGlobals) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +type TuneChannelRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the DVR. + DvrID int64 `pathParam:"style=simple,explode=false,name=dvrId"` + // The channel ID to tune + Channel string `pathParam:"style=simple,explode=false,name=channel"` +} + +func (t TuneChannelRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TuneChannelRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, []string{"dvrId", "channel"}); err != nil { + return err + } + return nil +} + +func (t *TuneChannelRequest) GetAccepts() *components.Accepts { + if t == nil { + return nil + } + return t.Accepts +} + +func (t *TuneChannelRequest) GetClientIdentifier() *string { + if t == nil { + return nil + } + return t.ClientIdentifier +} + +func (t *TuneChannelRequest) GetProduct() *string { + if t == nil { + return nil + } + return t.Product +} + +func (t *TuneChannelRequest) GetVersion() *string { + if t == nil { + return nil + } + return t.Version +} + +func (t *TuneChannelRequest) GetPlatform() *string { + if t == nil { + return nil + } + return t.Platform +} + +func (t *TuneChannelRequest) GetPlatformVersion() *string { + if t == nil { + return nil + } + return t.PlatformVersion +} + +func (t *TuneChannelRequest) GetDevice() *string { + if t == nil { + return nil + } + return t.Device +} + +func (t *TuneChannelRequest) GetModel() *string { + if t == nil { + return nil + } + return t.Model +} + +func (t *TuneChannelRequest) GetDeviceVendor() *string { + if t == nil { + return nil + } + return t.DeviceVendor +} + +func (t *TuneChannelRequest) GetDeviceName() *string { + if t == nil { + return nil + } + return t.DeviceName +} + +func (t *TuneChannelRequest) GetMarketplace() *string { + if t == nil { + return nil + } + return t.Marketplace +} + +func (t *TuneChannelRequest) GetDvrID() int64 { + if t == nil { + return 0 + } + return t.DvrID +} + +func (t *TuneChannelRequest) GetChannel() string { + if t == nil { + return "" + } + return t.Channel +} + +type TuneChannelResponse 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 + // OK + MediaContainerWithMetadata *components.MediaContainerWithMetadata + Headers map[string][]string +} + +func (t *TuneChannelResponse) GetContentType() string { + if t == nil { + return "" + } + return t.ContentType +} + +func (t *TuneChannelResponse) GetStatusCode() int { + if t == nil { + return 0 + } + return t.StatusCode +} + +func (t *TuneChannelResponse) GetRawResponse() *http.Response { + if t == nil { + return nil + } + return t.RawResponse +} + +func (t *TuneChannelResponse) GetMediaContainerWithMetadata() *components.MediaContainerWithMetadata { + if t == nil { + return nil + } + return t.MediaContainerWithMetadata +} + +func (t *TuneChannelResponse) GetHeaders() map[string][]string { + if t == nil { + return map[string][]string{} + } + return t.Headers +} diff --git a/models/operations/unmatch.go b/models/operations/unmatch.go new file mode 100644 index 0000000..6b4301c --- /dev/null +++ b/models/operations/unmatch.go @@ -0,0 +1,273 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type UnmatchGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (u UnmatchGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnmatchGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnmatchGlobals) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UnmatchGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UnmatchGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UnmatchGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UnmatchGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UnmatchGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UnmatchGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UnmatchGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UnmatchGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UnmatchGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UnmatchGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type UnmatchRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` +} + +func (u UnmatchRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnmatchRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"ids"}); err != nil { + return err + } + return nil +} + +func (u *UnmatchRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UnmatchRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UnmatchRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UnmatchRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UnmatchRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UnmatchRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UnmatchRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UnmatchRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UnmatchRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UnmatchRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UnmatchRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UnmatchRequest) GetIds() string { + if u == nil { + return "" + } + return u.Ids +} + +type UnmatchResponse 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 (u *UnmatchResponse) GetContentType() string { + if u == nil { + return "" + } + return u.ContentType +} + +func (u *UnmatchResponse) GetStatusCode() int { + if u == nil { + return 0 + } + return u.StatusCode +} + +func (u *UnmatchResponse) GetRawResponse() *http.Response { + if u == nil { + return nil + } + return u.RawResponse +} diff --git a/models/operations/unscrobble.go b/models/operations/unscrobble.go new file mode 100644 index 0000000..646df43 --- /dev/null +++ b/models/operations/unscrobble.go @@ -0,0 +1,292 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type UnscrobbleGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (u UnscrobbleGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnscrobbleGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnscrobbleGlobals) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UnscrobbleGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UnscrobbleGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UnscrobbleGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UnscrobbleGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UnscrobbleGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UnscrobbleGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UnscrobbleGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UnscrobbleGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UnscrobbleGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UnscrobbleGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type UnscrobbleRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The identifier of the media provider containing the media to rate. Typically `com.plexapp.plugins.library` + Identifier string `queryParam:"style=form,explode=true,name=identifier"` + // The key of the item to rate. This is the `ratingKey` found in metadata items + Key *string `queryParam:"style=form,explode=true,name=key"` + // The URI of the item to mark as played. See intro for description of the URIs + URI *string `queryParam:"style=form,explode=true,name=uri"` +} + +func (u UnscrobbleRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnscrobbleRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"identifier"}); err != nil { + return err + } + return nil +} + +func (u *UnscrobbleRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UnscrobbleRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UnscrobbleRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UnscrobbleRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UnscrobbleRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UnscrobbleRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UnscrobbleRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UnscrobbleRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UnscrobbleRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UnscrobbleRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UnscrobbleRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UnscrobbleRequest) GetIdentifier() string { + if u == nil { + return "" + } + return u.Identifier +} + +func (u *UnscrobbleRequest) GetKey() *string { + if u == nil { + return nil + } + return u.Key +} + +func (u *UnscrobbleRequest) GetURI() *string { + if u == nil { + return nil + } + return u.URI +} + +type UnscrobbleResponse 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 (u *UnscrobbleResponse) GetContentType() string { + if u == nil { + return "" + } + return u.ContentType +} + +func (u *UnscrobbleResponse) GetStatusCode() int { + if u == nil { + return 0 + } + return u.StatusCode +} + +func (u *UnscrobbleResponse) GetRawResponse() *http.Response { + if u == nil { + return nil + } + return u.RawResponse +} diff --git a/models/operations/unshuffle.go b/models/operations/unshuffle.go new file mode 100644 index 0000000..631be1a --- /dev/null +++ b/models/operations/unshuffle.go @@ -0,0 +1,283 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type UnshuffleGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (u UnshuffleGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnshuffleGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnshuffleGlobals) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UnshuffleGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UnshuffleGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UnshuffleGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UnshuffleGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UnshuffleGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UnshuffleGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UnshuffleGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UnshuffleGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UnshuffleGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UnshuffleGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type UnshuffleRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the play queue. + PlayQueueID int64 `pathParam:"style=simple,explode=false,name=playQueueId"` +} + +func (u UnshuffleRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnshuffleRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"playQueueId"}); err != nil { + return err + } + return nil +} + +func (u *UnshuffleRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UnshuffleRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UnshuffleRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UnshuffleRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UnshuffleRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UnshuffleRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UnshuffleRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UnshuffleRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UnshuffleRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UnshuffleRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UnshuffleRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UnshuffleRequest) GetPlayQueueID() int64 { + if u == nil { + return 0 + } + return u.PlayQueueID +} + +type UnshuffleResponse 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 + // OK + MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata +} + +func (u *UnshuffleResponse) GetContentType() string { + if u == nil { + return "" + } + return u.ContentType +} + +func (u *UnshuffleResponse) GetStatusCode() int { + if u == nil { + return 0 + } + return u.StatusCode +} + +func (u *UnshuffleResponse) GetRawResponse() *http.Response { + if u == nil { + return nil + } + return u.RawResponse +} + +func (u *UnshuffleResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata { + if u == nil { + return nil + } + return u.MediaContainerWithPlaylistMetadata +} diff --git a/models/operations/updatehubvisibility.go b/models/operations/updatehubvisibility.go new file mode 100644 index 0000000..4c99d6b --- /dev/null +++ b/models/operations/updatehubvisibility.go @@ -0,0 +1,310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type UpdateHubVisibilityGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (u UpdateHubVisibilityGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateHubVisibilityGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UpdateHubVisibilityGlobals) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdateHubVisibilityGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdateHubVisibilityGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdateHubVisibilityGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdateHubVisibilityGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdateHubVisibilityGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdateHubVisibilityGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdateHubVisibilityGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdateHubVisibilityGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdateHubVisibilityGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdateHubVisibilityGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type UpdateHubVisibilityRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The section ID for the hubs to change + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The identifier of the hub to change + Identifier string `pathParam:"style=simple,explode=false,name=identifier"` + // Whether this hub should be displayed in recommended + PromotedToRecommended *components.BoolInt `queryParam:"style=form,explode=true,name=promotedToRecommended"` + // Whether this hub should be displayed in admin's home + PromotedToOwnHome *components.BoolInt `queryParam:"style=form,explode=true,name=promotedToOwnHome"` + // Whether this hub should be displayed in shared user's home + PromotedToSharedHome *components.BoolInt `queryParam:"style=form,explode=true,name=promotedToSharedHome"` +} + +func (u UpdateHubVisibilityRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateHubVisibilityRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"sectionId", "identifier"}); err != nil { + return err + } + return nil +} + +func (u *UpdateHubVisibilityRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdateHubVisibilityRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdateHubVisibilityRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdateHubVisibilityRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdateHubVisibilityRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdateHubVisibilityRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdateHubVisibilityRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdateHubVisibilityRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdateHubVisibilityRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdateHubVisibilityRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdateHubVisibilityRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UpdateHubVisibilityRequest) GetSectionID() int64 { + if u == nil { + return 0 + } + return u.SectionID +} + +func (u *UpdateHubVisibilityRequest) GetIdentifier() string { + if u == nil { + return "" + } + return u.Identifier +} + +func (u *UpdateHubVisibilityRequest) GetPromotedToRecommended() *components.BoolInt { + if u == nil { + return nil + } + return u.PromotedToRecommended +} + +func (u *UpdateHubVisibilityRequest) GetPromotedToOwnHome() *components.BoolInt { + if u == nil { + return nil + } + return u.PromotedToOwnHome +} + +func (u *UpdateHubVisibilityRequest) GetPromotedToSharedHome() *components.BoolInt { + if u == nil { + return nil + } + return u.PromotedToSharedHome +} + +type UpdateHubVisibilityResponse 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 (u *UpdateHubVisibilityResponse) GetContentType() string { + if u == nil { + return "" + } + return u.ContentType +} + +func (u *UpdateHubVisibilityResponse) GetStatusCode() int { + if u == nil { + return 0 + } + return u.StatusCode +} + +func (u *UpdateHubVisibilityResponse) GetRawResponse() *http.Response { + if u == nil { + return nil + } + return u.RawResponse +} diff --git a/models/operations/updateitemartwork.go b/models/operations/updateitemartwork.go new file mode 100644 index 0000000..396ae98 --- /dev/null +++ b/models/operations/updateitemartwork.go @@ -0,0 +1,330 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type UpdateItemArtworkGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (u UpdateItemArtworkGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateItemArtworkGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UpdateItemArtworkGlobals) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdateItemArtworkGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdateItemArtworkGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdateItemArtworkGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdateItemArtworkGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdateItemArtworkGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdateItemArtworkGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdateItemArtworkGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdateItemArtworkGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdateItemArtworkGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdateItemArtworkGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type PathParamElement string + +const ( + PathParamElementThumb PathParamElement = "thumb" + PathParamElementArt PathParamElement = "art" + PathParamElementClearLogo PathParamElement = "clearLogo" + PathParamElementBanner PathParamElement = "banner" + PathParamElementPoster PathParamElement = "poster" + PathParamElementTheme PathParamElement = "theme" +) + +func (e PathParamElement) ToPointer() *PathParamElement { + return &e +} +func (e *PathParamElement) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "thumb": + fallthrough + case "art": + fallthrough + case "clearLogo": + fallthrough + case "banner": + fallthrough + case "poster": + fallthrough + case "theme": + *e = PathParamElement(v) + return nil + default: + return fmt.Errorf("invalid value for PathParamElement: %v", v) + } +} + +type UpdateItemArtworkRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + Ids string `pathParam:"style=simple,explode=false,name=ids"` + Element PathParamElement `pathParam:"style=simple,explode=false,name=element"` + // The url of the new asset. + URL *string `queryParam:"style=form,explode=true,name=url"` +} + +func (u UpdateItemArtworkRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateItemArtworkRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"ids", "element"}); err != nil { + return err + } + return nil +} + +func (u *UpdateItemArtworkRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdateItemArtworkRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdateItemArtworkRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdateItemArtworkRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdateItemArtworkRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdateItemArtworkRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdateItemArtworkRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdateItemArtworkRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdateItemArtworkRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdateItemArtworkRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdateItemArtworkRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UpdateItemArtworkRequest) GetIds() string { + if u == nil { + return "" + } + return u.Ids +} + +func (u *UpdateItemArtworkRequest) GetElement() PathParamElement { + if u == nil { + return PathParamElement("") + } + return u.Element +} + +func (u *UpdateItemArtworkRequest) GetURL() *string { + if u == nil { + return nil + } + return u.URL +} + +type UpdateItemArtworkResponse 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 (u *UpdateItemArtworkResponse) GetContentType() string { + if u == nil { + return "" + } + return u.ContentType +} + +func (u *UpdateItemArtworkResponse) GetStatusCode() int { + if u == nil { + return 0 + } + return u.StatusCode +} + +func (u *UpdateItemArtworkResponse) GetRawResponse() *http.Response { + if u == nil { + return nil + } + return u.RawResponse +} diff --git a/models/operations/updateitems.go b/models/operations/updateitems.go new file mode 100644 index 0000000..dd3e053 --- /dev/null +++ b/models/operations/updateitems.go @@ -0,0 +1,390 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type UpdateItemsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (u UpdateItemsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateItemsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UpdateItemsGlobals) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdateItemsGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdateItemsGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdateItemsGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdateItemsGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdateItemsGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdateItemsGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdateItemsGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdateItemsGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdateItemsGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdateItemsGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type UpdateItemsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The id of the section + SectionID string `pathParam:"style=simple,explode=false,name=sectionId"` + Type *string `queryParam:"style=form,explode=true,name=type"` + // The filters to apply to determine which items should be modified + Filters *string `queryParam:"style=form,explode=true,name=filters"` + // Set the specified field to a new value + FieldValue *string `queryParam:"style=form,explode=true,name=field.value"` + // Set the specified field to locked (or unlocked if set to 0) + FieldLocked *components.BoolInt `queryParam:"style=form,explode=true,name=field.locked"` + // This field is treated specially by albums or artists and may be used for implicit reparenting. + TitleValue *string `queryParam:"style=form,explode=true,name=title.value"` + // Reparents set of Tracks or Albums - used with album.title.* in the case of tracks + ArtistTitleValue *string `queryParam:"style=form,explode=true,name=artist.title.value"` + // Reparents set of Tracks or Albums - used with album.title.* in the case of tracks + ArtistTitleID *string `queryParam:"style=form,explode=true,name=artist.title.id"` + // Reparents set of Tracks - Must be used in conjunction with artist.title.value or id + AlbumTitleValue *string `queryParam:"style=form,explode=true,name=album.title.value"` + // Reparents set of Tracks - Must be used in conjunction with artist.title.value or id + AlbumTitleID *string `queryParam:"style=form,explode=true,name=album.title.id"` + // Creates tag and associates it with each item in the set. - [idx] links this and the next parameters together + TagtypeIdxTagTag *string `queryParam:"style=form,explode=true,name=tagtype[idx].tag.tag"` + // Here `object` may be text/thumb/art/theme - Optionally used in conjunction with tag.tag, to update association info across the set. + TagtypeIdxTaggingObject *string `queryParam:"style=form,explode=true,name=tagtype[idx].tagging.object"` + // Remove comma separated tags from the set of items + TagtypeTagTag *string `queryParam:"style=form,explode=true,name=tagtype[].tag.tag-"` + // Remove associations of this type (e.g. genre) from the set of items + TagtypeTag *string `queryParam:"style=form,explode=true,name=tagtype[].tag"` +} + +func (u UpdateItemsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateItemsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"sectionId"}); err != nil { + return err + } + return nil +} + +func (u *UpdateItemsRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdateItemsRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdateItemsRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdateItemsRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdateItemsRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdateItemsRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdateItemsRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdateItemsRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdateItemsRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdateItemsRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdateItemsRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UpdateItemsRequest) GetSectionID() string { + if u == nil { + return "" + } + return u.SectionID +} + +func (u *UpdateItemsRequest) GetType() *string { + if u == nil { + return nil + } + return u.Type +} + +func (u *UpdateItemsRequest) GetFilters() *string { + if u == nil { + return nil + } + return u.Filters +} + +func (u *UpdateItemsRequest) GetFieldValue() *string { + if u == nil { + return nil + } + return u.FieldValue +} + +func (u *UpdateItemsRequest) GetFieldLocked() *components.BoolInt { + if u == nil { + return nil + } + return u.FieldLocked +} + +func (u *UpdateItemsRequest) GetTitleValue() *string { + if u == nil { + return nil + } + return u.TitleValue +} + +func (u *UpdateItemsRequest) GetArtistTitleValue() *string { + if u == nil { + return nil + } + return u.ArtistTitleValue +} + +func (u *UpdateItemsRequest) GetArtistTitleID() *string { + if u == nil { + return nil + } + return u.ArtistTitleID +} + +func (u *UpdateItemsRequest) GetAlbumTitleValue() *string { + if u == nil { + return nil + } + return u.AlbumTitleValue +} + +func (u *UpdateItemsRequest) GetAlbumTitleID() *string { + if u == nil { + return nil + } + return u.AlbumTitleID +} + +func (u *UpdateItemsRequest) GetTagtypeIdxTagTag() *string { + if u == nil { + return nil + } + return u.TagtypeIdxTagTag +} + +func (u *UpdateItemsRequest) GetTagtypeIdxTaggingObject() *string { + if u == nil { + return nil + } + return u.TagtypeIdxTaggingObject +} + +func (u *UpdateItemsRequest) GetTagtypeTagTag() *string { + if u == nil { + return nil + } + return u.TagtypeTagTag +} + +func (u *UpdateItemsRequest) GetTagtypeTag() *string { + if u == nil { + return nil + } + return u.TagtypeTag +} + +type UpdateItemsResponse 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 (u *UpdateItemsResponse) GetContentType() string { + if u == nil { + return "" + } + return u.ContentType +} + +func (u *UpdateItemsResponse) GetStatusCode() int { + if u == nil { + return 0 + } + return u.StatusCode +} + +func (u *UpdateItemsResponse) GetRawResponse() *http.Response { + if u == nil { + return nil + } + return u.RawResponse +} diff --git a/models/operations/updateplaylist.go b/models/operations/updateplaylist.go index 6e7f4e2..90ac71a 100644 --- a/models/operations/updateplaylist.go +++ b/models/operations/updateplaylist.go @@ -3,39 +3,246 @@ package operations import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -type UpdatePlaylistRequest struct { - // the ID of the playlist - PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` - // name of the playlist - Title *string `queryParam:"style=form,explode=true,name=title"` - // summary description of the playlist - Summary *string `queryParam:"style=form,explode=true,name=summary"` +type UpdatePlaylistGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (u *UpdatePlaylistRequest) GetPlaylistID() float64 { +func (u UpdatePlaylistGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdatePlaylistGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UpdatePlaylistGlobals) GetAccepts() *components.Accepts { if u == nil { - return 0.0 + return nil + } + return u.Accepts +} + +func (u *UpdatePlaylistGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdatePlaylistGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdatePlaylistGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdatePlaylistGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdatePlaylistGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdatePlaylistGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdatePlaylistGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdatePlaylistGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdatePlaylistGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdatePlaylistGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +type UpdatePlaylistRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The ID of the playlist + PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"` +} + +func (u UpdatePlaylistRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdatePlaylistRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"playlistId"}); err != nil { + return err + } + return nil +} + +func (u *UpdatePlaylistRequest) GetAccepts() *components.Accepts { + if u == nil { + return nil + } + return u.Accepts +} + +func (u *UpdatePlaylistRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UpdatePlaylistRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UpdatePlaylistRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UpdatePlaylistRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UpdatePlaylistRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UpdatePlaylistRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UpdatePlaylistRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UpdatePlaylistRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UpdatePlaylistRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UpdatePlaylistRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UpdatePlaylistRequest) GetPlaylistID() int64 { + if u == nil { + return 0 } return u.PlaylistID } -func (u *UpdatePlaylistRequest) GetTitle() *string { - if u == nil { - return nil - } - return u.Title -} - -func (u *UpdatePlaylistRequest) GetSummary() *string { - if u == nil { - return nil - } - return u.Summary -} - type UpdatePlaylistResponse struct { // HTTP response content type for this operation ContentType string diff --git a/models/operations/updateplayprogress.go b/models/operations/updateplayprogress.go deleted file mode 100644 index 6e811e9..0000000 --- a/models/operations/updateplayprogress.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). 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 (u *UpdatePlayProgressRequest) GetKey() string { - if u == nil { - return "" - } - return u.Key -} - -func (u *UpdatePlayProgressRequest) GetTime() float64 { - if u == nil { - return 0.0 - } - return u.Time -} - -func (u *UpdatePlayProgressRequest) GetState() string { - if u == nil { - return "" - } - return u.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 (u *UpdatePlayProgressResponse) GetContentType() string { - if u == nil { - return "" - } - return u.ContentType -} - -func (u *UpdatePlayProgressResponse) GetStatusCode() int { - if u == nil { - return 0 - } - return u.StatusCode -} - -func (u *UpdatePlayProgressResponse) GetRawResponse() *http.Response { - if u == nil { - return nil - } - return u.RawResponse -} diff --git a/models/operations/uploadplaylist.go b/models/operations/uploadplaylist.go index 8823713..dcf9144 100644 --- a/models/operations/uploadplaylist.go +++ b/models/operations/uploadplaylist.go @@ -3,59 +3,151 @@ package operations import ( - "encoding/json" - "fmt" "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" "net/http" ) -// QueryParamForce - 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 QueryParamForce int64 - -const ( - QueryParamForceZero QueryParamForce = 0 - QueryParamForceOne QueryParamForce = 1 -) - -func (e QueryParamForce) ToPointer() *QueryParamForce { - return &e +type UploadPlaylistGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` } -func (e *QueryParamForce) UnmarshalJSON(data []byte) error { - var v int64 - if err := json.Unmarshal(data, &v); err != nil { + +func (u UploadPlaylistGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UploadPlaylistGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { return err } - switch v { - case 0: - fallthrough - case 1: - *e = QueryParamForce(v) + return nil +} + +func (u *UploadPlaylistGlobals) GetAccepts() *components.Accepts { + if u == nil { return nil - default: - return fmt.Errorf("invalid value for QueryParamForce: %v", v) } + return u.Accepts +} + +func (u *UploadPlaylistGlobals) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UploadPlaylistGlobals) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UploadPlaylistGlobals) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UploadPlaylistGlobals) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UploadPlaylistGlobals) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UploadPlaylistGlobals) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UploadPlaylistGlobals) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UploadPlaylistGlobals) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UploadPlaylistGlobals) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UploadPlaylistGlobals) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace } 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 QueryParamForce `queryParam:"style=form,explode=true,name=force"` - // Possibly the section ID to upload the playlist to, we are not certain. - SectionID int64 `default:"1" queryParam:"style=form,explode=true,name=sectionID"` + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 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 *components.BoolInt `queryParam:"style=form,explode=true,name=force"` } func (u UploadPlaylistRequest) MarshalJSON() ([]byte, error) { @@ -63,33 +155,103 @@ func (u UploadPlaylistRequest) MarshalJSON() ([]byte, error) { } func (u *UploadPlaylistRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, []string{"path", "force", "sectionID"}); err != nil { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { return err } return nil } -func (u *UploadPlaylistRequest) GetPath() string { +func (u *UploadPlaylistRequest) GetAccepts() *components.Accepts { if u == nil { - return "" + return nil + } + return u.Accepts +} + +func (u *UploadPlaylistRequest) GetClientIdentifier() *string { + if u == nil { + return nil + } + return u.ClientIdentifier +} + +func (u *UploadPlaylistRequest) GetProduct() *string { + if u == nil { + return nil + } + return u.Product +} + +func (u *UploadPlaylistRequest) GetVersion() *string { + if u == nil { + return nil + } + return u.Version +} + +func (u *UploadPlaylistRequest) GetPlatform() *string { + if u == nil { + return nil + } + return u.Platform +} + +func (u *UploadPlaylistRequest) GetPlatformVersion() *string { + if u == nil { + return nil + } + return u.PlatformVersion +} + +func (u *UploadPlaylistRequest) GetDevice() *string { + if u == nil { + return nil + } + return u.Device +} + +func (u *UploadPlaylistRequest) GetModel() *string { + if u == nil { + return nil + } + return u.Model +} + +func (u *UploadPlaylistRequest) GetDeviceVendor() *string { + if u == nil { + return nil + } + return u.DeviceVendor +} + +func (u *UploadPlaylistRequest) GetDeviceName() *string { + if u == nil { + return nil + } + return u.DeviceName +} + +func (u *UploadPlaylistRequest) GetMarketplace() *string { + if u == nil { + return nil + } + return u.Marketplace +} + +func (u *UploadPlaylistRequest) GetPath() *string { + if u == nil { + return nil } return u.Path } -func (u *UploadPlaylistRequest) GetForce() QueryParamForce { +func (u *UploadPlaylistRequest) GetForce() *components.BoolInt { if u == nil { - return QueryParamForce(0) + return nil } return u.Force } -func (u *UploadPlaylistRequest) GetSectionID() int64 { - if u == nil { - return 0 - } - return u.SectionID -} - type UploadPlaylistResponse struct { // HTTP response content type for this operation ContentType string diff --git a/models/operations/voicesearchhubs.go b/models/operations/voicesearchhubs.go new file mode 100644 index 0000000..a3852e2 --- /dev/null +++ b/models/operations/voicesearchhubs.go @@ -0,0 +1,371 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type VoiceSearchHubsGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (v VoiceSearchHubsGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *VoiceSearchHubsGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, nil); err != nil { + return err + } + return nil +} + +func (v *VoiceSearchHubsGlobals) GetAccepts() *components.Accepts { + if v == nil { + return nil + } + return v.Accepts +} + +func (v *VoiceSearchHubsGlobals) GetClientIdentifier() *string { + if v == nil { + return nil + } + return v.ClientIdentifier +} + +func (v *VoiceSearchHubsGlobals) GetProduct() *string { + if v == nil { + return nil + } + return v.Product +} + +func (v *VoiceSearchHubsGlobals) GetVersion() *string { + if v == nil { + return nil + } + return v.Version +} + +func (v *VoiceSearchHubsGlobals) GetPlatform() *string { + if v == nil { + return nil + } + return v.Platform +} + +func (v *VoiceSearchHubsGlobals) GetPlatformVersion() *string { + if v == nil { + return nil + } + return v.PlatformVersion +} + +func (v *VoiceSearchHubsGlobals) GetDevice() *string { + if v == nil { + return nil + } + return v.Device +} + +func (v *VoiceSearchHubsGlobals) GetModel() *string { + if v == nil { + return nil + } + return v.Model +} + +func (v *VoiceSearchHubsGlobals) GetDeviceVendor() *string { + if v == nil { + return nil + } + return v.DeviceVendor +} + +func (v *VoiceSearchHubsGlobals) GetDeviceName() *string { + if v == nil { + return nil + } + return v.DeviceName +} + +func (v *VoiceSearchHubsGlobals) GetMarketplace() *string { + if v == nil { + return nil + } + return v.Marketplace +} + +type VoiceSearchHubsRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // The query term + Query string `queryParam:"style=form,explode=true,name=query"` + // The metadata type to filter by + Type *int64 `queryParam:"style=form,explode=true,name=type"` + // The number of items to return per hub. 3 if not specified + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` +} + +func (v VoiceSearchHubsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *VoiceSearchHubsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, []string{"query"}); err != nil { + return err + } + return nil +} + +func (v *VoiceSearchHubsRequest) GetAccepts() *components.Accepts { + if v == nil { + return nil + } + return v.Accepts +} + +func (v *VoiceSearchHubsRequest) GetClientIdentifier() *string { + if v == nil { + return nil + } + return v.ClientIdentifier +} + +func (v *VoiceSearchHubsRequest) GetProduct() *string { + if v == nil { + return nil + } + return v.Product +} + +func (v *VoiceSearchHubsRequest) GetVersion() *string { + if v == nil { + return nil + } + return v.Version +} + +func (v *VoiceSearchHubsRequest) GetPlatform() *string { + if v == nil { + return nil + } + return v.Platform +} + +func (v *VoiceSearchHubsRequest) GetPlatformVersion() *string { + if v == nil { + return nil + } + return v.PlatformVersion +} + +func (v *VoiceSearchHubsRequest) GetDevice() *string { + if v == nil { + return nil + } + return v.Device +} + +func (v *VoiceSearchHubsRequest) GetModel() *string { + if v == nil { + return nil + } + return v.Model +} + +func (v *VoiceSearchHubsRequest) GetDeviceVendor() *string { + if v == nil { + return nil + } + return v.DeviceVendor +} + +func (v *VoiceSearchHubsRequest) GetDeviceName() *string { + if v == nil { + return nil + } + return v.DeviceName +} + +func (v *VoiceSearchHubsRequest) GetMarketplace() *string { + if v == nil { + return nil + } + return v.Marketplace +} + +func (v *VoiceSearchHubsRequest) GetQuery() string { + if v == nil { + return "" + } + return v.Query +} + +func (v *VoiceSearchHubsRequest) GetType() *int64 { + if v == nil { + return nil + } + return v.Type +} + +func (v *VoiceSearchHubsRequest) GetLimit() *int64 { + if v == nil { + return nil + } + return v.Limit +} + +// VoiceSearchHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. +// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) +// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track. +type VoiceSearchHubsMediaContainer struct { + Identifier *string `json:"identifier,omitempty"` + // The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header. + // + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + // The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header. + // + TotalSize *int64 `json:"totalSize,omitempty"` + Hub []components.Hub `json:"Hub,omitempty"` +} + +func (v *VoiceSearchHubsMediaContainer) GetIdentifier() *string { + if v == nil { + return nil + } + return v.Identifier +} + +func (v *VoiceSearchHubsMediaContainer) GetOffset() *int64 { + if v == nil { + return nil + } + return v.Offset +} + +func (v *VoiceSearchHubsMediaContainer) GetSize() *int64 { + if v == nil { + return nil + } + return v.Size +} + +func (v *VoiceSearchHubsMediaContainer) GetTotalSize() *int64 { + if v == nil { + return nil + } + return v.TotalSize +} + +func (v *VoiceSearchHubsMediaContainer) GetHub() []components.Hub { + if v == nil { + return nil + } + return v.Hub +} + +// VoiceSearchHubsResponseBody - OK +type VoiceSearchHubsResponseBody struct { + MediaContainer *VoiceSearchHubsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (v *VoiceSearchHubsResponseBody) GetMediaContainer() *VoiceSearchHubsMediaContainer { + if v == nil { + return nil + } + return v.MediaContainer +} + +type VoiceSearchHubsResponse 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 + // OK + Object *VoiceSearchHubsResponseBody + Headers map[string][]string +} + +func (v *VoiceSearchHubsResponse) GetContentType() string { + if v == nil { + return "" + } + return v.ContentType +} + +func (v *VoiceSearchHubsResponse) GetStatusCode() int { + if v == nil { + return 0 + } + return v.StatusCode +} + +func (v *VoiceSearchHubsResponse) GetRawResponse() *http.Response { + if v == nil { + return nil + } + return v.RawResponse +} + +func (v *VoiceSearchHubsResponse) GetObject() *VoiceSearchHubsResponseBody { + if v == nil { + return nil + } + return v.Object +} + +func (v *VoiceSearchHubsResponse) GetHeaders() map[string][]string { + if v == nil { + return map[string][]string{} + } + return v.Headers +} diff --git a/models/operations/writelog.go b/models/operations/writelog.go new file mode 100644 index 0000000..0d2f133 --- /dev/null +++ b/models/operations/writelog.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type WriteLogResponse 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 (w *WriteLogResponse) GetContentType() string { + if w == nil { + return "" + } + return w.ContentType +} + +func (w *WriteLogResponse) GetStatusCode() int { + if w == nil { + return 0 + } + return w.StatusCode +} + +func (w *WriteLogResponse) GetRawResponse() *http.Response { + if w == nil { + return nil + } + return w.RawResponse +} diff --git a/models/operations/writemessage.go b/models/operations/writemessage.go new file mode 100644 index 0000000..610fa01 --- /dev/null +++ b/models/operations/writemessage.go @@ -0,0 +1,341 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" +) + +type WriteMessageGlobals struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` +} + +func (w WriteMessageGlobals) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WriteMessageGlobals) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, nil); err != nil { + return err + } + return nil +} + +func (w *WriteMessageGlobals) GetAccepts() *components.Accepts { + if w == nil { + return nil + } + return w.Accepts +} + +func (w *WriteMessageGlobals) GetClientIdentifier() *string { + if w == nil { + return nil + } + return w.ClientIdentifier +} + +func (w *WriteMessageGlobals) GetProduct() *string { + if w == nil { + return nil + } + return w.Product +} + +func (w *WriteMessageGlobals) GetVersion() *string { + if w == nil { + return nil + } + return w.Version +} + +func (w *WriteMessageGlobals) GetPlatform() *string { + if w == nil { + return nil + } + return w.Platform +} + +func (w *WriteMessageGlobals) GetPlatformVersion() *string { + if w == nil { + return nil + } + return w.PlatformVersion +} + +func (w *WriteMessageGlobals) GetDevice() *string { + if w == nil { + return nil + } + return w.Device +} + +func (w *WriteMessageGlobals) GetModel() *string { + if w == nil { + return nil + } + return w.Model +} + +func (w *WriteMessageGlobals) GetDeviceVendor() *string { + if w == nil { + return nil + } + return w.DeviceVendor +} + +func (w *WriteMessageGlobals) GetDeviceName() *string { + if w == nil { + return nil + } + return w.DeviceName +} + +func (w *WriteMessageGlobals) GetMarketplace() *string { + if w == nil { + return nil + } + return w.Marketplace +} + +// 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 WriteMessageRequest struct { + // Indicates the client accepts the indicated media types + Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"` + // An opaque identifier unique to the client + ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` + // The name of the client product + Product *string `header:"style=simple,explode=false,name=X-Plex-Product"` + // The version of the client application + Version *string `header:"style=simple,explode=false,name=X-Plex-Version"` + // The platform of the client + Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"` + // The version of the platform + PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"` + // A relatively friendly name for the client device + Device *string `header:"style=simple,explode=false,name=X-Plex-Device"` + // A potentially less friendly identifier for the device model + Model *string `header:"style=simple,explode=false,name=X-Plex-Model"` + // The device vendor + DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"` + // A friendly name for the client + DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"` + // The marketplace on which the client application is distributed + Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"` + // 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 (w WriteMessageRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WriteMessageRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, nil); err != nil { + return err + } + return nil +} + +func (w *WriteMessageRequest) GetAccepts() *components.Accepts { + if w == nil { + return nil + } + return w.Accepts +} + +func (w *WriteMessageRequest) GetClientIdentifier() *string { + if w == nil { + return nil + } + return w.ClientIdentifier +} + +func (w *WriteMessageRequest) GetProduct() *string { + if w == nil { + return nil + } + return w.Product +} + +func (w *WriteMessageRequest) GetVersion() *string { + if w == nil { + return nil + } + return w.Version +} + +func (w *WriteMessageRequest) GetPlatform() *string { + if w == nil { + return nil + } + return w.Platform +} + +func (w *WriteMessageRequest) GetPlatformVersion() *string { + if w == nil { + return nil + } + return w.PlatformVersion +} + +func (w *WriteMessageRequest) GetDevice() *string { + if w == nil { + return nil + } + return w.Device +} + +func (w *WriteMessageRequest) GetModel() *string { + if w == nil { + return nil + } + return w.Model +} + +func (w *WriteMessageRequest) GetDeviceVendor() *string { + if w == nil { + return nil + } + return w.DeviceVendor +} + +func (w *WriteMessageRequest) GetDeviceName() *string { + if w == nil { + return nil + } + return w.DeviceName +} + +func (w *WriteMessageRequest) GetMarketplace() *string { + if w == nil { + return nil + } + return w.Marketplace +} + +func (w *WriteMessageRequest) GetLevel() *Level { + if w == nil { + return nil + } + return w.Level +} + +func (w *WriteMessageRequest) GetMessage() *string { + if w == nil { + return nil + } + return w.Message +} + +func (w *WriteMessageRequest) GetSource() *string { + if w == nil { + return nil + } + return w.Source +} + +type WriteMessageResponse 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 (w *WriteMessageResponse) GetContentType() string { + if w == nil { + return "" + } + return w.ContentType +} + +func (w *WriteMessageResponse) GetStatusCode() int { + if w == nil { + return 0 + } + return w.StatusCode +} + +func (w *WriteMessageResponse) GetRawResponse() *http.Response { + if w == nil { + return nil + } + return w.RawResponse +} diff --git a/models/sdkerrors/addplaylistcontents.go b/models/sdkerrors/addplaylistcontents.go deleted file mode 100644 index f4efdb5..0000000 --- a/models/sdkerrors/addplaylistcontents.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type AddPlaylistContentsPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (a *AddPlaylistContentsPlaylistsErrors) GetCode() *int { - if a == nil { - return nil - } - return a.Code -} - -func (a *AddPlaylistContentsPlaylistsErrors) GetMessage() *string { - if a == nil { - return nil - } - return a.Message -} - -func (a *AddPlaylistContentsPlaylistsErrors) GetStatus() *int { - if a == nil { - return nil - } - return a.Status -} - -// AddPlaylistContentsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type AddPlaylistContentsUnauthorized struct { - Errors []AddPlaylistContentsPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &AddPlaylistContentsUnauthorized{} - -func (e *AddPlaylistContentsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type AddPlaylistContentsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (a *AddPlaylistContentsErrors) GetCode() *int { - if a == nil { - return nil - } - return a.Code -} - -func (a *AddPlaylistContentsErrors) GetMessage() *string { - if a == nil { - return nil - } - return a.Message -} - -func (a *AddPlaylistContentsErrors) GetStatus() *int { - if a == nil { - return nil - } - return a.Status -} - -// AddPlaylistContentsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type AddPlaylistContentsBadRequest struct { - Errors []AddPlaylistContentsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &AddPlaylistContentsBadRequest{} - -func (e *AddPlaylistContentsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/applyupdates.go b/models/sdkerrors/applyupdates.go deleted file mode 100644 index 200fb37..0000000 --- a/models/sdkerrors/applyupdates.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type ApplyUpdatesUpdaterErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (a *ApplyUpdatesUpdaterErrors) GetCode() *int { - if a == nil { - return nil - } - return a.Code -} - -func (a *ApplyUpdatesUpdaterErrors) GetMessage() *string { - if a == nil { - return nil - } - return a.Message -} - -func (a *ApplyUpdatesUpdaterErrors) GetStatus() *int { - if a == nil { - return nil - } - return a.Status -} - -// ApplyUpdatesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type ApplyUpdatesUnauthorized struct { - Errors []ApplyUpdatesUpdaterErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &ApplyUpdatesUnauthorized{} - -func (e *ApplyUpdatesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type ApplyUpdatesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (a *ApplyUpdatesErrors) GetCode() *int { - if a == nil { - return nil - } - return a.Code -} - -func (a *ApplyUpdatesErrors) GetMessage() *string { - if a == nil { - return nil - } - return a.Message -} - -func (a *ApplyUpdatesErrors) GetStatus() *int { - if a == nil { - return nil - } - return a.Status -} - -// ApplyUpdatesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type ApplyUpdatesBadRequest struct { - Errors []ApplyUpdatesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &ApplyUpdatesBadRequest{} - -func (e *ApplyUpdatesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/cancelserveractivities.go b/models/sdkerrors/cancelserveractivities.go deleted file mode 100644 index 974cce1..0000000 --- a/models/sdkerrors/cancelserveractivities.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type CancelServerActivitiesActivitiesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *CancelServerActivitiesActivitiesErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *CancelServerActivitiesActivitiesErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *CancelServerActivitiesActivitiesErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// CancelServerActivitiesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type CancelServerActivitiesUnauthorized struct { - Errors []CancelServerActivitiesActivitiesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &CancelServerActivitiesUnauthorized{} - -func (e *CancelServerActivitiesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type CancelServerActivitiesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *CancelServerActivitiesErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *CancelServerActivitiesErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *CancelServerActivitiesErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// CancelServerActivitiesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type CancelServerActivitiesBadRequest struct { - Errors []CancelServerActivitiesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &CancelServerActivitiesBadRequest{} - -func (e *CancelServerActivitiesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/checkforupdates.go b/models/sdkerrors/checkforupdates.go deleted file mode 100644 index 14c4243..0000000 --- a/models/sdkerrors/checkforupdates.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type CheckForUpdatesUpdaterErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *CheckForUpdatesUpdaterErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *CheckForUpdatesUpdaterErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *CheckForUpdatesUpdaterErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// CheckForUpdatesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type CheckForUpdatesUnauthorized struct { - Errors []CheckForUpdatesUpdaterErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &CheckForUpdatesUnauthorized{} - -func (e *CheckForUpdatesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type CheckForUpdatesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *CheckForUpdatesErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *CheckForUpdatesErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *CheckForUpdatesErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// CheckForUpdatesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type CheckForUpdatesBadRequest struct { - Errors []CheckForUpdatesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &CheckForUpdatesBadRequest{} - -func (e *CheckForUpdatesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/clearplaylistcontents.go b/models/sdkerrors/clearplaylistcontents.go deleted file mode 100644 index 7b7468d..0000000 --- a/models/sdkerrors/clearplaylistcontents.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type ClearPlaylistContentsPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *ClearPlaylistContentsPlaylistsErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *ClearPlaylistContentsPlaylistsErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *ClearPlaylistContentsPlaylistsErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// ClearPlaylistContentsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type ClearPlaylistContentsUnauthorized struct { - Errors []ClearPlaylistContentsPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &ClearPlaylistContentsUnauthorized{} - -func (e *ClearPlaylistContentsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type ClearPlaylistContentsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *ClearPlaylistContentsErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *ClearPlaylistContentsErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *ClearPlaylistContentsErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// ClearPlaylistContentsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type ClearPlaylistContentsBadRequest struct { - Errors []ClearPlaylistContentsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &ClearPlaylistContentsBadRequest{} - -func (e *ClearPlaylistContentsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/createplaylist.go b/models/sdkerrors/createplaylist.go deleted file mode 100644 index 83a1c77..0000000 --- a/models/sdkerrors/createplaylist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type CreatePlaylistPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *CreatePlaylistPlaylistsErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *CreatePlaylistPlaylistsErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *CreatePlaylistPlaylistsErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// CreatePlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type CreatePlaylistUnauthorized struct { - Errors []CreatePlaylistPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &CreatePlaylistUnauthorized{} - -func (e *CreatePlaylistUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type CreatePlaylistErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (c *CreatePlaylistErrors) GetCode() *int { - if c == nil { - return nil - } - return c.Code -} - -func (c *CreatePlaylistErrors) GetMessage() *string { - if c == nil { - return nil - } - return c.Message -} - -func (c *CreatePlaylistErrors) GetStatus() *int { - if c == nil { - return nil - } - return c.Status -} - -// CreatePlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type CreatePlaylistBadRequest struct { - Errors []CreatePlaylistErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &CreatePlaylistBadRequest{} - -func (e *CreatePlaylistBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/deletelibrary.go b/models/sdkerrors/deletelibrary.go deleted file mode 100644 index c4f23d1..0000000 --- a/models/sdkerrors/deletelibrary.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type DeleteLibraryLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (d *DeleteLibraryLibraryErrors) GetCode() *int { - if d == nil { - return nil - } - return d.Code -} - -func (d *DeleteLibraryLibraryErrors) GetMessage() *string { - if d == nil { - return nil - } - return d.Message -} - -func (d *DeleteLibraryLibraryErrors) GetStatus() *int { - if d == nil { - return nil - } - return d.Status -} - -// DeleteLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type DeleteLibraryUnauthorized struct { - Errors []DeleteLibraryLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &DeleteLibraryUnauthorized{} - -func (e *DeleteLibraryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type DeleteLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (d *DeleteLibraryErrors) GetCode() *int { - if d == nil { - return nil - } - return d.Code -} - -func (d *DeleteLibraryErrors) GetMessage() *string { - if d == nil { - return nil - } - return d.Message -} - -func (d *DeleteLibraryErrors) GetStatus() *int { - if d == nil { - return nil - } - return d.Status -} - -// DeleteLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type DeleteLibraryBadRequest struct { - Errors []DeleteLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &DeleteLibraryBadRequest{} - -func (e *DeleteLibraryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/deleteplaylist.go b/models/sdkerrors/deleteplaylist.go deleted file mode 100644 index 58f8bba..0000000 --- a/models/sdkerrors/deleteplaylist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type DeletePlaylistPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (d *DeletePlaylistPlaylistsErrors) GetCode() *int { - if d == nil { - return nil - } - return d.Code -} - -func (d *DeletePlaylistPlaylistsErrors) GetMessage() *string { - if d == nil { - return nil - } - return d.Message -} - -func (d *DeletePlaylistPlaylistsErrors) GetStatus() *int { - if d == nil { - return nil - } - return d.Status -} - -// DeletePlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type DeletePlaylistUnauthorized struct { - Errors []DeletePlaylistPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &DeletePlaylistUnauthorized{} - -func (e *DeletePlaylistUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type DeletePlaylistErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (d *DeletePlaylistErrors) GetCode() *int { - if d == nil { - return nil - } - return d.Code -} - -func (d *DeletePlaylistErrors) GetMessage() *string { - if d == nil { - return nil - } - return d.Message -} - -func (d *DeletePlaylistErrors) GetStatus() *int { - if d == nil { - return nil - } - return d.Status -} - -// DeletePlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type DeletePlaylistBadRequest struct { - Errors []DeletePlaylistErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &DeletePlaylistBadRequest{} - -func (e *DeletePlaylistBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/enablepapertrail.go b/models/sdkerrors/enablepapertrail.go deleted file mode 100644 index a4cd4f7..0000000 --- a/models/sdkerrors/enablepapertrail.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type EnablePaperTrailLogErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (e *EnablePaperTrailLogErrors) GetCode() *int { - if e == nil { - return nil - } - return e.Code -} - -func (e *EnablePaperTrailLogErrors) GetMessage() *string { - if e == nil { - return nil - } - return e.Message -} - -func (e *EnablePaperTrailLogErrors) GetStatus() *int { - if e == nil { - return nil - } - return e.Status -} - -// EnablePaperTrailUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type EnablePaperTrailUnauthorized struct { - Errors []EnablePaperTrailLogErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &EnablePaperTrailUnauthorized{} - -func (e *EnablePaperTrailUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type EnablePaperTrailErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (e *EnablePaperTrailErrors) GetCode() *int { - if e == nil { - return nil - } - return e.Code -} - -func (e *EnablePaperTrailErrors) GetMessage() *string { - if e == nil { - return nil - } - return e.Message -} - -func (e *EnablePaperTrailErrors) GetStatus() *int { - if e == nil { - return nil - } - return e.Status -} - -// EnablePaperTrailBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type EnablePaperTrailBadRequest struct { - Errors []EnablePaperTrailErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &EnablePaperTrailBadRequest{} - -func (e *EnablePaperTrailBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getactorslibrary.go b/models/sdkerrors/getactorslibrary.go deleted file mode 100644 index 0345715..0000000 --- a/models/sdkerrors/getactorslibrary.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetActorsLibraryLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetActorsLibraryLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetActorsLibraryLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetActorsLibraryLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetActorsLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetActorsLibraryUnauthorized struct { - Errors []GetActorsLibraryLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetActorsLibraryUnauthorized{} - -func (e *GetActorsLibraryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetActorsLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetActorsLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetActorsLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetActorsLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetActorsLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetActorsLibraryBadRequest struct { - Errors []GetActorsLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetActorsLibraryBadRequest{} - -func (e *GetActorsLibraryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getalllibraries.go b/models/sdkerrors/getalllibraries.go deleted file mode 100644 index 0a29784..0000000 --- a/models/sdkerrors/getalllibraries.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetAllLibrariesLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetAllLibrariesLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetAllLibrariesLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetAllLibrariesLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetAllLibrariesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetAllLibrariesUnauthorized struct { - Errors []GetAllLibrariesLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetAllLibrariesUnauthorized{} - -func (e *GetAllLibrariesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetAllLibrariesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetAllLibrariesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetAllLibrariesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetAllLibrariesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetAllLibrariesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetAllLibrariesBadRequest struct { - Errors []GetAllLibrariesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetAllLibrariesBadRequest{} - -func (e *GetAllLibrariesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getavailableclients.go b/models/sdkerrors/getavailableclients.go deleted file mode 100644 index 0b77c41..0000000 --- a/models/sdkerrors/getavailableclients.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetAvailableClientsServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetAvailableClientsServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetAvailableClientsServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetAvailableClientsServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetAvailableClientsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetAvailableClientsUnauthorized struct { - Errors []GetAvailableClientsServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetAvailableClientsUnauthorized{} - -func (e *GetAvailableClientsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetAvailableClientsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetAvailableClientsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetAvailableClientsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetAvailableClientsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetAvailableClientsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetAvailableClientsBadRequest struct { - Errors []GetAvailableClientsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetAvailableClientsBadRequest{} - -func (e *GetAvailableClientsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getbandwidthstatistics.go b/models/sdkerrors/getbandwidthstatistics.go deleted file mode 100644 index ed60752..0000000 --- a/models/sdkerrors/getbandwidthstatistics.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetBandwidthStatisticsStatisticsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetBandwidthStatisticsStatisticsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetBandwidthStatisticsStatisticsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetBandwidthStatisticsStatisticsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetBandwidthStatisticsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetBandwidthStatisticsUnauthorized struct { - Errors []GetBandwidthStatisticsStatisticsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetBandwidthStatisticsUnauthorized{} - -func (e *GetBandwidthStatisticsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetBandwidthStatisticsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetBandwidthStatisticsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetBandwidthStatisticsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetBandwidthStatisticsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetBandwidthStatisticsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetBandwidthStatisticsBadRequest struct { - Errors []GetBandwidthStatisticsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetBandwidthStatisticsBadRequest{} - -func (e *GetBandwidthStatisticsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getbannerimage.go b/models/sdkerrors/getbannerimage.go deleted file mode 100644 index 777ba77..0000000 --- a/models/sdkerrors/getbannerimage.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetBannerImageMediaErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetBannerImageMediaErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetBannerImageMediaErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetBannerImageMediaErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetBannerImageUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetBannerImageUnauthorized struct { - Errors []GetBannerImageMediaErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetBannerImageUnauthorized{} - -func (e *GetBannerImageUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetBannerImageErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetBannerImageErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetBannerImageErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetBannerImageErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetBannerImageBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetBannerImageBadRequest struct { - Errors []GetBannerImageErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetBannerImageBadRequest{} - -func (e *GetBannerImageBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getbutlertasks.go b/models/sdkerrors/getbutlertasks.go deleted file mode 100644 index 10adf82..0000000 --- a/models/sdkerrors/getbutlertasks.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetButlerTasksButlerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetButlerTasksButlerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetButlerTasksButlerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetButlerTasksButlerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetButlerTasksUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetButlerTasksUnauthorized struct { - Errors []GetButlerTasksButlerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetButlerTasksUnauthorized{} - -func (e *GetButlerTasksUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetButlerTasksErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetButlerTasksErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetButlerTasksErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetButlerTasksErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetButlerTasksBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetButlerTasksBadRequest struct { - Errors []GetButlerTasksErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetButlerTasksBadRequest{} - -func (e *GetButlerTasksBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getcompanionsdata.go b/models/sdkerrors/getcompanionsdata.go deleted file mode 100644 index 5da1c85..0000000 --- a/models/sdkerrors/getcompanionsdata.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetCompanionsDataPlexErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetCompanionsDataPlexErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetCompanionsDataPlexErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetCompanionsDataPlexErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetCompanionsDataUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetCompanionsDataUnauthorized struct { - Errors []GetCompanionsDataPlexErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetCompanionsDataUnauthorized{} - -func (e *GetCompanionsDataUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetCompanionsDataErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetCompanionsDataErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetCompanionsDataErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetCompanionsDataErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetCompanionsDataBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetCompanionsDataBadRequest struct { - Errors []GetCompanionsDataErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetCompanionsDataBadRequest{} - -func (e *GetCompanionsDataBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getcountrieslibrary.go b/models/sdkerrors/getcountrieslibrary.go deleted file mode 100644 index 1fa24d8..0000000 --- a/models/sdkerrors/getcountrieslibrary.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetCountriesLibraryLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetCountriesLibraryLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetCountriesLibraryLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetCountriesLibraryLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetCountriesLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetCountriesLibraryUnauthorized struct { - Errors []GetCountriesLibraryLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetCountriesLibraryUnauthorized{} - -func (e *GetCountriesLibraryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetCountriesLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetCountriesLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetCountriesLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetCountriesLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetCountriesLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetCountriesLibraryBadRequest struct { - Errors []GetCountriesLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetCountriesLibraryBadRequest{} - -func (e *GetCountriesLibraryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getdevices.go b/models/sdkerrors/getdevices.go deleted file mode 100644 index 25e28eb..0000000 --- a/models/sdkerrors/getdevices.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetDevicesServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetDevicesServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetDevicesServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetDevicesServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetDevicesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetDevicesUnauthorized struct { - Errors []GetDevicesServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetDevicesUnauthorized{} - -func (e *GetDevicesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetDevicesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetDevicesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetDevicesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetDevicesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetDevicesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetDevicesBadRequest struct { - Errors []GetDevicesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetDevicesBadRequest{} - -func (e *GetDevicesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getfilehash.go b/models/sdkerrors/getfilehash.go deleted file mode 100644 index 4b7246e..0000000 --- a/models/sdkerrors/getfilehash.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetFileHashLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetFileHashLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetFileHashLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetFileHashLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetFileHashUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetFileHashUnauthorized struct { - Errors []GetFileHashLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetFileHashUnauthorized{} - -func (e *GetFileHashUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetFileHashErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetFileHashErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetFileHashErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetFileHashErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetFileHashBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetFileHashBadRequest struct { - Errors []GetFileHashErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetFileHashBadRequest{} - -func (e *GetFileHashBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getgenreslibrary.go b/models/sdkerrors/getgenreslibrary.go deleted file mode 100644 index 1e74d66..0000000 --- a/models/sdkerrors/getgenreslibrary.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetGenresLibraryLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetGenresLibraryLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetGenresLibraryLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetGenresLibraryLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetGenresLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetGenresLibraryUnauthorized struct { - Errors []GetGenresLibraryLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetGenresLibraryUnauthorized{} - -func (e *GetGenresLibraryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetGenresLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetGenresLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetGenresLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetGenresLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetGenresLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetGenresLibraryBadRequest struct { - Errors []GetGenresLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetGenresLibraryBadRequest{} - -func (e *GetGenresLibraryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getgeodata.go b/models/sdkerrors/getgeodata.go deleted file mode 100644 index 0ab03fc..0000000 --- a/models/sdkerrors/getgeodata.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetGeoDataPlexErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetGeoDataPlexErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetGeoDataPlexErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetGeoDataPlexErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetGeoDataUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetGeoDataUnauthorized struct { - Errors []GetGeoDataPlexErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetGeoDataUnauthorized{} - -func (e *GetGeoDataUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetGeoDataErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetGeoDataErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetGeoDataErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetGeoDataErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetGeoDataBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetGeoDataBadRequest struct { - Errors []GetGeoDataErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetGeoDataBadRequest{} - -func (e *GetGeoDataBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getglobalhubs.go b/models/sdkerrors/getglobalhubs.go deleted file mode 100644 index 8196f7e..0000000 --- a/models/sdkerrors/getglobalhubs.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetGlobalHubsHubsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetGlobalHubsHubsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetGlobalHubsHubsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetGlobalHubsHubsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetGlobalHubsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetGlobalHubsUnauthorized struct { - Errors []GetGlobalHubsHubsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetGlobalHubsUnauthorized{} - -func (e *GetGlobalHubsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetGlobalHubsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetGlobalHubsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetGlobalHubsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetGlobalHubsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetGlobalHubsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetGlobalHubsBadRequest struct { - Errors []GetGlobalHubsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetGlobalHubsBadRequest{} - -func (e *GetGlobalHubsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gethomedata.go b/models/sdkerrors/gethomedata.go deleted file mode 100644 index 1971b69..0000000 --- a/models/sdkerrors/gethomedata.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetHomeDataPlexErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetHomeDataPlexErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetHomeDataPlexErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetHomeDataPlexErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetHomeDataUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetHomeDataUnauthorized struct { - Errors []GetHomeDataPlexErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetHomeDataUnauthorized{} - -func (e *GetHomeDataUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetHomeDataErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetHomeDataErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetHomeDataErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetHomeDataErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetHomeDataBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetHomeDataBadRequest struct { - Errors []GetHomeDataErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetHomeDataBadRequest{} - -func (e *GetHomeDataBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getlibrarydetails.go b/models/sdkerrors/getlibrarydetails.go deleted file mode 100644 index 523cf11..0000000 --- a/models/sdkerrors/getlibrarydetails.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetLibraryDetailsLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibraryDetailsLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibraryDetailsLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibraryDetailsLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibraryDetailsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetLibraryDetailsUnauthorized struct { - Errors []GetLibraryDetailsLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibraryDetailsUnauthorized{} - -func (e *GetLibraryDetailsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetLibraryDetailsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibraryDetailsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibraryDetailsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibraryDetailsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibraryDetailsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetLibraryDetailsBadRequest struct { - Errors []GetLibraryDetailsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibraryDetailsBadRequest{} - -func (e *GetLibraryDetailsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getlibraryhubs.go b/models/sdkerrors/getlibraryhubs.go deleted file mode 100644 index f090471..0000000 --- a/models/sdkerrors/getlibraryhubs.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetLibraryHubsHubsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibraryHubsHubsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibraryHubsHubsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibraryHubsHubsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibraryHubsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetLibraryHubsUnauthorized struct { - Errors []GetLibraryHubsHubsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibraryHubsUnauthorized{} - -func (e *GetLibraryHubsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetLibraryHubsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibraryHubsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibraryHubsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibraryHubsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibraryHubsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetLibraryHubsBadRequest struct { - Errors []GetLibraryHubsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibraryHubsBadRequest{} - -func (e *GetLibraryHubsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getlibraryitems.go b/models/sdkerrors/getlibraryitems.go deleted file mode 100644 index bafc564..0000000 --- a/models/sdkerrors/getlibraryitems.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetLibraryItemsLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibraryItemsLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibraryItemsLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibraryItemsLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibraryItemsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetLibraryItemsUnauthorized struct { - Errors []GetLibraryItemsLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibraryItemsUnauthorized{} - -func (e *GetLibraryItemsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetLibraryItemsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibraryItemsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibraryItemsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibraryItemsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibraryItemsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetLibraryItemsBadRequest struct { - Errors []GetLibraryItemsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibraryItemsBadRequest{} - -func (e *GetLibraryItemsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getlibrarysectionsall.go b/models/sdkerrors/getlibrarysectionsall.go deleted file mode 100644 index c985d3e..0000000 --- a/models/sdkerrors/getlibrarysectionsall.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetLibrarySectionsAllLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibrarySectionsAllLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibrarySectionsAllLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibrarySectionsAllLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibrarySectionsAllUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetLibrarySectionsAllUnauthorized struct { - Errors []GetLibrarySectionsAllLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibrarySectionsAllUnauthorized{} - -func (e *GetLibrarySectionsAllUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetLibrarySectionsAllErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetLibrarySectionsAllErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetLibrarySectionsAllErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetLibrarySectionsAllErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetLibrarySectionsAllBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetLibrarySectionsAllBadRequest struct { - Errors []GetLibrarySectionsAllErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetLibrarySectionsAllBadRequest{} - -func (e *GetLibrarySectionsAllBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getmediametadata.go b/models/sdkerrors/getmediametadata.go deleted file mode 100644 index 93db302..0000000 --- a/models/sdkerrors/getmediametadata.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetMediaMetaDataLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMediaMetaDataLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMediaMetaDataLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMediaMetaDataLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMediaMetaDataUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetMediaMetaDataUnauthorized struct { - Errors []GetMediaMetaDataLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMediaMetaDataUnauthorized{} - -func (e *GetMediaMetaDataUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetMediaMetaDataErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMediaMetaDataErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMediaMetaDataErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMediaMetaDataErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMediaMetaDataBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetMediaMetaDataBadRequest struct { - Errors []GetMediaMetaDataErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMediaMetaDataBadRequest{} - -func (e *GetMediaMetaDataBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getmediaproviders.go b/models/sdkerrors/getmediaproviders.go deleted file mode 100644 index 28c3223..0000000 --- a/models/sdkerrors/getmediaproviders.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetMediaProvidersServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMediaProvidersServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMediaProvidersServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMediaProvidersServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMediaProvidersUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetMediaProvidersUnauthorized struct { - Errors []GetMediaProvidersServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMediaProvidersUnauthorized{} - -func (e *GetMediaProvidersUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetMediaProvidersErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMediaProvidersErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMediaProvidersErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMediaProvidersErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMediaProvidersBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetMediaProvidersBadRequest struct { - Errors []GetMediaProvidersErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMediaProvidersBadRequest{} - -func (e *GetMediaProvidersBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getmetadatachildren.go b/models/sdkerrors/getmetadatachildren.go deleted file mode 100644 index dd4d8f3..0000000 --- a/models/sdkerrors/getmetadatachildren.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetMetadataChildrenLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMetadataChildrenLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMetadataChildrenLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMetadataChildrenLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMetadataChildrenUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetMetadataChildrenUnauthorized struct { - Errors []GetMetadataChildrenLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMetadataChildrenUnauthorized{} - -func (e *GetMetadataChildrenUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetMetadataChildrenErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMetadataChildrenErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMetadataChildrenErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMetadataChildrenErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMetadataChildrenBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetMetadataChildrenBadRequest struct { - Errors []GetMetadataChildrenErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMetadataChildrenBadRequest{} - -func (e *GetMetadataChildrenBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getmyplexaccount.go b/models/sdkerrors/getmyplexaccount.go deleted file mode 100644 index 6396289..0000000 --- a/models/sdkerrors/getmyplexaccount.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetMyPlexAccountServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMyPlexAccountServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMyPlexAccountServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMyPlexAccountServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMyPlexAccountUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetMyPlexAccountUnauthorized struct { - Errors []GetMyPlexAccountServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMyPlexAccountUnauthorized{} - -func (e *GetMyPlexAccountUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetMyPlexAccountErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetMyPlexAccountErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetMyPlexAccountErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetMyPlexAccountErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetMyPlexAccountBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetMyPlexAccountBadRequest struct { - Errors []GetMyPlexAccountErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetMyPlexAccountBadRequest{} - -func (e *GetMyPlexAccountBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getpin.go b/models/sdkerrors/getpin.go deleted file mode 100644 index f789f9f..0000000 --- a/models/sdkerrors/getpin.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetPinErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPinErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPinErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPinErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPinBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetPinBadRequest struct { - Errors []GetPinErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPinBadRequest{} - -func (e *GetPinBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getplaylist.go b/models/sdkerrors/getplaylist.go deleted file mode 100644 index 8211e1e..0000000 --- a/models/sdkerrors/getplaylist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetPlaylistPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPlaylistPlaylistsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPlaylistPlaylistsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPlaylistPlaylistsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetPlaylistUnauthorized struct { - Errors []GetPlaylistPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPlaylistUnauthorized{} - -func (e *GetPlaylistUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetPlaylistErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPlaylistErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPlaylistErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPlaylistErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetPlaylistBadRequest struct { - Errors []GetPlaylistErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPlaylistBadRequest{} - -func (e *GetPlaylistBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getplaylistcontents.go b/models/sdkerrors/getplaylistcontents.go deleted file mode 100644 index a4937a3..0000000 --- a/models/sdkerrors/getplaylistcontents.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetPlaylistContentsPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPlaylistContentsPlaylistsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPlaylistContentsPlaylistsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPlaylistContentsPlaylistsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPlaylistContentsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetPlaylistContentsUnauthorized struct { - Errors []GetPlaylistContentsPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPlaylistContentsUnauthorized{} - -func (e *GetPlaylistContentsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetPlaylistContentsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPlaylistContentsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPlaylistContentsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPlaylistContentsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPlaylistContentsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetPlaylistContentsBadRequest struct { - Errors []GetPlaylistContentsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPlaylistContentsBadRequest{} - -func (e *GetPlaylistContentsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getplaylists.go b/models/sdkerrors/getplaylists.go deleted file mode 100644 index 83fbc86..0000000 --- a/models/sdkerrors/getplaylists.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetPlaylistsPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPlaylistsPlaylistsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPlaylistsPlaylistsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPlaylistsPlaylistsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPlaylistsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetPlaylistsUnauthorized struct { - Errors []GetPlaylistsPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPlaylistsUnauthorized{} - -func (e *GetPlaylistsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetPlaylistsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetPlaylistsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetPlaylistsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetPlaylistsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetPlaylistsBadRequest struct { - Errors []GetPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetPlaylistsBadRequest{} - -func (e *GetPlaylistsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getrecentlyaddedlibrary.go b/models/sdkerrors/getrecentlyaddedlibrary.go deleted file mode 100644 index 6237248..0000000 --- a/models/sdkerrors/getrecentlyaddedlibrary.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetRecentlyAddedLibraryLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetRecentlyAddedLibraryLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetRecentlyAddedLibraryLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetRecentlyAddedLibraryLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetRecentlyAddedLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetRecentlyAddedLibraryUnauthorized struct { - Errors []GetRecentlyAddedLibraryLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetRecentlyAddedLibraryUnauthorized{} - -func (e *GetRecentlyAddedLibraryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetRecentlyAddedLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetRecentlyAddedLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetRecentlyAddedLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetRecentlyAddedLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetRecentlyAddedLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetRecentlyAddedLibraryBadRequest struct { - Errors []GetRecentlyAddedLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetRecentlyAddedLibraryBadRequest{} - -func (e *GetRecentlyAddedLibraryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getrefreshlibrarymetadata.go b/models/sdkerrors/getrefreshlibrarymetadata.go deleted file mode 100644 index cd41ebd..0000000 --- a/models/sdkerrors/getrefreshlibrarymetadata.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetRefreshLibraryMetadataLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetRefreshLibraryMetadataLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetRefreshLibraryMetadataLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetRefreshLibraryMetadataLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetRefreshLibraryMetadataUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetRefreshLibraryMetadataUnauthorized struct { - Errors []GetRefreshLibraryMetadataLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetRefreshLibraryMetadataUnauthorized{} - -func (e *GetRefreshLibraryMetadataUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetRefreshLibraryMetadataErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetRefreshLibraryMetadataErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetRefreshLibraryMetadataErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetRefreshLibraryMetadataErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetRefreshLibraryMetadataBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetRefreshLibraryMetadataBadRequest struct { - Errors []GetRefreshLibraryMetadataErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetRefreshLibraryMetadataBadRequest{} - -func (e *GetRefreshLibraryMetadataBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getresizedphoto.go b/models/sdkerrors/getresizedphoto.go deleted file mode 100644 index ccf2010..0000000 --- a/models/sdkerrors/getresizedphoto.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetResizedPhotoServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetResizedPhotoServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetResizedPhotoServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetResizedPhotoServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetResizedPhotoUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetResizedPhotoUnauthorized struct { - Errors []GetResizedPhotoServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetResizedPhotoUnauthorized{} - -func (e *GetResizedPhotoUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetResizedPhotoErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetResizedPhotoErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetResizedPhotoErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetResizedPhotoErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetResizedPhotoBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetResizedPhotoBadRequest struct { - Errors []GetResizedPhotoErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetResizedPhotoBadRequest{} - -func (e *GetResizedPhotoBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getresourcesstatistics.go b/models/sdkerrors/getresourcesstatistics.go deleted file mode 100644 index 4088be3..0000000 --- a/models/sdkerrors/getresourcesstatistics.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetResourcesStatisticsStatisticsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetResourcesStatisticsStatisticsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetResourcesStatisticsStatisticsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetResourcesStatisticsStatisticsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetResourcesStatisticsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetResourcesStatisticsUnauthorized struct { - Errors []GetResourcesStatisticsStatisticsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetResourcesStatisticsUnauthorized{} - -func (e *GetResourcesStatisticsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetResourcesStatisticsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetResourcesStatisticsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetResourcesStatisticsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetResourcesStatisticsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetResourcesStatisticsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetResourcesStatisticsBadRequest struct { - Errors []GetResourcesStatisticsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetResourcesStatisticsBadRequest{} - -func (e *GetResourcesStatisticsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getsearchalllibraries.go b/models/sdkerrors/getsearchalllibraries.go deleted file mode 100644 index 82e7b10..0000000 --- a/models/sdkerrors/getsearchalllibraries.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetSearchAllLibrariesLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSearchAllLibrariesLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSearchAllLibrariesLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSearchAllLibrariesLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSearchAllLibrariesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetSearchAllLibrariesUnauthorized struct { - Errors []GetSearchAllLibrariesLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSearchAllLibrariesUnauthorized{} - -func (e *GetSearchAllLibrariesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetSearchAllLibrariesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSearchAllLibrariesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSearchAllLibrariesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSearchAllLibrariesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSearchAllLibrariesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetSearchAllLibrariesBadRequest struct { - Errors []GetSearchAllLibrariesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSearchAllLibrariesBadRequest{} - -func (e *GetSearchAllLibrariesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getsearchlibrary.go b/models/sdkerrors/getsearchlibrary.go deleted file mode 100644 index 4209d22..0000000 --- a/models/sdkerrors/getsearchlibrary.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetSearchLibraryLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSearchLibraryLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSearchLibraryLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSearchLibraryLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSearchLibraryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetSearchLibraryUnauthorized struct { - Errors []GetSearchLibraryLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSearchLibraryUnauthorized{} - -func (e *GetSearchLibraryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetSearchLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSearchLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSearchLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSearchLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSearchLibraryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetSearchLibraryBadRequest struct { - Errors []GetSearchLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSearchLibraryBadRequest{} - -func (e *GetSearchLibraryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getsearchresults.go b/models/sdkerrors/getsearchresults.go deleted file mode 100644 index 252a8ca..0000000 --- a/models/sdkerrors/getsearchresults.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetSearchResultsSearchErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSearchResultsSearchErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSearchResultsSearchErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSearchResultsSearchErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSearchResultsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetSearchResultsUnauthorized struct { - Errors []GetSearchResultsSearchErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSearchResultsUnauthorized{} - -func (e *GetSearchResultsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetSearchResultsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSearchResultsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSearchResultsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSearchResultsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSearchResultsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetSearchResultsBadRequest struct { - Errors []GetSearchResultsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSearchResultsBadRequest{} - -func (e *GetSearchResultsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getserveractivities.go b/models/sdkerrors/getserveractivities.go deleted file mode 100644 index 8ad1dbd..0000000 --- a/models/sdkerrors/getserveractivities.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetServerActivitiesActivitiesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerActivitiesActivitiesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerActivitiesActivitiesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerActivitiesActivitiesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerActivitiesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetServerActivitiesUnauthorized struct { - Errors []GetServerActivitiesActivitiesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerActivitiesUnauthorized{} - -func (e *GetServerActivitiesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetServerActivitiesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerActivitiesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerActivitiesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerActivitiesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerActivitiesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetServerActivitiesBadRequest struct { - Errors []GetServerActivitiesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerActivitiesBadRequest{} - -func (e *GetServerActivitiesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getservercapabilities.go b/models/sdkerrors/getservercapabilities.go deleted file mode 100644 index b109076..0000000 --- a/models/sdkerrors/getservercapabilities.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetServerCapabilitiesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerCapabilitiesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerCapabilitiesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerCapabilitiesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerCapabilitiesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetServerCapabilitiesUnauthorized struct { - Errors []GetServerCapabilitiesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerCapabilitiesUnauthorized{} - -func (e *GetServerCapabilitiesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type Errors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (e *Errors) GetCode() *int { - if e == nil { - return nil - } - return e.Code -} - -func (e *Errors) GetMessage() *string { - if e == nil { - return nil - } - return e.Message -} - -func (e *Errors) GetStatus() *int { - if e == nil { - return nil - } - return e.Status -} - -// GetServerCapabilitiesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetServerCapabilitiesBadRequest struct { - Errors []Errors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerCapabilitiesBadRequest{} - -func (e *GetServerCapabilitiesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getserveridentity.go b/models/sdkerrors/getserveridentity.go deleted file mode 100644 index 8b91034..0000000 --- a/models/sdkerrors/getserveridentity.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "net/http" -) - -// GetServerIdentityRequestTimeout - Request Timeout -type GetServerIdentityRequestTimeout struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerIdentityRequestTimeout{} - -func (e *GetServerIdentityRequestTimeout) Error() string { - if e.Message == nil { - return "unknown error" - } - - return *e.Message -} diff --git a/models/sdkerrors/getserverlist.go b/models/sdkerrors/getserverlist.go deleted file mode 100644 index 0ffcb8d..0000000 --- a/models/sdkerrors/getserverlist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetServerListServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerListServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerListServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerListServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerListUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetServerListUnauthorized struct { - Errors []GetServerListServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerListUnauthorized{} - -func (e *GetServerListUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetServerListErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerListErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerListErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerListErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerListBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetServerListBadRequest struct { - Errors []GetServerListErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerListBadRequest{} - -func (e *GetServerListBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getserverpreferences.go b/models/sdkerrors/getserverpreferences.go deleted file mode 100644 index 42e91de..0000000 --- a/models/sdkerrors/getserverpreferences.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetServerPreferencesServerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerPreferencesServerErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerPreferencesServerErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerPreferencesServerErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerPreferencesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetServerPreferencesUnauthorized struct { - Errors []GetServerPreferencesServerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerPreferencesUnauthorized{} - -func (e *GetServerPreferencesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetServerPreferencesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerPreferencesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerPreferencesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerPreferencesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerPreferencesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetServerPreferencesBadRequest struct { - Errors []GetServerPreferencesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerPreferencesBadRequest{} - -func (e *GetServerPreferencesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getserverresources.go b/models/sdkerrors/getserverresources.go deleted file mode 100644 index 4ee43a4..0000000 --- a/models/sdkerrors/getserverresources.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetServerResourcesPlexErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerResourcesPlexErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerResourcesPlexErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerResourcesPlexErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerResourcesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetServerResourcesUnauthorized struct { - Errors []GetServerResourcesPlexErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerResourcesUnauthorized{} - -func (e *GetServerResourcesUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetServerResourcesErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetServerResourcesErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetServerResourcesErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetServerResourcesErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetServerResourcesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetServerResourcesBadRequest struct { - Errors []GetServerResourcesErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetServerResourcesBadRequest{} - -func (e *GetServerResourcesBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getsessionhistory.go b/models/sdkerrors/getsessionhistory.go deleted file mode 100644 index 9280a08..0000000 --- a/models/sdkerrors/getsessionhistory.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetSessionHistorySessionsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSessionHistorySessionsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSessionHistorySessionsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSessionHistorySessionsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSessionHistoryUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetSessionHistoryUnauthorized struct { - Errors []GetSessionHistorySessionsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSessionHistoryUnauthorized{} - -func (e *GetSessionHistoryUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetSessionHistoryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSessionHistoryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSessionHistoryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSessionHistoryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSessionHistoryBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetSessionHistoryBadRequest struct { - Errors []GetSessionHistoryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSessionHistoryBadRequest{} - -func (e *GetSessionHistoryBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getsessions.go b/models/sdkerrors/getsessions.go deleted file mode 100644 index 704498c..0000000 --- a/models/sdkerrors/getsessions.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetSessionsSessionsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSessionsSessionsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSessionsSessionsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSessionsSessionsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSessionsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetSessionsUnauthorized struct { - Errors []GetSessionsSessionsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSessionsUnauthorized{} - -func (e *GetSessionsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetSessionsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSessionsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSessionsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSessionsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSessionsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetSessionsBadRequest struct { - Errors []GetSessionsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSessionsBadRequest{} - -func (e *GetSessionsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getsourceconnectioninformation.go b/models/sdkerrors/getsourceconnectioninformation.go deleted file mode 100644 index b433595..0000000 --- a/models/sdkerrors/getsourceconnectioninformation.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetSourceConnectionInformationAuthenticationErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSourceConnectionInformationAuthenticationErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSourceConnectionInformationAuthenticationErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSourceConnectionInformationAuthenticationErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSourceConnectionInformationUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetSourceConnectionInformationUnauthorized struct { - Errors []GetSourceConnectionInformationAuthenticationErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSourceConnectionInformationUnauthorized{} - -func (e *GetSourceConnectionInformationUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetSourceConnectionInformationErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetSourceConnectionInformationErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetSourceConnectionInformationErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetSourceConnectionInformationErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetSourceConnectionInformationBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetSourceConnectionInformationBadRequest struct { - Errors []GetSourceConnectionInformationErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetSourceConnectionInformationBadRequest{} - -func (e *GetSourceConnectionInformationBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getstatistics.go b/models/sdkerrors/getstatistics.go deleted file mode 100644 index abb87ec..0000000 --- a/models/sdkerrors/getstatistics.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetStatisticsStatisticsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetStatisticsStatisticsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetStatisticsStatisticsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetStatisticsStatisticsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetStatisticsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetStatisticsUnauthorized struct { - Errors []GetStatisticsStatisticsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetStatisticsUnauthorized{} - -func (e *GetStatisticsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetStatisticsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetStatisticsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetStatisticsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetStatisticsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetStatisticsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetStatisticsBadRequest struct { - Errors []GetStatisticsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetStatisticsBadRequest{} - -func (e *GetStatisticsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getthumbimage.go b/models/sdkerrors/getthumbimage.go deleted file mode 100644 index 713b784..0000000 --- a/models/sdkerrors/getthumbimage.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetThumbImageMediaErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetThumbImageMediaErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetThumbImageMediaErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetThumbImageMediaErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetThumbImageUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetThumbImageUnauthorized struct { - Errors []GetThumbImageMediaErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetThumbImageUnauthorized{} - -func (e *GetThumbImageUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetThumbImageErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetThumbImageErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetThumbImageErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetThumbImageErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetThumbImageBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetThumbImageBadRequest struct { - Errors []GetThumbImageErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetThumbImageBadRequest{} - -func (e *GetThumbImageBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gettimeline.go b/models/sdkerrors/gettimeline.go deleted file mode 100644 index 85ea889..0000000 --- a/models/sdkerrors/gettimeline.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetTimelineVideoErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTimelineVideoErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTimelineVideoErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTimelineVideoErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTimelineUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetTimelineUnauthorized struct { - Errors []GetTimelineVideoErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTimelineUnauthorized{} - -func (e *GetTimelineUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetTimelineErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTimelineErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTimelineErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTimelineErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTimelineBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetTimelineBadRequest struct { - Errors []GetTimelineErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTimelineBadRequest{} - -func (e *GetTimelineBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gettokenbypinid.go b/models/sdkerrors/gettokenbypinid.go deleted file mode 100644 index 8cf0808..0000000 --- a/models/sdkerrors/gettokenbypinid.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetTokenByPinIDPlexErrors struct { - Code *int64 `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} - -func (g *GetTokenByPinIDPlexErrors) GetCode() *int64 { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTokenByPinIDPlexErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -// GetTokenByPinIDResponseBody - Not Found or Expired -type GetTokenByPinIDResponseBody struct { - Errors []GetTokenByPinIDPlexErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTokenByPinIDResponseBody{} - -func (e *GetTokenByPinIDResponseBody) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetTokenByPinIDErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTokenByPinIDErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTokenByPinIDErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTokenByPinIDErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTokenByPinIDBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetTokenByPinIDBadRequest struct { - Errors []GetTokenByPinIDErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTokenByPinIDBadRequest{} - -func (e *GetTokenByPinIDBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gettokendetails.go b/models/sdkerrors/gettokendetails.go deleted file mode 100644 index 2781555..0000000 --- a/models/sdkerrors/gettokendetails.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetTokenDetailsAuthenticationErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTokenDetailsAuthenticationErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTokenDetailsAuthenticationErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTokenDetailsAuthenticationErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTokenDetailsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetTokenDetailsUnauthorized struct { - Errors []GetTokenDetailsAuthenticationErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTokenDetailsUnauthorized{} - -func (e *GetTokenDetailsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetTokenDetailsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTokenDetailsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTokenDetailsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTokenDetailsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTokenDetailsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetTokenDetailsBadRequest struct { - Errors []GetTokenDetailsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTokenDetailsBadRequest{} - -func (e *GetTokenDetailsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gettopwatchedcontent.go b/models/sdkerrors/gettopwatchedcontent.go deleted file mode 100644 index 00fac4b..0000000 --- a/models/sdkerrors/gettopwatchedcontent.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetTopWatchedContentLibraryErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTopWatchedContentLibraryErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTopWatchedContentLibraryErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTopWatchedContentLibraryErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTopWatchedContentUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetTopWatchedContentUnauthorized struct { - Errors []GetTopWatchedContentLibraryErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTopWatchedContentUnauthorized{} - -func (e *GetTopWatchedContentUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetTopWatchedContentErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTopWatchedContentErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTopWatchedContentErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTopWatchedContentErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTopWatchedContentBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetTopWatchedContentBadRequest struct { - Errors []GetTopWatchedContentErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTopWatchedContentBadRequest{} - -func (e *GetTopWatchedContentBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gettranscodesessions.go b/models/sdkerrors/gettranscodesessions.go deleted file mode 100644 index 99ec7fb..0000000 --- a/models/sdkerrors/gettranscodesessions.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetTranscodeSessionsSessionsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTranscodeSessionsSessionsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTranscodeSessionsSessionsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTranscodeSessionsSessionsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTranscodeSessionsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetTranscodeSessionsUnauthorized struct { - Errors []GetTranscodeSessionsSessionsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTranscodeSessionsUnauthorized{} - -func (e *GetTranscodeSessionsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetTranscodeSessionsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTranscodeSessionsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTranscodeSessionsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTranscodeSessionsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTranscodeSessionsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetTranscodeSessionsBadRequest struct { - Errors []GetTranscodeSessionsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTranscodeSessionsBadRequest{} - -func (e *GetTranscodeSessionsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/gettransienttoken.go b/models/sdkerrors/gettransienttoken.go deleted file mode 100644 index 2dbe852..0000000 --- a/models/sdkerrors/gettransienttoken.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetTransientTokenAuthenticationErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTransientTokenAuthenticationErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTransientTokenAuthenticationErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTransientTokenAuthenticationErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTransientTokenUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetTransientTokenUnauthorized struct { - Errors []GetTransientTokenAuthenticationErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTransientTokenUnauthorized{} - -func (e *GetTransientTokenUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetTransientTokenErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetTransientTokenErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetTransientTokenErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetTransientTokenErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetTransientTokenBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetTransientTokenBadRequest struct { - Errors []GetTransientTokenErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetTransientTokenBadRequest{} - -func (e *GetTransientTokenBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getupdatestatus.go b/models/sdkerrors/getupdatestatus.go deleted file mode 100644 index df1c58e..0000000 --- a/models/sdkerrors/getupdatestatus.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetUpdateStatusUpdaterErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetUpdateStatusUpdaterErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetUpdateStatusUpdaterErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetUpdateStatusUpdaterErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetUpdateStatusUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetUpdateStatusUnauthorized struct { - Errors []GetUpdateStatusUpdaterErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetUpdateStatusUnauthorized{} - -func (e *GetUpdateStatusUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetUpdateStatusErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetUpdateStatusErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetUpdateStatusErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetUpdateStatusErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetUpdateStatusBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetUpdateStatusBadRequest struct { - Errors []GetUpdateStatusErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetUpdateStatusBadRequest{} - -func (e *GetUpdateStatusBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getuserfriends.go b/models/sdkerrors/getuserfriends.go deleted file mode 100644 index b6f34a7..0000000 --- a/models/sdkerrors/getuserfriends.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetUserFriendsPlexErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetUserFriendsPlexErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetUserFriendsPlexErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetUserFriendsPlexErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetUserFriendsUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetUserFriendsUnauthorized struct { - Errors []GetUserFriendsPlexErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetUserFriendsUnauthorized{} - -func (e *GetUserFriendsUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetUserFriendsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetUserFriendsErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetUserFriendsErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetUserFriendsErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetUserFriendsBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetUserFriendsBadRequest struct { - Errors []GetUserFriendsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetUserFriendsBadRequest{} - -func (e *GetUserFriendsBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getusers.go b/models/sdkerrors/getusers.go deleted file mode 100644 index faf9a6e..0000000 --- a/models/sdkerrors/getusers.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetUsersUsersErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetUsersUsersErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetUsersUsersErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetUsersUsersErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetUsersUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetUsersUnauthorized struct { - Errors []GetUsersUsersErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetUsersUnauthorized{} - -func (e *GetUsersUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetUsersErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetUsersErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetUsersErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetUsersErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetUsersBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetUsersBadRequest struct { - Errors []GetUsersErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetUsersBadRequest{} - -func (e *GetUsersBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/getwatchlist.go b/models/sdkerrors/getwatchlist.go deleted file mode 100644 index 2839188..0000000 --- a/models/sdkerrors/getwatchlist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type GetWatchListWatchlistErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetWatchListWatchlistErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetWatchListWatchlistErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetWatchListWatchlistErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetWatchListUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetWatchListUnauthorized struct { - Errors []GetWatchListWatchlistErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetWatchListUnauthorized{} - -func (e *GetWatchListUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type GetWatchListErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (g *GetWatchListErrors) GetCode() *int { - if g == nil { - return nil - } - return g.Code -} - -func (g *GetWatchListErrors) GetMessage() *string { - if g == nil { - return nil - } - return g.Message -} - -func (g *GetWatchListErrors) GetStatus() *int { - if g == nil { - return nil - } - return g.Status -} - -// GetWatchListBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type GetWatchListBadRequest struct { - Errors []GetWatchListErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &GetWatchListBadRequest{} - -func (e *GetWatchListBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/logline.go b/models/sdkerrors/logline.go deleted file mode 100644 index 655b9fb..0000000 --- a/models/sdkerrors/logline.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type LogLineLogErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (l *LogLineLogErrors) GetCode() *int { - if l == nil { - return nil - } - return l.Code -} - -func (l *LogLineLogErrors) GetMessage() *string { - if l == nil { - return nil - } - return l.Message -} - -func (l *LogLineLogErrors) GetStatus() *int { - if l == nil { - return nil - } - return l.Status -} - -// LogLineUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type LogLineUnauthorized struct { - Errors []LogLineLogErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &LogLineUnauthorized{} - -func (e *LogLineUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type LogLineErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (l *LogLineErrors) GetCode() *int { - if l == nil { - return nil - } - return l.Code -} - -func (l *LogLineErrors) GetMessage() *string { - if l == nil { - return nil - } - return l.Message -} - -func (l *LogLineErrors) GetStatus() *int { - if l == nil { - return nil - } - return l.Status -} - -// LogLineBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type LogLineBadRequest struct { - Errors []LogLineErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &LogLineBadRequest{} - -func (e *LogLineBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/logmultiline.go b/models/sdkerrors/logmultiline.go deleted file mode 100644 index fe87a77..0000000 --- a/models/sdkerrors/logmultiline.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type LogMultiLineLogErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (l *LogMultiLineLogErrors) GetCode() *int { - if l == nil { - return nil - } - return l.Code -} - -func (l *LogMultiLineLogErrors) GetMessage() *string { - if l == nil { - return nil - } - return l.Message -} - -func (l *LogMultiLineLogErrors) GetStatus() *int { - if l == nil { - return nil - } - return l.Status -} - -// LogMultiLineUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type LogMultiLineUnauthorized struct { - Errors []LogMultiLineLogErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &LogMultiLineUnauthorized{} - -func (e *LogMultiLineUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type LogMultiLineErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (l *LogMultiLineErrors) GetCode() *int { - if l == nil { - return nil - } - return l.Code -} - -func (l *LogMultiLineErrors) GetMessage() *string { - if l == nil { - return nil - } - return l.Message -} - -func (l *LogMultiLineErrors) GetStatus() *int { - if l == nil { - return nil - } - return l.Status -} - -// LogMultiLineBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type LogMultiLineBadRequest struct { - Errors []LogMultiLineErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &LogMultiLineBadRequest{} - -func (e *LogMultiLineBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/markplayed.go b/models/sdkerrors/markplayed.go deleted file mode 100644 index 284ab0b..0000000 --- a/models/sdkerrors/markplayed.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type MarkPlayedMediaErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (m *MarkPlayedMediaErrors) GetCode() *int { - if m == nil { - return nil - } - return m.Code -} - -func (m *MarkPlayedMediaErrors) GetMessage() *string { - if m == nil { - return nil - } - return m.Message -} - -func (m *MarkPlayedMediaErrors) GetStatus() *int { - if m == nil { - return nil - } - return m.Status -} - -// MarkPlayedUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type MarkPlayedUnauthorized struct { - Errors []MarkPlayedMediaErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &MarkPlayedUnauthorized{} - -func (e *MarkPlayedUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type MarkPlayedErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (m *MarkPlayedErrors) GetCode() *int { - if m == nil { - return nil - } - return m.Code -} - -func (m *MarkPlayedErrors) GetMessage() *string { - if m == nil { - return nil - } - return m.Message -} - -func (m *MarkPlayedErrors) GetStatus() *int { - if m == nil { - return nil - } - return m.Status -} - -// MarkPlayedBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type MarkPlayedBadRequest struct { - Errors []MarkPlayedErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &MarkPlayedBadRequest{} - -func (e *MarkPlayedBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/markunplayed.go b/models/sdkerrors/markunplayed.go deleted file mode 100644 index 71af3dc..0000000 --- a/models/sdkerrors/markunplayed.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type MarkUnplayedMediaErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (m *MarkUnplayedMediaErrors) GetCode() *int { - if m == nil { - return nil - } - return m.Code -} - -func (m *MarkUnplayedMediaErrors) GetMessage() *string { - if m == nil { - return nil - } - return m.Message -} - -func (m *MarkUnplayedMediaErrors) GetStatus() *int { - if m == nil { - return nil - } - return m.Status -} - -// MarkUnplayedUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type MarkUnplayedUnauthorized struct { - Errors []MarkUnplayedMediaErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &MarkUnplayedUnauthorized{} - -func (e *MarkUnplayedUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type MarkUnplayedErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (m *MarkUnplayedErrors) GetCode() *int { - if m == nil { - return nil - } - return m.Code -} - -func (m *MarkUnplayedErrors) GetMessage() *string { - if m == nil { - return nil - } - return m.Message -} - -func (m *MarkUnplayedErrors) GetStatus() *int { - if m == nil { - return nil - } - return m.Status -} - -// MarkUnplayedBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type MarkUnplayedBadRequest struct { - Errors []MarkUnplayedErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &MarkUnplayedBadRequest{} - -func (e *MarkUnplayedBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/performsearch.go b/models/sdkerrors/performsearch.go deleted file mode 100644 index b886aad..0000000 --- a/models/sdkerrors/performsearch.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type PerformSearchSearchErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (p *PerformSearchSearchErrors) GetCode() *int { - if p == nil { - return nil - } - return p.Code -} - -func (p *PerformSearchSearchErrors) GetMessage() *string { - if p == nil { - return nil - } - return p.Message -} - -func (p *PerformSearchSearchErrors) GetStatus() *int { - if p == nil { - return nil - } - return p.Status -} - -// PerformSearchUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type PerformSearchUnauthorized struct { - Errors []PerformSearchSearchErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &PerformSearchUnauthorized{} - -func (e *PerformSearchUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type PerformSearchErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (p *PerformSearchErrors) GetCode() *int { - if p == nil { - return nil - } - return p.Code -} - -func (p *PerformSearchErrors) GetMessage() *string { - if p == nil { - return nil - } - return p.Message -} - -func (p *PerformSearchErrors) GetStatus() *int { - if p == nil { - return nil - } - return p.Status -} - -// PerformSearchBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type PerformSearchBadRequest struct { - Errors []PerformSearchErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &PerformSearchBadRequest{} - -func (e *PerformSearchBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/performvoicesearch.go b/models/sdkerrors/performvoicesearch.go deleted file mode 100644 index 10066d3..0000000 --- a/models/sdkerrors/performvoicesearch.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type PerformVoiceSearchSearchErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (p *PerformVoiceSearchSearchErrors) GetCode() *int { - if p == nil { - return nil - } - return p.Code -} - -func (p *PerformVoiceSearchSearchErrors) GetMessage() *string { - if p == nil { - return nil - } - return p.Message -} - -func (p *PerformVoiceSearchSearchErrors) GetStatus() *int { - if p == nil { - return nil - } - return p.Status -} - -// PerformVoiceSearchUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type PerformVoiceSearchUnauthorized struct { - Errors []PerformVoiceSearchSearchErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &PerformVoiceSearchUnauthorized{} - -func (e *PerformVoiceSearchUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type PerformVoiceSearchErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (p *PerformVoiceSearchErrors) GetCode() *int { - if p == nil { - return nil - } - return p.Code -} - -func (p *PerformVoiceSearchErrors) GetMessage() *string { - if p == nil { - return nil - } - return p.Message -} - -func (p *PerformVoiceSearchErrors) GetStatus() *int { - if p == nil { - return nil - } - return p.Status -} - -// PerformVoiceSearchBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type PerformVoiceSearchBadRequest struct { - Errors []PerformVoiceSearchErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &PerformVoiceSearchBadRequest{} - -func (e *PerformVoiceSearchBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/postuserssignindata.go b/models/sdkerrors/postuserssignindata.go deleted file mode 100644 index fad490f..0000000 --- a/models/sdkerrors/postuserssignindata.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type PostUsersSignInDataAuthenticationErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (p *PostUsersSignInDataAuthenticationErrors) GetCode() *int { - if p == nil { - return nil - } - return p.Code -} - -func (p *PostUsersSignInDataAuthenticationErrors) GetMessage() *string { - if p == nil { - return nil - } - return p.Message -} - -func (p *PostUsersSignInDataAuthenticationErrors) GetStatus() *int { - if p == nil { - return nil - } - return p.Status -} - -// PostUsersSignInDataUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type PostUsersSignInDataUnauthorized struct { - Errors []PostUsersSignInDataAuthenticationErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &PostUsersSignInDataUnauthorized{} - -func (e *PostUsersSignInDataUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type PostUsersSignInDataErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (p *PostUsersSignInDataErrors) GetCode() *int { - if p == nil { - return nil - } - return p.Code -} - -func (p *PostUsersSignInDataErrors) GetMessage() *string { - if p == nil { - return nil - } - return p.Message -} - -func (p *PostUsersSignInDataErrors) GetStatus() *int { - if p == nil { - return nil - } - return p.Status -} - -// PostUsersSignInDataBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type PostUsersSignInDataBadRequest struct { - Errors []PostUsersSignInDataErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &PostUsersSignInDataBadRequest{} - -func (e *PostUsersSignInDataBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/startalltasks.go b/models/sdkerrors/startalltasks.go deleted file mode 100644 index a967384..0000000 --- a/models/sdkerrors/startalltasks.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type StartAllTasksButlerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StartAllTasksButlerErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StartAllTasksButlerErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StartAllTasksButlerErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StartAllTasksUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type StartAllTasksUnauthorized struct { - Errors []StartAllTasksButlerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StartAllTasksUnauthorized{} - -func (e *StartAllTasksUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type StartAllTasksErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StartAllTasksErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StartAllTasksErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StartAllTasksErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StartAllTasksBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type StartAllTasksBadRequest struct { - Errors []StartAllTasksErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StartAllTasksBadRequest{} - -func (e *StartAllTasksBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/starttask.go b/models/sdkerrors/starttask.go deleted file mode 100644 index 1959755..0000000 --- a/models/sdkerrors/starttask.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type StartTaskButlerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StartTaskButlerErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StartTaskButlerErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StartTaskButlerErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StartTaskUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type StartTaskUnauthorized struct { - Errors []StartTaskButlerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StartTaskUnauthorized{} - -func (e *StartTaskUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type StartTaskErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StartTaskErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StartTaskErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StartTaskErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StartTaskBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type StartTaskBadRequest struct { - Errors []StartTaskErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StartTaskBadRequest{} - -func (e *StartTaskBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/startuniversaltranscode.go b/models/sdkerrors/startuniversaltranscode.go deleted file mode 100644 index 72861ff..0000000 --- a/models/sdkerrors/startuniversaltranscode.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type StartUniversalTranscodeVideoErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StartUniversalTranscodeVideoErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StartUniversalTranscodeVideoErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StartUniversalTranscodeVideoErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StartUniversalTranscodeUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type StartUniversalTranscodeUnauthorized struct { - Errors []StartUniversalTranscodeVideoErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StartUniversalTranscodeUnauthorized{} - -func (e *StartUniversalTranscodeUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type StartUniversalTranscodeErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StartUniversalTranscodeErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StartUniversalTranscodeErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StartUniversalTranscodeErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StartUniversalTranscodeBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type StartUniversalTranscodeBadRequest struct { - Errors []StartUniversalTranscodeErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StartUniversalTranscodeBadRequest{} - -func (e *StartUniversalTranscodeBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/stopalltasks.go b/models/sdkerrors/stopalltasks.go deleted file mode 100644 index 374bb6a..0000000 --- a/models/sdkerrors/stopalltasks.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type StopAllTasksButlerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StopAllTasksButlerErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StopAllTasksButlerErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StopAllTasksButlerErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StopAllTasksUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type StopAllTasksUnauthorized struct { - Errors []StopAllTasksButlerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StopAllTasksUnauthorized{} - -func (e *StopAllTasksUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type StopAllTasksErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StopAllTasksErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StopAllTasksErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StopAllTasksErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StopAllTasksBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type StopAllTasksBadRequest struct { - Errors []StopAllTasksErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StopAllTasksBadRequest{} - -func (e *StopAllTasksBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/stoptask.go b/models/sdkerrors/stoptask.go deleted file mode 100644 index 76244ee..0000000 --- a/models/sdkerrors/stoptask.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type StopTaskButlerErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StopTaskButlerErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StopTaskButlerErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StopTaskButlerErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StopTaskUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type StopTaskUnauthorized struct { - Errors []StopTaskButlerErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StopTaskUnauthorized{} - -func (e *StopTaskUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type StopTaskErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StopTaskErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StopTaskErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StopTaskErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StopTaskBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type StopTaskBadRequest struct { - Errors []StopTaskErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StopTaskBadRequest{} - -func (e *StopTaskBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/stoptranscodesession.go b/models/sdkerrors/stoptranscodesession.go deleted file mode 100644 index 012695b..0000000 --- a/models/sdkerrors/stoptranscodesession.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type StopTranscodeSessionSessionsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StopTranscodeSessionSessionsErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StopTranscodeSessionSessionsErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StopTranscodeSessionSessionsErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StopTranscodeSessionUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type StopTranscodeSessionUnauthorized struct { - Errors []StopTranscodeSessionSessionsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StopTranscodeSessionUnauthorized{} - -func (e *StopTranscodeSessionUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type StopTranscodeSessionErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (s *StopTranscodeSessionErrors) GetCode() *int { - if s == nil { - return nil - } - return s.Code -} - -func (s *StopTranscodeSessionErrors) GetMessage() *string { - if s == nil { - return nil - } - return s.Message -} - -func (s *StopTranscodeSessionErrors) GetStatus() *int { - if s == nil { - return nil - } - return s.Status -} - -// StopTranscodeSessionBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type StopTranscodeSessionBadRequest struct { - Errors []StopTranscodeSessionErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &StopTranscodeSessionBadRequest{} - -func (e *StopTranscodeSessionBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/updateplaylist.go b/models/sdkerrors/updateplaylist.go deleted file mode 100644 index 4b40bb3..0000000 --- a/models/sdkerrors/updateplaylist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type UpdatePlaylistPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (u *UpdatePlaylistPlaylistsErrors) GetCode() *int { - if u == nil { - return nil - } - return u.Code -} - -func (u *UpdatePlaylistPlaylistsErrors) GetMessage() *string { - if u == nil { - return nil - } - return u.Message -} - -func (u *UpdatePlaylistPlaylistsErrors) GetStatus() *int { - if u == nil { - return nil - } - return u.Status -} - -// UpdatePlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type UpdatePlaylistUnauthorized struct { - Errors []UpdatePlaylistPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &UpdatePlaylistUnauthorized{} - -func (e *UpdatePlaylistUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type UpdatePlaylistErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (u *UpdatePlaylistErrors) GetCode() *int { - if u == nil { - return nil - } - return u.Code -} - -func (u *UpdatePlaylistErrors) GetMessage() *string { - if u == nil { - return nil - } - return u.Message -} - -func (u *UpdatePlaylistErrors) GetStatus() *int { - if u == nil { - return nil - } - return u.Status -} - -// UpdatePlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type UpdatePlaylistBadRequest struct { - Errors []UpdatePlaylistErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &UpdatePlaylistBadRequest{} - -func (e *UpdatePlaylistBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/updateplayprogress.go b/models/sdkerrors/updateplayprogress.go deleted file mode 100644 index 93d3607..0000000 --- a/models/sdkerrors/updateplayprogress.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type UpdatePlayProgressMediaErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (u *UpdatePlayProgressMediaErrors) GetCode() *int { - if u == nil { - return nil - } - return u.Code -} - -func (u *UpdatePlayProgressMediaErrors) GetMessage() *string { - if u == nil { - return nil - } - return u.Message -} - -func (u *UpdatePlayProgressMediaErrors) GetStatus() *int { - if u == nil { - return nil - } - return u.Status -} - -// UpdatePlayProgressUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type UpdatePlayProgressUnauthorized struct { - Errors []UpdatePlayProgressMediaErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &UpdatePlayProgressUnauthorized{} - -func (e *UpdatePlayProgressUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type UpdatePlayProgressErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (u *UpdatePlayProgressErrors) GetCode() *int { - if u == nil { - return nil - } - return u.Code -} - -func (u *UpdatePlayProgressErrors) GetMessage() *string { - if u == nil { - return nil - } - return u.Message -} - -func (u *UpdatePlayProgressErrors) GetStatus() *int { - if u == nil { - return nil - } - return u.Status -} - -// UpdatePlayProgressBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type UpdatePlayProgressBadRequest struct { - Errors []UpdatePlayProgressErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &UpdatePlayProgressBadRequest{} - -func (e *UpdatePlayProgressBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/models/sdkerrors/uploadplaylist.go b/models/sdkerrors/uploadplaylist.go deleted file mode 100644 index 8fdf730..0000000 --- a/models/sdkerrors/uploadplaylist.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "net/http" -) - -type UploadPlaylistPlaylistsErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (u *UploadPlaylistPlaylistsErrors) GetCode() *int { - if u == nil { - return nil - } - return u.Code -} - -func (u *UploadPlaylistPlaylistsErrors) GetMessage() *string { - if u == nil { - return nil - } - return u.Message -} - -func (u *UploadPlaylistPlaylistsErrors) GetStatus() *int { - if u == nil { - return nil - } - return u.Status -} - -// UploadPlaylistUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type UploadPlaylistUnauthorized struct { - Errors []UploadPlaylistPlaylistsErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &UploadPlaylistUnauthorized{} - -func (e *UploadPlaylistUnauthorized) Error() string { - data, _ := json.Marshal(e) - return string(data) -} - -type UploadPlaylistErrors struct { - Code *int `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Status *int `json:"status,omitempty"` -} - -func (u *UploadPlaylistErrors) GetCode() *int { - if u == nil { - return nil - } - return u.Code -} - -func (u *UploadPlaylistErrors) GetMessage() *string { - if u == nil { - return nil - } - return u.Message -} - -func (u *UploadPlaylistErrors) GetStatus() *int { - if u == nil { - return nil - } - return u.Status -} - -// UploadPlaylistBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. -type UploadPlaylistBadRequest struct { - Errors []UploadPlaylistErrors `json:"errors,omitempty"` - // Raw HTTP response; suitable for custom response parsing - RawResponse *http.Response `json:"-"` -} - -var _ error = &UploadPlaylistBadRequest{} - -func (e *UploadPlaylistBadRequest) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/playlist.go b/playlist.go new file mode 100644 index 0000000..5f06284 --- /dev/null +++ b/playlist.go @@ -0,0 +1,713 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Playlist - Media playlists that can be created and played back +type Playlist struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newPlaylist(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Playlist { + return &Playlist{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ListPlaylists - List playlists +// Gets a list of playlists and playlist folders for a user. General filters are permitted, such as `sort=lastViewedAt:desc`. A flat playlist list can be retrieved using `type=15` to limit the collection to just playlists. +func (s *Playlist) ListPlaylists(ctx context.Context, request operations.ListPlaylistsRequest, opts ...operations.Option) (*operations.ListPlaylistsResponse, error) { + globals := operations.ListPlaylistsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/playlists") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listPlaylists", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPlaylistsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", 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 *Playlist) GetPlaylist(ctx context.Context, request operations.GetPlaylistRequest, opts ...operations.Option) (*operations.GetPlaylistResponse, error) { + globals := operations.GetPlaylistGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPlaylist", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPlaylistItems - 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 *Playlist) GetPlaylistItems(ctx context.Context, request operations.GetPlaylistItemsRequest, opts ...operations.Option) (*operations.GetPlaylistItemsResponse, error) { + globals := operations.GetPlaylistItemsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPlaylistItems", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPlaylistItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/playlists.go b/playlists.go deleted file mode 100644 index 5832390..0000000 --- a/playlists.go +++ /dev/null @@ -1,2267 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// 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 { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newPlaylists(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Playlists { - return &Playlists{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// 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. `server://1234/com.plexapp.plugins.library/library/metadata/1`). -// - `playQueueID` - To create a playlist from an existing play queue. -func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.CreatePlaylistRequest, opts ...operations.Option) (*operations.CreatePlaylistResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/playlists") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "createPlaylist", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.CreatePlaylistResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.CreatePlaylistResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.CreatePlaylistBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.CreatePlaylistUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.GetPlaylistsResponse, error) { - request := operations.GetPlaylistsRequest{ - PlaylistType: playlistType, - Smart: smart, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/playlists") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getPlaylists", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetPlaylistsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetPlaylistsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPlaylistsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPlaylistsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.GetPlaylistResponse, error) { - request := operations.GetPlaylistRequest{ - PlaylistID: playlistID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getPlaylist", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetPlaylistResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetPlaylistResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPlaylistBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPlaylistUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.DeletePlaylistResponse, error) { - request := operations.DeletePlaylistRequest{ - PlaylistID: playlistID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "deletePlaylist", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.DeletePlaylistResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 204: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.DeletePlaylistBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.DeletePlaylistUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, title *string, summary *string, opts ...operations.Option) (*operations.UpdatePlaylistResponse, error) { - request := operations.UpdatePlaylistRequest{ - PlaylistID: playlistID, - Title: title, - Summary: summary, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "updatePlaylist", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.UpdatePlaylistResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.UpdatePlaylistBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.UpdatePlaylistUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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_ operations.GetPlaylistContentsQueryParamType, opts ...operations.Option) (*operations.GetPlaylistContentsResponse, error) { - request := operations.GetPlaylistContentsRequest{ - PlaylistID: playlistID, - Type: type_, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getPlaylistContents", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetPlaylistContentsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetPlaylistContentsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPlaylistContentsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPlaylistContentsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.ClearPlaylistContentsResponse, error) { - request := operations.ClearPlaylistContentsRequest{ - PlaylistID: playlistID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "clearPlaylistContents", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.ClearPlaylistContentsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.ClearPlaylistContentsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.ClearPlaylistContentsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// AddPlaylistContents - Adding to a Playlist -// Adds a generator to a playlist, same parameters as the POST to create. 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, opts ...operations.Option) (*operations.AddPlaylistContentsResponse, error) { - request := operations.AddPlaylistContentsRequest{ - PlaylistID: playlistID, - URI: uri, - PlayQueueID: playQueueID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "addPlaylistContents", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.AddPlaylistContentsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.AddPlaylistContentsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.AddPlaylistContentsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.AddPlaylistContentsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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.QueryParamForce, sectionID int64, opts ...operations.Option) (*operations.UploadPlaylistResponse, error) { - request := operations.UploadPlaylistRequest{ - Path: path, - Force: force, - SectionID: sectionID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/playlists/upload") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "uploadPlaylist", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.UploadPlaylistResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.UploadPlaylistBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.UploadPlaylistUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/playqueue.go b/playqueue.go new file mode 100644 index 0000000..a846977 --- /dev/null +++ b/playqueue.go @@ -0,0 +1,2076 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// PlayQueue - The playqueue feature within a media provider +// A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue. +// Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed. +// You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion. +// All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area. +// The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item. +type PlayQueue struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newPlayQueue(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *PlayQueue { + return &PlayQueue{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// CreatePlayQueue - Create a play queue +// Makes a new play queue for a device. The source of the playqueue can either be a URI, or a playlist. The response is a media container with the initial items in the queue. Each item in the queue will be a regular item but with `playQueueItemID` - a unique ID since the queue could have repeated items with the same `ratingKey`. +// Note: Either `uri` or `playlistID` must be specified +func (s *PlayQueue) CreatePlayQueue(ctx context.Context, request operations.CreatePlayQueueRequest, opts ...operations.Option) (*operations.CreatePlayQueueResponse, error) { + globals := operations.CreatePlayQueueGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/playQueues") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createPlayQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreatePlayQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.CreatePlayQueueResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPlayQueue - Retrieve a play queue +// Retrieves the play queue, centered at current item. This can be treated as a regular container by play queue-oblivious clients, but they may wish to request a large window onto the queue since they won't know to refresh. +func (s *PlayQueue) GetPlayQueue(ctx context.Context, request operations.GetPlayQueueRequest, opts ...operations.Option) (*operations.GetPlayQueueResponse, error) { + globals := operations.GetPlayQueueGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPlayQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPlayQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddToPlayQueue - Add a generator or playlist to a play queue +// Adds an item to a play queue (e.g. party mode). Increments the version of the play queue. Takes the following parameters (`uri` and `playlistID` are mutually exclusive). Returns the modified play queue. +func (s *PlayQueue) AddToPlayQueue(ctx context.Context, request operations.AddToPlayQueueRequest, opts ...operations.Option) (*operations.AddToPlayQueueResponse, error) { + globals := operations.AddToPlayQueueGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addToPlayQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddToPlayQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ClearPlayQueue - Clear a play queue +// Deletes all items in the play queue, and increases the version of the play queue. +func (s *PlayQueue) ClearPlayQueue(ctx context.Context, request operations.ClearPlayQueueRequest, opts ...operations.Option) (*operations.ClearPlayQueueResponse, error) { + globals := operations.ClearPlayQueueGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}/items", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "clearPlayQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ClearPlayQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ResetPlayQueue - Reset a play queue +// Reset a play queue to the first item being the current item +func (s *PlayQueue) ResetPlayQueue(ctx context.Context, request operations.ResetPlayQueueRequest, opts ...operations.Option) (*operations.ResetPlayQueueResponse, error) { + globals := operations.ResetPlayQueueGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}/reset", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "resetPlayQueue", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ResetPlayQueueResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Shuffle a play queue +// Shuffle a play queue (or reshuffles if already shuffled). The currently selected item is maintained. Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue. +func (s *PlayQueue) Shuffle(ctx context.Context, request operations.ShuffleRequest, opts ...operations.Option) (*operations.ShuffleResponse, error) { + globals := operations.ShuffleGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}/shuffle", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "shuffle", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ShuffleResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Unshuffle a play queue +// Unshuffles a play queue and restores "natural order". Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue. +func (s *PlayQueue) Unshuffle(ctx context.Context, request operations.UnshuffleRequest, opts ...operations.Option) (*operations.UnshuffleResponse, error) { + globals := operations.UnshuffleGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}/unshuffle", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "unshuffle", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UnshuffleResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeletePlayQueueItem - Delete an item from a play queue +// Deletes an item in a play queue. Increments the version of the play queue. Returns the modified play queue. +func (s *PlayQueue) DeletePlayQueueItem(ctx context.Context, request operations.DeletePlayQueueItemRequest, opts ...operations.Option) (*operations.DeletePlayQueueItemResponse, error) { + globals := operations.DeletePlayQueueItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}/items/{playQueueItemId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deletePlayQueueItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeletePlayQueueItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// MovePlayQueueItem - Move an item in a play queue +// Moves an item in a play queue, and increases the version of the play queue. Returns the modified play queue. +func (s *PlayQueue) MovePlayQueueItem(ctx context.Context, request operations.MovePlayQueueItemRequest, opts ...operations.Option) (*operations.MovePlayQueueItemResponse, error) { + globals := operations.MovePlayQueueItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/playQueues/{playQueueId}/items/{playQueueItemId}/move", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "movePlayQueueItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MovePlayQueueItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithPlaylistMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithPlaylistMetadata = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/plex.go b/plex.go deleted file mode 100644 index ce5a109..0000000 --- a/plex.go +++ /dev/null @@ -1,1756 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Plex - API Calls that perform operations directly against https://Plex.tv -type Plex struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newPlex(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Plex { - return &Plex{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// GetCompanionsData - Get Companions Data -// Get Companions Data -func (s *Plex) GetCompanionsData(ctx context.Context, opts ...operations.Option) (*operations.GetCompanionsDataResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetCompanionsDataServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/companions") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getCompanionsData", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetCompanionsDataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out []operations.ResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.ResponseBodies = out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetCompanionsDataBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetCompanionsDataUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetUserFriends - Get list of friends of the user logged in -// Get friends of provided auth token. -func (s *Plex) GetUserFriends(ctx context.Context, opts ...operations.Option) (*operations.GetUserFriendsResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetUserFriendsServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/friends") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getUserFriends", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetUserFriendsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out []operations.Friend - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Friends = out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetUserFriendsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetUserFriendsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetGeoData - Get Geo Data -// Returns the geolocation and locale data of the caller -func (s *Plex) GetGeoData(ctx context.Context, opts ...operations.Option) (*operations.GetGeoDataResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetGeoDataServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/geoip") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getGeoData", - OAuth2Scopes: []string{}, - SecuritySource: nil, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetGeoDataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetGeoDataGeoData - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.GeoData = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetGeoDataBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetGeoDataUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetHomeData - Get Plex Home Data -// Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. -func (s *Plex) GetHomeData(ctx context.Context, opts ...operations.Option) (*operations.GetHomeDataResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/home") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getHomeData", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetHomeDataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetHomeDataResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetHomeDataBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetHomeDataUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetServerResources - Get Server Resources -// Get Plex server access tokens and server connections -func (s *Plex) GetServerResources(ctx context.Context, clientID string, includeHTTPS *operations.IncludeHTTPS, includeRelay *operations.IncludeRelay, includeIPv6 *operations.IncludeIPv6, opts ...operations.Option) (*operations.GetServerResourcesResponse, error) { - request := operations.GetServerResourcesRequest{ - IncludeHTTPS: includeHTTPS, - IncludeRelay: includeRelay, - IncludeIPv6: includeIPv6, - ClientID: clientID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetServerResourcesServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/resources") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-server-resources", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetServerResourcesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out []operations.PlexDevice - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.PlexDevices = out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerResourcesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerResourcesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetPin - Get a Pin -// Retrieve a Pin ID from Plex.tv to use for authentication flows -func (s *Plex) GetPin(ctx context.Context, request operations.GetPinRequest, opts ...operations.Option) (*operations.GetPinResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetPinServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/pins") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getPin", - OAuth2Scopes: []string{}, - SecuritySource: nil, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetPinResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetPinAuthPinContainer - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.AuthPinContainer = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetPinBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetTokenByPinID - Get Access Token by PinId -// Retrieve an Access Token from Plex.tv after the Pin has been authenticated -func (s *Plex) GetTokenByPinID(ctx context.Context, request operations.GetTokenByPinIDRequest, opts ...operations.Option) (*operations.GetTokenByPinIDResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetTokenByPinIDServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := utils.GenerateURL(ctx, baseURL, "/pins/{pinID}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getTokenByPinId", - OAuth2Scopes: []string{}, - SecuritySource: nil, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - utils.PopulateHeaders(ctx, req, request, nil) - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTokenByPinIDResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetTokenByPinIDAuthPinContainer - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.AuthPinContainer = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTokenByPinIDBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTokenByPinIDResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/plexapi.go b/plexapi.go index 5e3f529..45518b7 100644 --- a/plexapi.go +++ b/plexapi.go @@ -2,13 +2,13 @@ package plexgo -// Generated from OpenAPI doc version 0.0.3 and generator version 2.722.2 +// Generated from OpenAPI doc version 1.1.1 and generator version 2.723.11 import ( "context" - "encoding/json" "fmt" "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/globals" "github.com/LukeHagar/plexgo/internal/hooks" "github.com/LukeHagar/plexgo/internal/utils" "github.com/LukeHagar/plexgo/models/components" @@ -19,8 +19,9 @@ import ( // ServerList contains the list of servers available to the SDK var ServerList = []string{ - // The full address of your Plex Server - "{protocol}://{ip}:{port}", + "https://{IP-description}.{identifier}.plex.direct:{port}", + "{protocol}://{host}:{port}", + "https://{server_url}", } // HTTPClient provides an interface for supplying the SDK with a custom HTTP client @@ -49,92 +50,117 @@ func Float64(f float64) *float64 { return &f } // Pointer provides a helper function to return a pointer to a type func Pointer[T any](v T) *T { return &v } -// PlexAPI - Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server -// # Plex Media Server OpenAPI Specification -// -// # An Open Source OpenAPI Specification for Plex Media Server -// -// Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) -// -// ## Documentation -// -// [API Documentation](https://plexapi.dev) -// -// ## SDKs -// -// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). -// -// | Language | Repository | Releases | Other | -// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | -// | Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | -// | JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | -// | Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | -// | Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | -// | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | -// | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | -// | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | -// | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - type PlexAPI struct { SDKVersion string - // Operations against the Plex Media Server System. + // General endpoints for basic PMS operation not specific to any media provider + General *General + // The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported. // - Server *Server - // API Calls interacting with Plex Media Server Media + // Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket. // - Media *Media - // API Calls that perform operations with Plex Media Server Videos + Events *Events + // API Operations against the Preferences + Preferences *Preferences + // Operations for rating media items (thumbs up/down, star ratings, etc.) + Rate *Rate + // The actions feature within a media provider + Timeline *Timeline + // Activities 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. // - Video *Video - // 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 are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. // Activities *Activities - // Butler is the task manager of the Plex Media Server Ecosystem. - // + // The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks. Butler *Butler - // API Calls that perform operations directly against https://Plex.tv - // - Plex *Plex - // Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. - // + // API Operations against the Download Queue + DownloadQueue *DownloadQueue + // The hubs within a media provider Hubs *Hubs - // API Calls that perform search operations with Plex Media Server - // + // The search feature within a media provider Search *Search - // API Calls interacting with Plex Media Server Libraries - // + // Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc). Library *Library - // API Calls that perform operations with Plex Media Server Watchlists + // API Operations against the Collections + Collections *Collections + // The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself // - Watchlist *Watchlist - // Submit logs to the Log Handler for Plex Media Server + DVRs *DVRs + // The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when // + Epg *Epg + // LiveTV contains the playback sessions of a channel from a DVR device + // + LiveTV *LiveTV + // Logging mechanism to allow clients to log to the 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. + // Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices // - Playlists *Playlists - // API Calls regarding authentication for Plex Media Server + // Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below. // - Authentication *Authentication - // API Calls that perform operations with Plex Media Server Statistics + // Example SSDP output + // ``` + // + // + // 1 + // 0 + // + // + // urn:plex-tv:device:Media:1 + // Turing Hopper 3000 + // Plex, Inc. + // https://plex.tv/ + // Turing Hopper 3000 Media Grabber + // Plex Media Grabber + // 1 + // https://plex.tv + // uuid:42fde8e4-93b6-41e5-8a63-12d848655811 + // + // + // http://10.0.0.5:8088 + // urn:plex-tv:service:MediaGrabber:1 + // urn:plex-tv:serviceId:MediaGrabber + // + // + // + // + // ``` // - Statistics *Statistics - // API Calls that perform search operations with Plex Media Server Sessions + // - UDN: (string) A UUID for the device. This should be unique across models of a device at minimum. + // - URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted. // - Sessions *Sessions + Devices *Devices + // Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers. + Provider *Provider + // Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available + // + Subscriptions *Subscriptions + // API Operations against the Transcoder + Transcoder *Transcoder + // Media playlists that can be created and played back + Playlist *Playlist + // Endpoints for manipulating playlists. + LibraryPlaylists *LibraryPlaylists + // The playqueue feature within a media provider + // A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue. + // Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed. + // You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion. + // All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area. + // The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item. + PlayQueue *PlayQueue + // Service provided to compute UltraBlur colors and images. + UltraBlur *UltraBlur + // The status endpoints give you information about current playbacks, play history, and even terminating sessions. + Status *Status // 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 - Users *Users + // The actual content of the media provider + Content *Content + // Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well. + LibraryCollections *LibraryCollections sdkConfiguration config.SDKConfiguration hooks *hooks.Hooks @@ -171,55 +197,28 @@ func WithServerIndex(serverIndex int) SDKOption { } } -// ServerProtocol - The protocol to use for the server connection -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 { +// WithIdentifier allows setting the identifier variable for url substitution +func WithIdentifier(identifier string) SDKOption { return func(sdk *PlexAPI) { for idx := range sdk.sdkConfiguration.ServerVariables { - if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["protocol"]; !ok { + if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["identifier"]; !ok { continue } - sdk.sdkConfiguration.ServerVariables[idx]["protocol"] = fmt.Sprintf("%v", protocol) + sdk.sdkConfiguration.ServerVariables[idx]["identifier"] = fmt.Sprintf("%v", identifier) } } } -// WithIP allows setting the ip variable for url substitution -func WithIP(ip string) SDKOption { +// WithIPDescription allows setting the IP-description variable for url substitution +func WithIPDescription(ipDescription string) SDKOption { return func(sdk *PlexAPI) { for idx := range sdk.sdkConfiguration.ServerVariables { - if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["ip"]; !ok { + if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["IP-description"]; !ok { continue } - sdk.sdkConfiguration.ServerVariables[idx]["ip"] = fmt.Sprintf("%v", ip) + sdk.sdkConfiguration.ServerVariables[idx]["IP-description"] = fmt.Sprintf("%v", ipDescription) } } } @@ -237,6 +236,45 @@ func WithPort(port string) SDKOption { } } +// WithProtocol allows setting the protocol variable for url substitution +func WithProtocol(protocol string) SDKOption { + return func(sdk *PlexAPI) { + for idx := range sdk.sdkConfiguration.ServerVariables { + if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["protocol"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerVariables[idx]["protocol"] = fmt.Sprintf("%v", protocol) + } + } +} + +// WithHost allows setting the host variable for url substitution +func WithHost(host string) SDKOption { + return func(sdk *PlexAPI) { + for idx := range sdk.sdkConfiguration.ServerVariables { + if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["host"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerVariables[idx]["host"] = fmt.Sprintf("%v", host) + } + } +} + +// WithGlobalServerURL allows setting the server_url variable for url substitution +func WithGlobalServerURL(serverURL string) SDKOption { + return func(sdk *PlexAPI) { + for idx := range sdk.sdkConfiguration.ServerVariables { + if _, ok := sdk.sdkConfiguration.ServerVariables[idx]["server_url"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerVariables[idx]["server_url"] = fmt.Sprintf("%v", serverURL) + } + } +} + // WithClient allows the overriding of the default HTTP client used by the SDK func WithClient(client HTTPClient) SDKOption { return func(sdk *PlexAPI) { @@ -245,9 +283,9 @@ func WithClient(client HTTPClient) SDKOption { } // WithSecurity configures the SDK to use the provided security details -func WithSecurity(accessToken string) SDKOption { +func WithSecurity(token string) SDKOption { return func(sdk *PlexAPI) { - security := components.Security{AccessToken: &accessToken} + security := components.Security{Token: &token} sdk.sdkConfiguration.Security = utils.AsSecuritySource(&security) } } @@ -261,6 +299,83 @@ func WithSecuritySource(security func(context.Context) (components.Security, err } } +// WithAccepts allows setting the Accepts parameter for all supported operations +func WithAccepts(accepts components.Accepts) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Accepts = &accepts + } +} + +// WithClientIdentifier allows setting the ClientIdentifier parameter for all supported operations +func WithClientIdentifier(clientIdentifier string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.ClientIdentifier = &clientIdentifier + } +} + +// WithProduct allows setting the Product parameter for all supported operations +func WithProduct(product string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Product = &product + } +} + +// WithVersion allows setting the Version parameter for all supported operations +func WithVersion(version string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Version = &version + } +} + +// WithPlatform allows setting the Platform parameter for all supported operations +func WithPlatform(platform string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Platform = &platform + } +} + +// WithPlatformVersion allows setting the PlatformVersion parameter for all supported operations +func WithPlatformVersion(platformVersion string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.PlatformVersion = &platformVersion + } +} + +// WithDevice allows setting the Device parameter for all supported operations +func WithDevice(device string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Device = &device + } +} + +// WithModel allows setting the Model parameter for all supported operations +func WithModel(model string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Model = &model + } +} + +// WithDeviceVendor allows setting the DeviceVendor parameter for all supported operations +func WithDeviceVendor(deviceVendor string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.DeviceVendor = &deviceVendor + } +} + +// WithDeviceName allows setting the DeviceName parameter for all supported operations +func WithDeviceName(deviceName string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.DeviceName = &deviceName + } +} + +// WithMarketplace allows setting the Marketplace parameter for all supported operations +func WithMarketplace(marketplace string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.Globals.Marketplace = &marketplace + } +} + func WithRetryConfig(retryConfig retry.Config) SDKOption { return func(sdk *PlexAPI) { sdk.sdkConfiguration.RetryConfig = &retryConfig @@ -277,16 +392,25 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *PlexAPI { sdk := &PlexAPI{ - SDKVersion: "0.25.0", + SDKVersion: "0.26.0", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.25.0 2.722.2 0.0.3 github.com/LukeHagar/plexgo", + UserAgent: "speakeasy-sdk/go 0.26.0 2.723.11 1.1.1 github.com/LukeHagar/plexgo", + Globals: globals.Globals{}, ServerList: ServerList, ServerVariables: []map[string]string{ { - "protocol": "https", - "ip": "10.10.10.47", + "identifier": "0123456789abcdef0123456789abcdef", + "IP-description": "1-2-3-4", + "port": "32400", + }, + { + "protocol": "http", + "host": "localhost", "port": "32400", }, + { + "server_url": "http://localhost:32400", + }, }, }, hooks: hooks.New(), @@ -307,23 +431,34 @@ func New(opts ...SDKOption) *PlexAPI { sdk.sdkConfiguration.ServerURL = serverURL } - sdk.Server = newServer(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Media = newMedia(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Video = newVideo(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.General = newGeneral(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Events = newEvents(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Preferences = newPreferences(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Rate = newRate(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Timeline = newTimeline(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Activities = newActivities(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Butler = newButler(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Plex = newPlex(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.DownloadQueue = newDownloadQueue(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Hubs = newHubs(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Search = newSearch(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Library = newLibrary(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Watchlist = newWatchlist(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Collections = newCollections(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.DVRs = newDVRs(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Epg = newEpg(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.LiveTV = newLiveTV(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Log = newLog(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Playlists = newPlaylists(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Authentication = newAuthentication(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Statistics = newStatistics(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Sessions = newSessions(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Devices = newDevices(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Provider = newProvider(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Subscriptions = newSubscriptions(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Transcoder = newTranscoder(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Playlist = newPlaylist(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.LibraryPlaylists = newLibraryPlaylists(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.PlayQueue = newPlayQueue(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.UltraBlur = newUltraBlur(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Status = newStatus(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Updater = newUpdater(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Users = newUsers(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Content = newContent(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.LibraryCollections = newLibraryCollections(sdk, sdk.sdkConfiguration, sdk.hooks) return sdk } diff --git a/preferences.go b/preferences.go new file mode 100644 index 0000000..d8ce1ab --- /dev/null +++ b/preferences.go @@ -0,0 +1,674 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Preferences - API Operations against the Preferences +type Preferences struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newPreferences(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Preferences { + return &Preferences{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetAllPreferences - Get all preferences +// Get the list of all preferences +func (s *Preferences) GetAllPreferences(ctx context.Context, opts ...operations.Option) (*operations.GetAllPreferencesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/prefs") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAllPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAllPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSettings + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSettings = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetPreferences - Set preferences +// Set a set of preferences in query parameters +func (s *Preferences) SetPreferences(ctx context.Context, request operations.SetPreferencesRequest, opts ...operations.Option) (*operations.SetPreferencesResponse, error) { + globals := operations.SetPreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/prefs") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPreference - Get a preferences +// Get a single preference and value +func (s *Preferences) GetPreference(ctx context.Context, request operations.GetPreferenceRequest, opts ...operations.Option) (*operations.GetPreferenceResponse, error) { + globals := operations.GetPreferenceGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/prefs/get") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPreference", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPreferenceResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSettings + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSettings = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/provider.go b/provider.go new file mode 100644 index 0000000..865bd29 --- /dev/null +++ b/provider.go @@ -0,0 +1,834 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Provider - Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers. +type Provider struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newProvider(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Provider { + return &Provider{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ListProviders - Get the list of available media providers +// Get the list of all available media providers for this PMS. This will generally include the library provider and possibly EPG if DVR is set up. +func (s *Provider) ListProviders(ctx context.Context, opts ...operations.Option) (*operations.ListProvidersResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/providers") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listProviders", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListProvidersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListProvidersResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// AddProvider - Add a media provider +// This endpoint registers a media provider with the server. Once registered, the media server acts as a reverse proxy to the provider, allowing both local and remote providers to work. +func (s *Provider) AddProvider(ctx context.Context, request operations.AddProviderRequest, opts ...operations.Option) (*operations.AddProviderResponse, error) { + globals := operations.AddProviderGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/providers") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "addProvider", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddProviderResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RefreshProviders - Refresh media providers +// Refresh all known media providers. This is useful in case a provider has updated features. +func (s *Provider) RefreshProviders(ctx context.Context, opts ...operations.Option) (*operations.RefreshProvidersResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/providers/refresh") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "refreshProviders", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RefreshProvidersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteMediaProvider - Delete a media provider +// Deletes a media provider with the given id +func (s *Provider) DeleteMediaProvider(ctx context.Context, request operations.DeleteMediaProviderRequest, opts ...operations.Option) (*operations.DeleteMediaProviderResponse, error) { + globals := operations.DeleteMediaProviderGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/providers/{provider}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteMediaProvider", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteMediaProviderResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/rate.go b/rate.go new file mode 100644 index 0000000..8e68c81 --- /dev/null +++ b/rate.go @@ -0,0 +1,241 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Rate - Operations for rating media items (thumbs up/down, star ratings, etc.) +type Rate struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newRate(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Rate { + return &Rate{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// SetRating - Rate an item +// Set the rating on an item. +// This API does respond to the GET verb but applications should use PUT +func (s *Rate) SetRating(ctx context.Context, request operations.SetRatingRequest, opts ...operations.Option) (*operations.SetRatingResponse, error) { + globals := operations.SetRatingGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/rate") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "setRating", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.SetRatingResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/search.go b/search.go index d98e3fa..2dea387 100644 --- a/search.go +++ b/search.go @@ -16,7 +16,7 @@ import ( "net/url" ) -// Search - API Calls that perform search operations with Plex Media Server +// Search - The search feature within a media provider type Search struct { rootSDK *PlexAPI sdkConfiguration config.SDKConfiguration @@ -31,7 +31,9 @@ func newSearch(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks } } -// PerformSearch - Perform a search +// SearchHubs - Search Hub +// Perform a search and get the result as hubs +// // 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: @@ -45,11 +47,19 @@ func newSearch(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks // - `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, opts ...operations.Option) (*operations.PerformSearchResponse, error) { - request := operations.PerformSearchRequest{ - Query: query, - SectionID: sectionID, - Limit: limit, +func (s *Search) SearchHubs(ctx context.Context, request operations.SearchHubsRequest, opts ...operations.Option) (*operations.SearchHubsResponse, error) { + globals := operations.SearchHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -80,8 +90,8 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "performSearch", - OAuth2Scopes: []string{}, + OperationID: "searchHubs", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -103,7 +113,9 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -191,7 +203,7 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -206,7 +218,7 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo } } - res := &operations.PerformSearchResponse{ + res := &operations.SearchHubsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -214,50 +226,32 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo switch { case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.SearchHubsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.PerformSearchBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.PerformSearchUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + fallthrough + case httpRes.StatusCode == 404: + fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -282,16 +276,25 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo } -// 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. +// VoiceSearchHubs - Voice Search Hub +// Perform a search tailored to voice input and get the result as hubs +// +// 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, opts ...operations.Option) (*operations.PerformVoiceSearchResponse, error) { - request := operations.PerformVoiceSearchRequest{ - Query: query, - SectionID: sectionID, - Limit: limit, +func (s *Search) VoiceSearchHubs(ctx context.Context, request operations.VoiceSearchHubsRequest, opts ...operations.Option) (*operations.VoiceSearchHubsResponse, error) { + globals := operations.VoiceSearchHubsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, } o := operations.Options{} @@ -322,8 +325,8 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "performVoiceSearch", - OAuth2Scopes: []string{}, + OperationID: "voiceSearchHubs", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -345,7 +348,9 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -433,7 +438,7 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -448,7 +453,7 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID } } - res := &operations.PerformVoiceSearchResponse{ + res := &operations.VoiceSearchHubsResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -456,7 +461,8 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID switch { case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: + res.Headers = httpRes.Header + switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -464,243 +470,7 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID return nil, err } - var out sdkerrors.PerformVoiceSearchBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.PerformVoiceSearchUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.GetSearchResultsResponse, error) { - request := operations.GetSearchResultsRequest{ - Query: query, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/search") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getSearchResults", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetSearchResultsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetSearchResultsResponseBody + var out operations.VoiceSearchHubsResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -714,49 +484,7 @@ func (s *Search) GetSearchResults(ctx context.Context, query string, opts ...ope return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSearchResultsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSearchResultsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/server.go b/server.go deleted file mode 100644 index 695fd5b..0000000 --- a/server.go +++ /dev/null @@ -1,2237 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Server - Operations against the Plex Media Server System. -type Server struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newServer(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Server { - return &Server{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// GetServerCapabilities - Get Server Capabilities -// Get Server Capabilities -func (s *Server) GetServerCapabilities(ctx context.Context, opts ...operations.Option) (*operations.GetServerCapabilitiesResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getServerCapabilities", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetServerCapabilitiesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetServerCapabilitiesResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerCapabilitiesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerCapabilitiesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetServerPreferences - Get Server Preferences -// Get Server Preferences -func (s *Server) GetServerPreferences(ctx context.Context, opts ...operations.Option) (*operations.GetServerPreferencesResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/:/prefs") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getServerPreferences", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetServerPreferencesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetServerPreferencesResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerPreferencesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerPreferencesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetAvailableClients - Get Available Clients -// Get Available Clients -func (s *Server) GetAvailableClients(ctx context.Context, opts ...operations.Option) (*operations.GetAvailableClientsResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/clients") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getAvailableClients", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetAvailableClientsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetAvailableClientsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetAvailableClientsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetAvailableClientsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetDevices - Get Devices -// Get Devices -func (s *Server) GetDevices(ctx context.Context, opts ...operations.Option) (*operations.GetDevicesResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/devices") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getDevices", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetDevicesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetDevicesResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetDevicesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetDevicesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetServerIdentity - Get Server Identity -// This request is useful to determine if the server is online or offline -func (s *Server) GetServerIdentity(ctx context.Context, opts ...operations.Option) (*operations.GetServerIdentityResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/identity") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-server-identity", - OAuth2Scopes: []string{}, - SecuritySource: nil, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"408", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetServerIdentityResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetServerIdentityResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerIdentityRequestTimeout - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetMyPlexAccount - Get MyPlex Account -// Returns MyPlex Account Information -func (s *Server) GetMyPlexAccount(ctx context.Context, opts ...operations.Option) (*operations.GetMyPlexAccountResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/myplex/account") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getMyPlexAccount", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetMyPlexAccountResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetMyPlexAccountResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMyPlexAccountBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMyPlexAccountUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.GetResizedPhotoResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/photo/:/transcode") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getResizedPhoto", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetResizedPhotoResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetResizedPhotoBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetResizedPhotoUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetMediaProviders - Get Media Providers -// Retrieves media providers and their features from the Plex server. -func (s *Server) GetMediaProviders(ctx context.Context, xPlexToken string, opts ...operations.Option) (*operations.GetMediaProvidersResponse, error) { - request := operations.GetMediaProvidersRequest{ - XPlexToken: xPlexToken, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/media/providers") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-media-providers", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetMediaProvidersResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetMediaProvidersResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMediaProvidersBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetMediaProvidersUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetServerList - Get Server List -// Get Server List -func (s *Server) GetServerList(ctx context.Context, opts ...operations.Option) (*operations.GetServerListResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/servers") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getServerList", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetServerListResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetServerListResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerListBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetServerListUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/sessions.go b/sessions.go deleted file mode 100644 index 23d0626..0000000 --- a/sessions.go +++ /dev/null @@ -1,1023 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Sessions - API Calls that perform search operations with Plex Media Server Sessions -type Sessions struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newSessions(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Sessions { - return &Sessions{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// GetSessions - Get Active Sessions -// This will retrieve the "Now Playing" Information of the PMS. -func (s *Sessions) GetSessions(ctx context.Context, opts ...operations.Option) (*operations.GetSessionsResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/status/sessions") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getSessions", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetSessionsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetSessionsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSessionsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSessionsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, sort *string, accountID *int64, filter *operations.QueryParamFilter, librarySectionID *int64, opts ...operations.Option) (*operations.GetSessionHistoryResponse, error) { - request := operations.GetSessionHistoryRequest{ - Sort: sort, - AccountID: accountID, - Filter: filter, - LibrarySectionID: librarySectionID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/status/sessions/history/all") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getSessionHistory", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetSessionHistoryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetSessionHistoryResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSessionHistoryBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetSessionHistoryUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetTranscodeSessions - Get Transcode Sessions -// Get Transcode Sessions -func (s *Sessions) GetTranscodeSessions(ctx context.Context, opts ...operations.Option) (*operations.GetTranscodeSessionsResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/transcode/sessions") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getTranscodeSessions", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTranscodeSessionsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetTranscodeSessionsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTranscodeSessionsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTranscodeSessionsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.StopTranscodeSessionResponse, error) { - request := operations.StopTranscodeSessionRequest{ - SessionKey: sessionKey, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/transcode/sessions/{sessionKey}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "stopTranscodeSession", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.StopTranscodeSessionResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 204: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StopTranscodeSessionBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StopTranscodeSessionUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/statistics.go b/statistics.go deleted file mode 100644 index 3c9dcfe..0000000 --- a/statistics.go +++ /dev/null @@ -1,803 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Statistics - API Calls that perform operations with Plex Media Server Statistics -type Statistics struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newStatistics(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Statistics { - return &Statistics{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// GetStatistics - Get Media Statistics -// This will return the media statistics for the server -func (s *Statistics) GetStatistics(ctx context.Context, timespan *int64, opts ...operations.Option) (*operations.GetStatisticsResponse, error) { - request := operations.GetStatisticsRequest{ - Timespan: timespan, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/statistics/media") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getStatistics", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetStatisticsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetStatisticsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetStatisticsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetStatisticsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetResourcesStatistics - Get Resources Statistics -// This will return the resources for the server -func (s *Statistics) GetResourcesStatistics(ctx context.Context, timespan *int64, opts ...operations.Option) (*operations.GetResourcesStatisticsResponse, error) { - request := operations.GetResourcesStatisticsRequest{ - Timespan: timespan, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/statistics/resources") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getResourcesStatistics", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetResourcesStatisticsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetResourcesStatisticsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetResourcesStatisticsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetResourcesStatisticsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// GetBandwidthStatistics - Get Bandwidth Statistics -// This will return the bandwidth statistics for the server -func (s *Statistics) GetBandwidthStatistics(ctx context.Context, timespan *int64, opts ...operations.Option) (*operations.GetBandwidthStatisticsResponse, error) { - request := operations.GetBandwidthStatisticsRequest{ - Timespan: timespan, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/statistics/bandwidth") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getBandwidthStatistics", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetBandwidthStatisticsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetBandwidthStatisticsResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetBandwidthStatisticsBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetBandwidthStatisticsUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/status.go b/status.go new file mode 100644 index 0000000..f5d79bb --- /dev/null +++ b/status.go @@ -0,0 +1,1334 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Status - The status endpoints give you information about current playbacks, play history, and even terminating sessions. +type Status struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newStatus(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Status { + return &Status{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ListSessions - List Sessions +// List all current playbacks on this server +func (s *Status) ListSessions(ctx context.Context, opts ...operations.Option) (*operations.ListSessionsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/status/sessions") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listSessions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListSessionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListSessionsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetBackgroundTasks - Get background tasks +// Get the list of all background tasks +func (s *Status) GetBackgroundTasks(ctx context.Context, opts ...operations.Option) (*operations.GetBackgroundTasksResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/status/sessions/background") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getBackgroundTasks", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetBackgroundTasksResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetBackgroundTasksResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListPlaybackHistory - List Playback History +// List all playback history (Admin can see all users, others can only see their own). +// Pagination should be used on this endpoint. Additionally this endpoint supports `includeFields`, `excludeFields`, `includeElements`, and `excludeElements` parameters. +func (s *Status) ListPlaybackHistory(ctx context.Context, request operations.ListPlaybackHistoryRequest, opts ...operations.Option) (*operations.ListPlaybackHistoryResponse, error) { + globals := operations.ListPlaybackHistoryGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/status/sessions/history/all") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listPlaybackHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPlaybackHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ListPlaybackHistoryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// TerminateSession - Terminate a session +// Terminate a playback session kicking off the user +func (s *Status) TerminateSession(ctx context.Context, request operations.TerminateSessionRequest, opts ...operations.Option) (*operations.TerminateSessionResponse, error) { + globals := operations.TerminateSessionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/status/sessions/terminate") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "terminateSession", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.TerminateSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteHistory - Delete Single History Item +// Delete a single history item by id +func (s *Status) DeleteHistory(ctx context.Context, request operations.DeleteHistoryRequest, opts ...operations.Option) (*operations.DeleteHistoryResponse, error) { + globals := operations.DeleteHistoryGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/status/sessions/history/{historyId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainer + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainer = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetHistoryItem - Get Single History Item +// Get a single history item by id +func (s *Status) GetHistoryItem(ctx context.Context, request operations.GetHistoryItemRequest, opts ...operations.Option) (*operations.GetHistoryItemResponse, error) { + globals := operations.GetHistoryItemGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/status/sessions/history/{historyId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getHistoryItem", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetHistoryItemResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.HistoryAllGetResponses200 + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.HistoryAllGetResponses200 = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/subscriptions.go b/subscriptions.go new file mode 100644 index 0000000..f5ef713 --- /dev/null +++ b/subscriptions.go @@ -0,0 +1,2228 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available +type Subscriptions struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newSubscriptions(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Subscriptions { + return &Subscriptions{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetAllSubscriptions - Get all subscriptions +// Get all subscriptions and potentially the grabs too +func (s *Subscriptions) GetAllSubscriptions(ctx context.Context, request operations.GetAllSubscriptionsRequest, opts ...operations.Option) (*operations.GetAllSubscriptionsResponse, error) { + globals := operations.GetAllSubscriptionsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/subscriptions") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAllSubscriptions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAllSubscriptionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSubscription + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSubscription = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreateSubscription - Create a subscription +// Create a subscription. The query parameters should be mostly derived from the [template](#tag/Subscriptions/operation/mediaSubscriptionsGetTemplate) +func (s *Subscriptions) CreateSubscription(ctx context.Context, request operations.CreateSubscriptionRequest, opts ...operations.Option) (*operations.CreateSubscriptionResponse, error) { + globals := operations.CreateSubscriptionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/subscriptions") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createSubscription", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "409", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateSubscriptionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.CreateSubscriptionResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 409: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ProcessSubscriptions - Process all subscriptions +// Process all subscriptions asynchronously +func (s *Subscriptions) ProcessSubscriptions(ctx context.Context, opts ...operations.Option) (*operations.ProcessSubscriptionsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/subscriptions/process") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "processSubscriptions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ProcessSubscriptionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetScheduledRecordings - Get all scheduled recordings +// Get all scheduled recordings across all subscriptions +func (s *Subscriptions) GetScheduledRecordings(ctx context.Context, opts ...operations.Option) (*operations.GetScheduledRecordingsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/subscriptions/scheduled") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getScheduledRecordings", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetScheduledRecordingsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetScheduledRecordingsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetTemplate - Get the subscription template +// Get the templates for a piece of media which could include fetching one airing, season, the whole show, etc. +func (s *Subscriptions) GetTemplate(ctx context.Context, request operations.GetTemplateRequest, opts ...operations.Option) (*operations.GetTemplateResponse, error) { + globals := operations.GetTemplateGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/media/subscriptions/template") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getTemplate", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetTemplateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + res.Headers = httpRes.Header + + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetTemplateResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CancelGrab - Cancel an existing grab +// Cancels an existing media grab (recording). It can be used to resolve a conflict which exists for a rolling subscription. +// Note: This cancellation does not persist across a server restart, but neither does a rolling subscription itself. +func (s *Subscriptions) CancelGrab(ctx context.Context, request operations.CancelGrabRequest, opts ...operations.Option) (*operations.CancelGrabResponse, error) { + globals := operations.CancelGrabGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/grabbers/operations/{operationId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "cancelGrab", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CancelGrabResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteSubscription - Delete a subscription +// Delete a subscription, cancelling all of its grabs as well +func (s *Subscriptions) DeleteSubscription(ctx context.Context, request operations.DeleteSubscriptionRequest, opts ...operations.Option) (*operations.DeleteSubscriptionResponse, error) { + globals := operations.DeleteSubscriptionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/subscriptions/{subscriptionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteSubscription", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteSubscriptionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetSubscription - Get a single subscription +// Get a single subscription and potentially the grabs too +func (s *Subscriptions) GetSubscription(ctx context.Context, request operations.GetSubscriptionRequest, opts ...operations.Option) (*operations.GetSubscriptionResponse, error) { + globals := operations.GetSubscriptionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/subscriptions/{subscriptionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getSubscription", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetSubscriptionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSubscription + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSubscription = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// EditSubscriptionPreferences - Edit a subscription +// Edit a subscription's preferences +func (s *Subscriptions) EditSubscriptionPreferences(ctx context.Context, request operations.EditSubscriptionPreferencesRequest, opts ...operations.Option) (*operations.EditSubscriptionPreferencesResponse, error) { + globals := operations.EditSubscriptionPreferencesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/subscriptions/{subscriptionId}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "editSubscriptionPreferences", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.EditSubscriptionPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSubscription + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSubscription = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ReorderSubscription - Re-order a subscription +// Re-order a subscription to change its priority +func (s *Subscriptions) ReorderSubscription(ctx context.Context, request operations.ReorderSubscriptionRequest, opts ...operations.Option) (*operations.ReorderSubscriptionResponse, error) { + globals := operations.ReorderSubscriptionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/media/subscriptions/{subscriptionId}/move", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "reorderSubscription", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ReorderSubscriptionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithSubscription + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithSubscription = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/timeline.go b/timeline.go new file mode 100644 index 0000000..7eff8a1 --- /dev/null +++ b/timeline.go @@ -0,0 +1,679 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Timeline - The actions feature within a media provider +type Timeline struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newTimeline(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Timeline { + return &Timeline{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// MarkPlayed - Mark an item as played +// Mark an item as played. Note, this does not create any view history of this item but rather just sets the state as played. The client must provide either the `key` or `uri` query parameter +// This API does respond to the GET verb but applications should use PUT +func (s *Timeline) MarkPlayed(ctx context.Context, request operations.MarkPlayedRequest, opts ...operations.Option) (*operations.MarkPlayedResponse, error) { + globals := operations.MarkPlayedGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/scrobble") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "markPlayed", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MarkPlayedResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Report media timeline +// This endpoint is hit during media playback for an item. It must be hit whenever the play state changes, or in the absence of a play state change, in a regular fashion (generally this means every 10 seconds on a LAN/WAN, and every 20 seconds over cellular). +func (s *Timeline) Report(ctx context.Context, request operations.ReportRequest, opts ...operations.Option) (*operations.ReportResponse, error) { + globals := operations.ReportGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/timeline") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "report", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ReportResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.ReportResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Unscrobble - Mark an item as unplayed +// Mark an item as unplayed. The client must provide either the `key` or `uri` query parameter +// This API does respond to the GET verb but applications should use PUT +func (s *Timeline) Unscrobble(ctx context.Context, request operations.UnscrobbleRequest, opts ...operations.Option) (*operations.UnscrobbleResponse, error) { + globals := operations.UnscrobbleGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/:/unscrobble") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "unscrobble", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UnscrobbleResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/transcoder.go b/transcoder.go new file mode 100644 index 0000000..bea8cea --- /dev/null +++ b/transcoder.go @@ -0,0 +1,1140 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// Transcoder - API Operations against the Transcoder +type Transcoder struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newTranscoder(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Transcoder { + return &Transcoder{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// TranscodeImage - Transcode an image +// Transcode an image, possibly changing format or size +func (s *Transcoder) TranscodeImage(ctx context.Context, request operations.TranscodeImageRequest, opts ...operations.Option) (*operations.TranscodeImageResponse, error) { + globals := operations.TranscodeImageGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + operations.SupportedOptionAcceptHeaderOverride, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/photo/:/transcode") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "transcodeImage", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + if o.AcceptHeaderOverride != nil { + req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) + } else { + req.Header.Set("Accept", "image/jpeg;q=1, image/png;q=0.7, image/x-portable-pixmap;q=0") + } + + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.TranscodeImageResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/jpeg`): + res.TwoHundredImageJpegResponseStream = httpRes.Body + + return res, nil + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/png`): + res.TwoHundredImagePngResponseStream = httpRes.Body + + return res, nil + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/x-portable-pixmap`): + res.TwoHundredImageXPortablePixmapResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// MakeDecision - Make a decision on media playback +// Make a decision on media playback based on client profile, and requested settings such as bandwidth and resolution. +func (s *Transcoder) MakeDecision(ctx context.Context, request operations.MakeDecisionRequest, opts ...operations.Option) (*operations.MakeDecisionResponse, error) { + globals := operations.MakeDecisionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/{transcodeType}/:/transcode/universal/decision", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "makeDecision", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.MakeDecisionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.MediaContainerWithDecision + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MediaContainerWithDecision = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// TriggerFallback - Manually trigger a transcoder fallback +// Manually trigger a transcoder fallback ex: HEVC to h.264 or hw to sw +func (s *Transcoder) TriggerFallback(ctx context.Context, request operations.TriggerFallbackRequest, opts ...operations.Option) (*operations.TriggerFallbackResponse, error) { + globals := operations.TriggerFallbackGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/{transcodeType}/:/transcode/universal/fallback", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "triggerFallback", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "412", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.TriggerFallbackResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 412: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// TranscodeSubtitles - Transcode subtitles +// Only transcode subtitle streams. +func (s *Transcoder) TranscodeSubtitles(ctx context.Context, request operations.TranscodeSubtitlesRequest, opts ...operations.Option) (*operations.TranscodeSubtitlesResponse, error) { + globals := operations.TranscodeSubtitlesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/{transcodeType}/:/transcode/universal/subtitles", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "transcodeSubtitles", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.TranscodeSubtitlesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// StartTranscodeSession - Start A Transcoding Session +// Starts the transcoder and returns the corresponding streaming resource document. +func (s *Transcoder) StartTranscodeSession(ctx context.Context, request operations.StartTranscodeSessionRequest, opts ...operations.Option) (*operations.StartTranscodeSessionResponse, error) { + globals := operations.StartTranscodeSessionGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/{transcodeType}/:/transcode/universal/start.{extension}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "startTranscodeSession", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "video/x-matroska") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "403", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.StartTranscodeSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `video/x-matroska`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/ultrablur.go b/ultrablur.go new file mode 100644 index 0000000..56412f4 --- /dev/null +++ b/ultrablur.go @@ -0,0 +1,480 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/config" + "github.com/LukeHagar/plexgo/internal/hooks" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "github.com/LukeHagar/plexgo/retry" + "net/http" + "net/url" +) + +// UltraBlur - Service provided to compute UltraBlur colors and images. +type UltraBlur struct { + rootSDK *PlexAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newUltraBlur(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *UltraBlur { + return &UltraBlur{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetColors - Get UltraBlur Colors +// Retrieves the four colors extracted from an image for clients to use to generate an ultrablur image. +func (s *UltraBlur) GetColors(ctx context.Context, request operations.GetColorsRequest, opts ...operations.Option) (*operations.GetColorsResponse, error) { + globals := operations.GetColorsGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/services/ultrablur/colors") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getColors", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetColorsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetColorsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetImage - Get UltraBlur Image +// Retrieves a server-side generated UltraBlur image based on the provided color inputs. Clients should always call this via the photo transcoder endpoint. +func (s *UltraBlur) GetImage(ctx context.Context, request operations.GetImageRequest, opts ...operations.Option) (*operations.GetImageResponse, error) { + globals := operations.GetImageGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/services/ultrablur/image") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getImage", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "image/png") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetImageResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `image/png`): + res.ResponseStream = httpRes.Body + + return res, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/updater.go b/updater.go index bf85d36..07b3756 100644 --- a/updater.go +++ b/updater.go @@ -32,9 +32,423 @@ func newUpdater(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hook } } -// GetUpdateStatus - Querying status of updates -// Querying status of updates -func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option) (*operations.GetUpdateStatusResponse, error) { +// ApplyUpdates - Applying updates +// Apply any downloaded updates. Note that the two parameters `tonight` and `skip` 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, request operations.ApplyUpdatesRequest, opts ...operations.Option) (*operations.ApplyUpdatesResponse, error) { + globals := operations.ApplyUpdatesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/updater/apply") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "applyUpdates", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ApplyUpdatesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CheckUpdates - Checking for updates +// Perform an update check and potentially download +func (s *Updater) CheckUpdates(ctx context.Context, request operations.CheckUpdatesRequest, opts ...operations.Option) (*operations.CheckUpdatesResponse, error) { + globals := operations.CheckUpdatesGlobals{ + Accepts: s.sdkConfiguration.Globals.Accepts, + ClientIdentifier: s.sdkConfiguration.Globals.ClientIdentifier, + Product: s.sdkConfiguration.Globals.Product, + Version: s.sdkConfiguration.Globals.Version, + Platform: s.sdkConfiguration.Globals.Platform, + PlatformVersion: s.sdkConfiguration.Globals.PlatformVersion, + Device: s.sdkConfiguration.Globals.Device, + Model: s.sdkConfiguration.Globals.Model, + DeviceVendor: s.sdkConfiguration.Globals.DeviceVendor, + DeviceName: s.sdkConfiguration.Globals.DeviceName, + Marketplace: s.sdkConfiguration.Globals.Marketplace, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/updater/check") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "checkUpdates", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + utils.PopulateHeaders(ctx, req, request, globals) + + if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CheckUpdatesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetUpdatesStatus - Querying status of updates +// Get the status of updating the server +func (s *Updater) GetUpdatesStatus(ctx context.Context, opts ...operations.Option) (*operations.GetUpdatesStatusResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -63,8 +477,8 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getUpdateStatus", - OAuth2Scopes: []string{}, + OperationID: "getUpdatesStatus", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -170,7 +584,7 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -185,7 +599,7 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option } } - res := &operations.GetUpdateStatusResponse{ + res := &operations.GetUpdatesStatusResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -200,7 +614,7 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option return nil, err } - var out operations.GetUpdateStatusResponseBody + var out operations.GetUpdatesStatusResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -213,50 +627,6 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option } return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetUpdateStatusBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetUpdateStatusUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -280,480 +650,3 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option return res, nil } - -// CheckForUpdates - Checking for updates -// Checking for updates -func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Download, opts ...operations.Option) (*operations.CheckForUpdatesResponse, error) { - request := operations.CheckForUpdatesRequest{ - Download: download, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/updater/check") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "checkForUpdates", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.CheckForUpdatesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.CheckForUpdatesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.CheckForUpdatesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", 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, opts ...operations.Option) (*operations.ApplyUpdatesResponse, error) { - request := operations.ApplyUpdatesRequest{ - Tonight: tonight, - Skip: skip, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/updater/apply") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "applyUpdates", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "500", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.ApplyUpdatesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.ApplyUpdatesBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.ApplyUpdatesUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/users.go b/users.go deleted file mode 100644 index 7dff7df..0000000 --- a/users.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -type Users struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newUsers(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Users { - return &Users{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// GetUsers - Get list of all connected users -// Get list of all users that are friends and have library access with the provided Plex authentication token -func (s *Users) GetUsers(ctx context.Context, request operations.GetUsersRequest, opts ...operations.Option) (*operations.GetUsersResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetUsersServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := url.JoinPath(baseURL, "/users") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-users", - OAuth2Scopes: []string{}, - SecuritySource: nil, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "application/xml") - req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - - utils.PopulateHeaders(ctx, req, request, nil) - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetUsersResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/xml`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - res.Body = rawBody - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetUsersBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetUsersUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/video.go b/video.go deleted file mode 100644 index 17c4b38..0000000 --- a/video.go +++ /dev/null @@ -1,498 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" - "net/url" -) - -// Video - API Calls that perform operations with Plex Media Server Videos -type Video struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newVideo(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Video { - return &Video{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// 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, opts ...operations.Option) (*operations.GetTimelineResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/:/timeline") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "getTimeline", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTimelineResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTimelineBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetTimelineUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// StartUniversalTranscode - Start Universal Transcode -// Begin a Universal Transcode Session -func (s *Video) StartUniversalTranscode(ctx context.Context, request operations.StartUniversalTranscodeRequest, opts ...operations.Option) (*operations.StartUniversalTranscodeResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := url.JoinPath(baseURL, "/video/:/transcode/universal/start.mpd") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "startUniversalTranscode", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.StartUniversalTranscodeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StartUniversalTranscodeBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.StartUniversalTranscodeUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} diff --git a/watchlist.go b/watchlist.go deleted file mode 100644 index c63455e..0000000 --- a/watchlist.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package plexgo - -import ( - "bytes" - "context" - "fmt" - "github.com/LukeHagar/plexgo/internal/config" - "github.com/LukeHagar/plexgo/internal/hooks" - "github.com/LukeHagar/plexgo/internal/utils" - "github.com/LukeHagar/plexgo/models/operations" - "github.com/LukeHagar/plexgo/models/sdkerrors" - "github.com/LukeHagar/plexgo/retry" - "net/http" -) - -// Watchlist - API Calls that perform operations with Plex Media Server Watchlists -type Watchlist struct { - rootSDK *PlexAPI - sdkConfiguration config.SDKConfiguration - hooks *hooks.Hooks -} - -func newWatchlist(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Watchlist { - return &Watchlist{ - rootSDK: rootSDK, - sdkConfiguration: sdkConfig, - hooks: hooks, - } -} - -// GetWatchList - Get User Watchlist -// Get User Watchlist -func (s *Watchlist) GetWatchList(ctx context.Context, request operations.GetWatchListRequest, opts ...operations.Option) (*operations.GetWatchListResponse, error) { - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - baseURL := utils.ReplaceParameters(operations.GetWatchListServerList[0], map[string]string{}) - if o.ServerURL != nil { - baseURL = *o.ServerURL - } - - opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/watchlist/{filter}", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "get-watch-list", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, 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) - - utils.PopulateHeaders(ctx, req, request, nil) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetWatchListResponse{ - StatusCode: httpRes.StatusCode, - ContentType: httpRes.Header.Get("Content-Type"), - RawResponse: httpRes, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.GetWatchListResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetWatchListBadRequest - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out sdkerrors.GetWatchListUnauthorized - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - out.RawResponse = httpRes - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -}